Using fetch instead of xhr, grabbing title for YouTube

This commit is contained in:
Sam Potts
2017-11-16 11:38:06 +01:00
parent c64b8f6940
commit d7a1c44281
12 changed files with 47 additions and 50 deletions

View File

@ -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