diff options
author | Albin Larsson <mail@albinlarsson.com> | 2018-06-15 22:57:16 +0200 |
---|---|---|
committer | Albin Larsson <mail@albinlarsson.com> | 2018-06-15 22:57:16 +0200 |
commit | aab2817ddcd9ced700980001f3c5541195a714c8 (patch) | |
tree | 879355ecfe70a5c3b0ae325e3bf8562858d9d4c4 /src/js/plugins/youtube.js | |
parent | f1c4752036f58e01df95c30cc9cba4156a0737cd (diff) | |
download | plyr-aab2817ddcd9ced700980001f3c5541195a714c8.tar.lz plyr-aab2817ddcd9ced700980001f3c5541195a714c8.tar.xz plyr-aab2817ddcd9ced700980001f3c5541195a714c8.zip |
Copy poster when creating new media element for YouTube and Vimeo (needed for #1018)
Diffstat (limited to 'src/js/plugins/youtube.js')
-rw-r--r-- | src/js/plugins/youtube.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index a1e52b48..8c4ebc1c 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -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 |