Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updates seekbar position after mouse up event is triggered. #6372

Merged
merged 2 commits into from
Dec 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions 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 @@ -325,16 +326,12 @@ class SeekBar extends Slider {
}
this.player_.scrubbing(false);

/**
* Trigger timeupdate because we're done seeking and the time has changed.
* This is particularly useful for if the player is paused to time the time displays.
*
* @event Tech#timeupdate
* @type {EventTarget~Event}
*/
this.player_.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true });
gjanblaszczyk marked this conversation as resolved.
Show resolved Hide resolved
if (this.videoWasPlaying) {
silencePromise(this.player_.play());
} else {
gjanblaszczyk marked this conversation as resolved.
Show resolved Hide resolved
// 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