-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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: update the progress-bar correctly when pausing the video and cli… #6234
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,9 @@ class SeekBar extends Slider { | |
if (document.hidden) { | ||
this.disableInterval_(e); | ||
} else { | ||
this.enableInterval_(); | ||
if (!this.player_.paused() && !this.player_.hasClass('vjs-waiting')) { | ||
this.enableInterval_(); | ||
} | ||
|
||
// we just switched back to the page and someone may be looking, so, update ASAP | ||
this.update(); | ||
|
@@ -133,9 +135,8 @@ class SeekBar extends Slider { | |
* The current percent at a number from 0-1 | ||
*/ | ||
update(event) { | ||
const percent = super.update(); | ||
|
||
this.requestAnimationFrame(() => { | ||
const percent = super.update(); | ||
const currentTime = this.player_.ended() ? | ||
this.player_.duration() : this.getCurrentTime_(); | ||
const liveTracker = this.player_.liveTracker; | ||
|
@@ -167,8 +168,6 @@ class SeekBar extends Slider { | |
this.duration_ = duration; | ||
} | ||
}); | ||
|
||
return percent; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should still be returning this value as it may be a breaking change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, yeah, the throttling is a good point. While we may not be using it, if someone who uses Video.js is extending the SeekBar themselve and expecting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to remove the throttling of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gkatsev, If you think removing the throttling of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I don't think we should unthrottle it. I'll have to think about it a bit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, hope for a better solution. |
||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that we should end up paused with vjs-waiting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, seems like this is unrelated to the actual issue, just a nice improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a improvement.It's no need to call update if the player is paused or waiting.