Copy poster when creating new media element for YouTube and Vimeo (needed for #1018)
This commit is contained in:
parent
f1c4752036
commit
aab2817ddc
@ -119,8 +119,11 @@ const vimeo = {
|
|||||||
iframe.setAttribute('allowtransparency', '');
|
iframe.setAttribute('allowtransparency', '');
|
||||||
iframe.setAttribute('allow', 'autoplay');
|
iframe.setAttribute('allow', 'autoplay');
|
||||||
|
|
||||||
|
// Get poster, if already set
|
||||||
|
const { poster } = player;
|
||||||
|
|
||||||
// Inject the package
|
// 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);
|
wrapper.appendChild(iframe);
|
||||||
player.media = replaceElement(wrapper, player.media);
|
player.media = replaceElement(wrapper, player.media);
|
||||||
|
|
||||||
|
@ -158,7 +158,12 @@ const youtube = {
|
|||||||
// Replace the <iframe> with a <div> due to YouTube API issues
|
// Replace the <iframe> with a <div> due to YouTube API issues
|
||||||
const videoId = parseId(source);
|
const videoId = parseId(source);
|
||||||
const id = generateId(player.provider);
|
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);
|
player.media = replaceElement(container, player.media);
|
||||||
|
|
||||||
// Set poster image
|
// Set poster image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user