aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-11-03 21:17:32 +1100
committerSam Potts <sam@potts.es>2018-11-03 21:17:32 +1100
commit67f908aa8d9fb9f6fdc1c7eb615eb1f58fb62ba4 (patch)
treecaf14b243dd5b31d0c202833cd08ac6c4b4cfb00
parent65eb5c1b8bd68bf2e898f7acc8703e02359377c9 (diff)
downloadplyr-67f908aa8d9fb9f6fdc1c7eb615eb1f58fb62ba4.tar.lz
plyr-67f908aa8d9fb9f6fdc1c7eb615eb1f58fb62ba4.tar.xz
plyr-67f908aa8d9fb9f6fdc1c7eb615eb1f58fb62ba4.zip
Load media after UI is built
-rw-r--r--src/js/source.js10
1 files changed, 6 insertions, 4 deletions
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();
},