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

@ -119,8 +119,11 @@ const vimeo = {
iframe.setAttribute('allowtransparency', '');
iframe.setAttribute('allow', 'autoplay');
// Get poster, if already set
const { poster } = player;
// Inject the package
const wrapper = createElement('div', { class: player.config.classNames.embedContainer });
const wrapper = createElement('div', { poster, class: player.config.classNames.embedContainer });
wrapper.appendChild(iframe);
player.media = replaceElement(wrapper, player.media);