aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/vimeo.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-17 00:40:28 +1000
committerGitHub <noreply@github.com>2018-06-17 00:40:28 +1000
commitccc2608cf62f1406c3d626ed8dbd31f1acd714ce (patch)
tree0881e678c29c6e147c254b10f490768858df673a /src/js/plugins/vimeo.js
parentde45de0e0bbfdea63977427d70fea503274e39b6 (diff)
parent115f352ade7fbe133a42fd434dbcc1fca13287a7 (diff)
downloadplyr-ccc2608cf62f1406c3d626ed8dbd31f1acd714ce.tar.lz
plyr-ccc2608cf62f1406c3d626ed8dbd31f1acd714ce.tar.xz
plyr-ccc2608cf62f1406c3d626ed8dbd31f1acd714ce.zip
Merge pull request #1039 from friday/poster-race-conditions
Fix poster race conditions
Diffstat (limited to 'src/js/plugins/vimeo.js')
-rw-r--r--src/js/plugins/vimeo.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js
index 312d53cf..09339229 100644
--- a/src/js/plugins/vimeo.js
+++ b/src/js/plugins/vimeo.js
@@ -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);
@@ -137,7 +140,7 @@ const vimeo = {
url.pathname = `${url.pathname.split('_')[0]}.jpg`;
// Set and show poster
- ui.setPoster.call(player, url.href);
+ ui.setPoster.call(player, url.href).catch(() => {});
});
// Setup instance