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

How do I make the play progress transition smoother for VideoJS plugin? #4526

Closed
mawenmaywin opened this issue Jul 28, 2017 · 10 comments · Fixed by #4591
Closed

How do I make the play progress transition smoother for VideoJS plugin? #4526

mawenmaywin opened this issue Jul 28, 2017 · 10 comments · Fixed by #4591

Comments

@mawenmaywin
Copy link

I am trying to make the play progress transition smoother for VideoJS plugin. I've tried to edit the CSS but it causes a delay when the video is paused or stopped. Please help.

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Play a short video that's about 5 seconds long.
  2. You will notice that the slider is jumpy.
  3. If you play a video on Youtube it is smooth even if it is a short video.

I am using the latest version of VideoJS.

@gkatsev
Copy link
Member

gkatsev commented Aug 16, 2017

Yeah, it's something we'd like to improve. We probably need to cancel the old animation and switch to animating to the new position each time the time changes.
Help in this area would be greatly appreciated.

@mawenmaywin
Copy link
Author

Thanks for the reply. I was really hoping someone already found a way to do it. I've tried to edit the Javascript code myself, but with no luck. Help in this area would indeed be greatly appreciated.

@vhmth
Copy link
Contributor

vhmth commented Aug 28, 2017

Seems like it wouldn't be that we cancel the old animation @gkatsev. Looking here:

https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control/seek-bar.js#L37

It seems like we update the seekbar on timeupdate and ended and throttle to be called at most once every 50ms. We need to do ~ 15ms if we want 60fps. Calling update on the SeekBar is directly tied to updating the PlayProgressBar:

https://github.com/videojs/video.js/blob/master/src/js/control-bar/progress-control/play-progress-bar.js#L42

However, I can't find anywhere where we actually update the width of the PlayProgressBar. Could y'all help me find that?

@vhmth
Copy link
Contributor

vhmth commented Aug 28, 2017

Nevermind I ended up changing that throttle time but it's not doing much. I think it's because the function itself is called on timeupdate, which isn't called 60 times a second. We have to set an interval on play and clear it on pause and ended. Tested locally and that seems to do it.

vhmth added a commit to loomhq/video.js that referenced this issue Nov 2, 2017
Instead of tying the play progress update lifecycle to the timeupdate
event, the update happens every 15ms. This makes it so the play progress
transitions smoothly.

Fixes videojs#4526
@apurvgandhwani
Copy link

Was this solved? @gkatsev Please let us know. Because we are still not able to implement it.

@brandonocasey
Copy link
Contributor

I think this was solved by: #4591 which has been in every version since 6.5.0. The progress bar is updated at 60fps.

@apurvgandhwani
Copy link

apurvgandhwani commented Aug 24, 2018 via email

@gkatsev
Copy link
Member

gkatsev commented Aug 24, 2018

Jumpy how? Can you provide a gif or video of how it looks and a reduced test case? How does it look to you videojs.com? Would be good if you could fill out our issue template.

@vhmth
Copy link
Contributor

vhmth commented Aug 25, 2018

@brandonocasey the progress bar updates at ~ 33 fps (just to clarify).

@apurvgandhwani what version of video.js are you using?

@apurvgandhwani
Copy link

apurvgandhwani commented Aug 25, 2018 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants