diff options
author | Sam Potts <sam@potts.es> | 2018-04-18 18:29:43 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-04-18 18:29:43 +1000 |
commit | a97b08e8ea0022646eae005ce64a7edf8b26fb29 (patch) | |
tree | 5cbf4ec5cfcfb5c22d4ae8143ea52a7a888eb276 /src/js/plugins | |
parent | 88d766aeae6084dccd1903c2c358b8d1dfdfbce0 (diff) | |
download | plyr-a97b08e8ea0022646eae005ce64a7edf8b26fb29.tar.lz plyr-a97b08e8ea0022646eae005ce64a7edf8b26fb29.tar.xz plyr-a97b08e8ea0022646eae005ce64a7edf8b26fb29.zip |
ARIA and Vimeo fixes
Diffstat (limited to 'src/js/plugins')
-rw-r--r-- | src/js/plugins/vimeo.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js index a250d096..24003d3f 100644 --- a/src/js/plugins/vimeo.js +++ b/src/js/plugins/vimeo.js @@ -134,7 +134,9 @@ const vimeo = { utils.dispatchEvent.call(player, player.media, 'seeking'); // Seek after events - player.embed.setCurrentTime(time); + player.embed.setCurrentTime(time).catch(() => { + // Do nothing + }); // Restore pause state if (paused) { @@ -320,6 +322,15 @@ const vimeo = { if (parseInt(data.percent, 10) === 1) { utils.dispatchEvent.call(player, player.media, 'canplaythrough'); } + + // Get duration as if we do it before load, it gives an incorrect value + // https://github.com/sampotts/plyr/issues/891 + player.embed.getDuration().then(value => { + if (value !== player.media.duration) { + player.media.duration = value; + utils.dispatchEvent.call(player, player.media, 'durationchange'); + } + }); }); player.embed.on('seeked', () => { |