From a97b08e8ea0022646eae005ce64a7edf8b26fb29 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Wed, 18 Apr 2018 18:29:43 +1000 Subject: ARIA and Vimeo fixes --- src/js/plugins/vimeo.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/js/plugins') 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', () => { -- cgit v1.2.3