diff options
author | Sam Potts <sam@potts.es> | 2018-07-30 23:09:12 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-07-30 23:09:12 +1000 |
commit | dae272ef66a967ed23a2fe48cf68b0273349b89e (patch) | |
tree | 96d88efe747478262e9ac02c775e7b62f3162157 /src/js | |
parent | 599b33e55fb4c0aec78cd0895bcd13f3fed12ad2 (diff) | |
parent | 2679c5898edd534d19b5b2f68d895641c3e3fb1a (diff) | |
download | plyr-dae272ef66a967ed23a2fe48cf68b0273349b89e.tar.lz plyr-dae272ef66a967ed23a2fe48cf68b0273349b89e.tar.xz plyr-dae272ef66a967ed23a2fe48cf68b0273349b89e.zip |
Merge branch 'develop' into a11y-improvements
# Conflicts:
# demo/dist/demo.css
# dist/plyr.css
# dist/plyr.js.map
# dist/plyr.min.js
# dist/plyr.min.js.map
# dist/plyr.polyfilled.js.map
# dist/plyr.polyfilled.min.js
# dist/plyr.polyfilled.min.js.map
# package.json
# src/js/plyr.js
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/controls.js | 9 | ||||
-rw-r--r-- | src/js/plugins/youtube.js | 5 | ||||
-rw-r--r-- | src/js/plyr.js | 8 | ||||
-rw-r--r-- | src/js/plyr.polyfilled.js | 2 |
4 files changed, 13 insertions, 11 deletions
diff --git a/src/js/controls.js b/src/js/controls.js index 27611b2f..5c1446d3 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -1550,12 +1550,9 @@ const controls = { target = this.elements.container; } - // Inject controls HTML - if (is.element(container)) { - target.appendChild(container); - } else if (container) { - target.insertAdjacentHTML('beforeend', container); - } + // Inject controls HTML (needs to be before captions, hence "afterbegin") + const insertMethod = is.element(container) ? 'insertAdjacentElement' : 'insertAdjacentHTML'; + target[insertMethod]('afterbegin', container); // Find the elements if need be if (!is.element(this.elements.controls)) { diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index b521be3c..66a73acf 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -188,6 +188,7 @@ const youtube = { videoId, playerVars: { autoplay: player.config.autoplay ? 1 : 0, // Autoplay + hl: player.config.hl, // iframe interface language controls: player.supported.ui ? 0 : 1, // Only show controls if not fully supported rel: 0, // No related vids showinfo: 0, // Hide info @@ -239,6 +240,10 @@ const youtube = { triggerEvent.call(player, player.media, 'ratechange'); }, onReady(event) { + // Bail if onReady has already been called. See issue #1108 + if (is.function(player.media.play)) { + return; + } // Get the instance const instance = event.target; diff --git a/src/js/plyr.js b/src/js/plyr.js index b4c54ca8..f33b39c7 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr -// plyr.js v3.3.22 +// plyr.js v3.3.23 // https://github.com/sampotts/plyr // License: The MIT License (MIT) // ========================================================================== @@ -178,7 +178,7 @@ class Plyr { this.elements.container.className = ''; // Get attributes from URL and set config - if (url.searchParams.length) { + if (url.search.length) { const truthy = ['1', 'true']; if (truthy.includes(url.searchParams.get('autoplay'))) { @@ -191,8 +191,8 @@ class Plyr { // TODO: replace fullscreen.iosNative with this playsinline config option // YouTube requires the playsinline in the URL if (this.isYouTube) { - this.config.playsinline = truthy.includes( - url.searchParams.get('playsinline'), + this.config.playsinline = truthy.includes(url.searchParams.get('playsinline')); + this.config.hl = url.searchParams.get('hl'); ); } else { this.config.playsinline = true; diff --git a/src/js/plyr.polyfilled.js b/src/js/plyr.polyfilled.js index 574ad5e5..7553ee91 100644 --- a/src/js/plyr.polyfilled.js +++ b/src/js/plyr.polyfilled.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr Polyfilled Build -// plyr.js v3.3.22 +// plyr.js v3.3.23 // https://github.com/sampotts/plyr // License: The MIT License (MIT) // ========================================================================== |