-
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
Reset currentWindowIndex when changing MediaSource position #4791
Comments
Implementing your own shuffle order should ideally happen by providing your own After we added this method, you should be able to do something like
whenever a user turns on the shuffle mode in your UI. Independent of that, you can of course move around the media sources yourself to implement shuffling. Note that this doesn't keep the original order to easily toggle between shuffle mode on and off. And it also doesn't support inserting / deleting element elements from both the original and shuffled order natively. And finally, you will get When calling
|
This allows to update the shuffle order after the ConcatenatingMediaSource has been created. ShuffleOrder objects should be immutable to ensure thread safety and thus there is no way to do this currently. Issue:#4791 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=212443146
I'm working on my own shuffle implementation for a music player app. When the user press shuffle, I need to put the currently playing track at the top of the queue (first position). I could not find any solution for this using the ExoPlayer shuffle mode, so I decided to create my own solution by moving the MediaSource objects on the playlist.
Right now I'm saving a reference of ConcatenatingMediaSource as an attribute and using moveMediaSource to change the positions. I'm not calling prepare or seek before changing the positions.
Let's say that the currently playing index is 4. Then the user hits shuffle and I move the playing item to position 0 by using moveMediaSource. If the user hits next, I would expect the next index to be 1, because I moved the playing item to position 0. But what I'm seeing is that the next index is being reported as 5. Sometimes even another random index.
How I'm suppose to achieve this behavior? There is a way to reset the currently playing index (getCurrentWindowIndex())? Or should I implement this in a different way?
The text was updated successfully, but these errors were encountered: