From 7bf07595535c69b818ee2307460eebb18087ee39 Mon Sep 17 00:00:00 2001 From: amtins Date: Sat, 20 May 2023 17:16:26 +0200 Subject: [PATCH] fix(player): cache_.currentTime is not updated when the current time is set Updating cache_.currentTime as soon as the currentTime is set avoids having to wait for the timeupdate event, which results in: - making cache_.currentTime more reliable - updating the progress bar on mouse up after dragging when the media is paused. See also: #6232, #6234, #6370, #6372 --- src/js/player.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/player.js b/src/js/player.js index 6d7f61d725..e516d7aea1 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2486,6 +2486,10 @@ class Player extends Component { this.techCall_('setCurrentTime', seconds); this.cache_.initTime = 0; + + if (isFinite(seconds)) { + this.cache_.currentTime = Number(seconds); + } } /**