From 9c6225b4aa28dacddbaba4d42011f6fc94543a78 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 962da479f4..df362e3b6f 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2509,6 +2509,10 @@ class Player extends Component { this.techCall_('setCurrentTime', seconds); this.cache_.initTime = 0; + + if (isFinite(seconds)) { + this.cache_.currentTime = Number(seconds); + } } /**