-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update rail only if controls are visible. #1683
Comments
@vivekannan Thanks for pointing this. We are preparing a PR to solve this issue |
Actually, its seem that the timeupdate event is assured to be called at least once every 250ms in Chrome and other browsers. In Firefox its even worse (or better), for every frame!!! I am working on an app that uses this player as a base where battery life is important. So I re-wrote the code so that the callback itself is removed after the controls are hidden and reapplied when they are visible. Makes a reallllly big difference in battery life when you are watching hours of videos. |
@vivekannan I see. Check the PR linked to this issue and let me know if that works for you |
In my app, I have changed it into something like this,
|
Thanks for sharing your answer. Did you by any chance tested the PR linked to this issue? Just to verify that it solves your issue as well from the core |
Yeah, this should work. This was my initial solution. Shall I close the issue? |
@vivekannan You can close this one once it's merged into the master branch. I'll let you know when this happens |
'timeupdate' eventListener calls the updateCurrent and updateDuration methods even if the controls are hidden. This is unnecessary as tons of CPU cycles are wasted which results in bad battery life. So make the eventListener check controlsAreVisible.
The text was updated successfully, but these errors were encountered: