HTML5 poster fixes for multiple downloads

This commit is contained in:
Sam Potts 2020-01-21 22:28:48 +00:00
parent 89136bc2e6
commit 71d6f59d56
3 changed files with 12 additions and 4 deletions

View File

@ -89,6 +89,10 @@ const html5 = {
if (preload !== 'none' || readyState) { if (preload !== 'none' || readyState) {
// Restore time // Restore time
player.once('loadedmetadata', () => { player.once('loadedmetadata', () => {
if (player.currentTime === 0) {
return;
}
player.currentTime = currentTime; player.currentTime = currentTime;
// Resume playing // Resume playing

View File

@ -39,12 +39,14 @@ const media = {
wrap(this.media, this.elements.wrapper); wrap(this.media, this.elements.wrapper);
// Faux poster container // Faux poster container
if (this.isEmbed) {
this.elements.poster = createElement('div', { this.elements.poster = createElement('div', {
class: this.config.classNames.poster, class: this.config.classNames.poster,
}); });
this.elements.wrapper.appendChild(this.elements.poster); this.elements.wrapper.appendChild(this.elements.poster);
} }
}
if (this.isHTML5) { if (this.isHTML5) {
html5.extend.call(this); html5.extend.call(this);

View File

@ -198,7 +198,9 @@ const ui = {
// Reset backgroundSize as well (since it can be set to "cover" for padded thumbnails for youtube) // Reset backgroundSize as well (since it can be set to "cover" for padded thumbnails for youtube)
backgroundSize: '', backgroundSize: '',
}); });
ui.togglePoster.call(this, true); ui.togglePoster.call(this, true);
return poster; return poster;
}) })
); );