Skip to content

Commit cd4076a

Browse files
gjanblaszczykgkatsev
authored andcommitted
fix: updates seekbar position after mouse up event is triggered. (#6372)
When we are paused, call update directly, otherwise, call the throttled update. Fixes #6232, fixes #6234, fixes #6370.
1 parent 917d898 commit cd4076a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/js/control-bar/progress-control/seek-bar.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class SeekBar extends Slider {
5252
* @private
5353
*/
5454
setEventHandlers_() {
55-
this.update = Fn.throttle(Fn.bind(this, this.update), UPDATE_REFRESH_INTERVAL);
55+
this.update_ = Fn.bind(this, this.update);
56+
this.update = Fn.throttle(this.update_, UPDATE_REFRESH_INTERVAL);
5657

5758
this.on(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);
5859
if (this.player_.liveTracker) {
@@ -335,6 +336,10 @@ class SeekBar extends Slider {
335336
this.player_.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true });
336337
if (this.videoWasPlaying) {
337338
silencePromise(this.player_.play());
339+
} else {
340+
// We're done seeking and the time has changed.
341+
// If the player is paused, make sure we display the correct time on the seek bar.
342+
this.update_();
338343
}
339344
}
340345

0 commit comments

Comments
 (0)