From 67f908aa8d9fb9f6fdc1c7eb615eb1f58fb62ba4 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 3 Nov 2018 21:17:32 +1100 Subject: Load media after UI is built --- src/js/source.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/js/source.js b/src/js/source.js index 8c9fdf44..337c949c 100644 --- a/src/js/source.js +++ b/src/js/source.js @@ -114,12 +114,9 @@ const source = { // HTML5 stuff if (this.isHTML5) { // Setup captions - if ('tracks' in input) { + if (Object.keys(input).includes('tracks')) { source.insertElements.call(this, 'track', input.tracks); } - - // Load HTML5 sources - this.media.load(); } // If HTML5 or embed but not fully supported, setupInterface and call ready now @@ -128,6 +125,11 @@ const source = { ui.build.call(this); } + if (this.isHTML5) { + // Load HTML5 sources + this.media.load(); + } + // Update the fullscreen support this.fullscreen.update(); }, -- cgit v1.2.3