-
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
Determine whether seeking or repeating #3252
Comments
Conversation started on Medium: https://medium.com/@andreworobator/whats-the-best-way-to-be-notified-of-when-a-repeating-track-ends-so-i-can-count-how-many-time-a-e01f7a0024a with @tonihei |
We thought about different ways of providing a clear way to notify the listener of what caused a position discontinuity. Our preferred method is to add a parameter to the |
Having a parameter in |
I think you can easily check if it is repeating the same item by comparing the period or window index to the previous one. Alternatively, you can also check the current repeat mode ( It wouldn't make much sense to add it here given how easy it is to get this information from the player. Besides, it would add unnecessary complications to the interface as there might be more parameters influencing the automatically selected next period (e.g. the shuffle mode, changes to a dynamic playlist, etc.). That said - we will add the described parameter to the onPositionDiscontinuity callback. Should be available in one of our upcoming releases (or the dev-branch). |
This allows listeners to easily determine the source of the discontinuity. Reasons can be period transitions, seeks, and internal reasons. Listeners still using the deprecated ExoPlayer.EventListener interface were updated to Player.EventListener. GitHub: #3252 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168549612
is this planned for 2.5.4? |
It will land in 2.6.0. We don't have an ETA. |
Does Exoplayer have any plans to distinguish between seeking to the beginning of a period and repeating once? Using the repeat modes and a
DynamicConcatenatingMediaSource
, if I check thatplayer.getCurrentPosition() == 0
inonPositionDiscontinuity()
, I'm not able to tell whether the song has just repeated or the user has seeked to the beginning of the song. Some sort of callback in Player.EventListener would be great.The text was updated successfully, but these errors were encountered: