-
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
How to listen video position #3980
Comments
You can query |
So, it is okay that to listen it with a handler. |
Yes, that's certainly possible. |
Why not provide onProgressChangedListener? handler is Very troublesome. |
The problem with a onProgressChangedListener is that the position changes about every 10 milliseconds. Sending such a huge amount of callbacks would use much more CPU time (and thus battery) than polling the progress infrequently. Most progress bars don't have a resolution which would allow you to show a 10ms difference either, thus it also wouldn't make sense for most purposes. Also, using a handler is not that troublesome:
|
public class ProgressTracker implements Runnable {
} I did like that. However output of the log is: Why there are duplicates how can I get rid of them |
I guess because either the position hasn't changed (for example while buffering) or you have multiple active ProgressTrackers. In general, please direct these more generic programming question to StackOverflow or similar sites. This issue tracker is primarily for answering ExoPlayer specific questions. |
thanks, sorry for inconvenience. |
Closing because question seems to be answered. Feel free to reopen if not. |
I'm using ExoPlayer 2.7.0 and I would like to listen player position in order to take actions. I couldn't find specific method for it. Could you please suggest me a proper solution?
Thanks
The text was updated successfully, but these errors were encountered: