diff options
author | Sam Potts <sam@potts.es> | 2018-08-14 00:00:24 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 00:00:24 +1000 |
commit | 48bf36831611a854f24f8bc9f40d0944c381bd29 (patch) | |
tree | 165ac6d7b4dbd93f9459e195eaa6c5ba2c411005 /src/js/plyr.js | |
parent | a8f8486cf49aebc09c8f57bec2f8172970974536 (diff) | |
parent | 8f94ce86a04c1b8f7cc17e7d578c6b8c76572319 (diff) | |
download | plyr-48bf36831611a854f24f8bc9f40d0944c381bd29.tar.lz plyr-48bf36831611a854f24f8bc9f40d0944c381bd29.tar.xz plyr-48bf36831611a854f24f8bc9f40d0944c381bd29.zip |
Merge pull request #1160 from sampotts/develop
v3.4.0
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r-- | src/js/plyr.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 65b6c94d..44e41cb6 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr -// plyr.js v3.3.23 +// plyr.js v3.4.0-beta.2 // https://github.com/sampotts/plyr // License: The MIT License (MIT) // ========================================================================== @@ -75,16 +75,17 @@ class Plyr { // Elements cache this.elements = { container: null, + captions: null, buttons: {}, display: {}, progress: {}, inputs: {}, settings: { + popup: null, menu: null, - panes: {}, - tabs: {}, + panels: {}, + buttons: {}, }, - captions: null, }; // Captions @@ -185,7 +186,7 @@ class Plyr { // 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'); + this.config.hl = url.searchParams.get('hl'); // TODO: Should this be setting language? } else { this.config.playsinline = true; } @@ -221,7 +222,7 @@ class Plyr { if (this.media.hasAttribute('autoplay')) { this.config.autoplay = true; } - if (this.media.hasAttribute('playsinline')) { + if (this.media.hasAttribute('playsinline') || this.media.hasAttribute('webkit-playsinline')) { this.config.playsinline = true; } if (this.media.hasAttribute('muted')) { @@ -293,7 +294,9 @@ class Plyr { this.fullscreen = new Fullscreen(this); // Setup ads if provided - this.ads = new Ads(this); + if (this.config.ads.enabled) { + this.ads = new Ads(this); + } // Autoplay if required if (this.config.autoplay) { @@ -695,9 +698,6 @@ class Plyr { quality = value; } - // Trigger request event - triggerEvent.call(this, this.media, 'qualityrequested', false, { quality }); - // Update config config.selected = quality; @@ -933,13 +933,16 @@ class Plyr { if (hiding && this.config.controls.includes('settings') && !is.empty(this.config.settings)) { controls.toggleMenu.call(this, false); } + // Trigger event on change if (hiding !== isHidden) { const eventName = hiding ? 'controlshidden' : 'controlsshown'; triggerEvent.call(this, this.media, eventName); } + return !hiding; } + return false; } |