diff options
author | Sam Potts <sam@potts.es> | 2017-11-16 11:38:06 +0100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2017-11-16 11:38:06 +0100 |
commit | d7a1c4428138d2dd5af09e41e998d1e08dafe76e (patch) | |
tree | a3f039f1a2564f43e5f3fa9f49db0527f209f04e /src/js/ui.js | |
parent | c64b8f69403b0287f55f25dc533b41cb8d34075d (diff) | |
download | plyr-d7a1c4428138d2dd5af09e41e998d1e08dafe76e.tar.lz plyr-d7a1c4428138d2dd5af09e41e998d1e08dafe76e.tar.xz plyr-d7a1c4428138d2dd5af09e41e998d1e08dafe76e.zip |
Using fetch instead of xhr, grabbing title for YouTube
Diffstat (limited to 'src/js/ui.js')
-rw-r--r-- | src/js/ui.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/js/ui.js b/src/js/ui.js index 0ecc5621..b9328888 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -96,11 +96,8 @@ const ui = { // Ready event at end of execution stack utils.dispatchEvent.call(this, this.media, 'ready'); - // Autoplay - // TODO: check we still need this? - /* if (this.isEmbed && this.config.autoplay) { - this.play(); - } */ + // Set the title + ui.setTitle.call(this); }, // Show the duration on metadataloaded @@ -137,13 +134,10 @@ const ui = { } // If there's a play button, set label - if (this.supported.ui) { - if (utils.is.htmlElement(this.elements.buttons.play)) { - this.elements.buttons.play.setAttribute('aria-label', label); - } - if (utils.is.htmlElement(this.elements.buttons.playLarge)) { - this.elements.buttons.playLarge.setAttribute('aria-label', label); - } + if (utils.is.nodeList(this.elements.buttons.play)) { + Array.from(this.elements.buttons.play).forEach(button => { + button.setAttribute('aria-label', label); + }); } // Set iframe title |