Skip to content

Commit

Permalink
fix: updates seekbar position after mouse up event is triggered. (#6372)
Browse files Browse the repository at this point in the history
When we are paused, call update directly, otherwise, call the throttled update.

Fixes #6232, fixes #6234, fixes #6370.
  • Loading branch information
gjanblaszczyk authored and gkatsev committed Dec 24, 2019
1 parent 917d898 commit cd4076a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/control-bar/progress-control/seek-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class SeekBar extends Slider {
* @private
*/
setEventHandlers_() {
this.update = Fn.throttle(Fn.bind(this, this.update), UPDATE_REFRESH_INTERVAL);
this.update_ = Fn.bind(this, this.update);
this.update = Fn.throttle(this.update_, UPDATE_REFRESH_INTERVAL);

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

Expand Down

0 comments on commit cd4076a

Please sign in to comment.