From d7a1c4428138d2dd5af09e41e998d1e08dafe76e Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Thu, 16 Nov 2017 11:38:06 +0100 Subject: Using fetch instead of xhr, grabbing title for YouTube --- src/js/ui.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/js/ui.js') 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 -- cgit v1.2.3