-
Notifications
You must be signed in to change notification settings - Fork 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 time bar more frequently for short videos #5040
Comments
Do you just mean the frequency with which the current position is updated during playback (i.e. nothing to do with the user seeking to a different position)? If so then the frequency is controlled in Perhaps we should further enhance the calculation take into account the media duration, and have it automatically update more frequently for short duration videos. That's probably better than requiring the application developer to set it themselves. Would that make sense? |
Yes this is exactly what I meant. |
Thanks for confirming! We should probably do something like calculate what duration of elapsed time corresponds to 1dp of the screen, and incorporate that into the calculation. Doing this would also update the time bar more frequently on physically larger devices than on small ones, which also seems like a good idea. I've already marked this as an enhancement, so we can use it for tracking. |
@ojw28 might I know the issue is fixed? And that pretty good if you can share your plan on it. Currently, I am playing a 30seconds video and this looks not really good now. |
@ojw28 So we could specify the update length (thickness) in dp, let's say - update the time bar's progress always with 20dp, regardless of the duration. For example: With these, we could calculate how many times we need to update the time bar with To get how frequently we need to update, we just need to calculate If the duration is 10 sec, then with this logic the time bar would need to be updated in every 0.5 secs. It seems to me that in this way we could keep smooth visual updates on the time bar regardless of the duration. However the above calculated update times can't be used for other operations, like updating the Ok, so this was just an idea. I am curious if this concept could be used as a starting point or not. |
That sounds like a good approach. To prevent this issue with slow updates, you can probably just impose a maximum and a minimum update frequency (let's say 50ms < f < 500ms). Are you planning to submit a pull request for that? That would be great as we are not planning to do that soon. |
Yes, I plan to work on this and submit a pull request once I am done. |
When playing a video the DefaultTimerBar updates the current seek position at 1 second intervals.
Is there any setting to set it at a smaller time precision, so the seekbar updates more smoothly for short videos?
The text was updated successfully, but these errors were encountered: