Copy poster when creating new media element for YouTube and Vimeo (needed for #1018)

This commit is contained in:
Albin Larsson
2018-06-15 22:57:16 +02:00
parent f1c4752036
commit aab2817ddc
2 changed files with 10 additions and 2 deletions

View File

@ -158,7 +158,12 @@ const youtube = {
// Replace the <iframe> with a <div> due to YouTube API issues
const videoId = parseId(source);
const id = generateId(player.provider);
const container = createElement('div', { id });
// Get poster, if already set
const { poster } = player;
// Replace media element
const container = createElement('div', { id, poster });
player.media = replaceElement(container, player.media);
// Set poster image