diff options
author | Sam Potts <sam@potts.es> | 2018-07-30 22:54:03 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-30 22:54:03 +1000 |
commit | efb7401e6d754034a0d8ffe13156a8bab4e0d060 (patch) | |
tree | d0bc86a50e00ee8302becea84829edecdedb61f5 /dist/plyr.js | |
parent | 0933b48c2a1990a19ac7f0b15ba639b30fb3d8db (diff) | |
parent | 60a0f0c9799cfa5c9f207971168b07f23f7ee41c (diff) | |
download | plyr-efb7401e6d754034a0d8ffe13156a8bab4e0d060.tar.lz plyr-efb7401e6d754034a0d8ffe13156a8bab4e0d060.tar.xz plyr-efb7401e6d754034a0d8ffe13156a8bab4e0d060.zip |
Merge pull request #1136 from sampotts/develop
v3.3.23
Diffstat (limited to 'dist/plyr.js')
-rw-r--r-- | dist/plyr.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/dist/plyr.js b/dist/plyr.js index 1a66b2ef..197c8b06 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -2762,12 +2762,9 @@ typeof navigator === "object" && (function (global, factory) { 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") + var insertMethod = is.element(container) ? 'insertAdjacentElement' : 'insertAdjacentHTML'; + target[insertMethod]('afterbegin', container); // Find the elements if need be if (!is.element(this.elements.controls)) { @@ -5782,6 +5779,7 @@ typeof navigator === "object" && (function (global, factory) { videoId: 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 @@ -5832,6 +5830,10 @@ typeof navigator === "object" && (function (global, factory) { triggerEvent.call(player, player.media, 'ratechange'); }, onReady: function onReady(event) { + // Bail if onReady has already been called. See issue #1108 + if (is.function(player.media.play)) { + return; + } // Get the instance var instance = event.target; @@ -7087,7 +7089,7 @@ typeof navigator === "object" && (function (global, factory) { this.elements.container.className = ''; // Get attributes from URL and set config - if (url.searchParams.length) { + if (url.search.length) { var truthy = ['1', 'true']; if (truthy.includes(url.searchParams.get('autoplay'))) { @@ -7101,6 +7103,7 @@ typeof navigator === "object" && (function (global, factory) { // YouTube requires the playsinline in the URL if (this.isYouTube) { this.config.playsinline = truthy.includes(url.searchParams.get('playsinline')); + this.config.hl = url.searchParams.get('hl'); } else { this.config.playsinline = true; } |