-
Notifications
You must be signed in to change notification settings - Fork 11
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
Shuffle completely breaks the playlist's indexies #3
Comments
Hi! As specified in the 'Caveats' section in the Readme, shuffle indices are currently not supported, and I couldn't work on supporting them for a lack of time, as media_kit itself doesn't support them either as far as I'm aware, so I'd need to manually change the queue (it only supports specifying whether the player has to shuffle or not). As a temporary solution, you could manually shuffle the queue in your application and set that as the player's queue. |
Thank you for your reply.
Hm... I'm sorry, but I can't find that section in the
I've been using
Not a problem, better to be late than never :D If you aren't planning to continue working on that package, then I may try something myself; can't promise anything tho :D |
You're right.. I forgot to publish it. 💀
Yeah, I wanted to implement something like that in the plugin, so that shuffleIndices would be supported, just like natively on Android.
I am trying to work on it (also because I use it myself in my app), albeit slowly because of the lack of time. Though you're welcome to make your forks and eventually help me with development by submitting a PR. |
Hi, we're also trying to use this package for our media player (Finamp), but it seems like the queue isn't properly working for some reason. When one song is finished, the player stops playback ( It seems like that bug is related to the discussion here, but I can also open a separate issue if you prefer :) |
Hi! The bug is not really related to this discussion, as this discussion is about the shuffle indexes not working (which is also stated in the README.md file). What you're talking about instead, is that the queue is completely broken, so yes, a new issue would be better. I'll start looking at the issue in the meantime, and also at the pull request you've opened. |
Coming back to this now that my other issues have been resolved, I'd prefer a solution that fully updates media-kit's playlist instead of only feeding the next track. I'm not sure if I'll have the time to play around with this myself, but I'd be happy to discuss this with you further! |
Hello! I've made my own version of Not sure if I should make a PR for this, but here we are: Zensonaton/just_audio_media_kit. Basic features like seek (previous/next) are working as intended, while queue modification methods have not been tested. just_audio_media_kit:
git:
url: https://github.com/Zensonaton/just_audio_media_kit.git
ref: main |
@Zensonaton I just tried your fork, but it doesn't seem to be working for some reason. Toggling shuffle mode doesn't change the order of the tracks, neither in the
which seems to originate from here: Is there anything I need to change about my code to make use of your implementation? Edit: I also noticed that I don't get any changed order when using the published version of just_audio_media_kit. In your original comment you mentioned that the order changes for you, is that still the case? |
@Chaphasilor, thank you for trying my fork.
Ouch. This is why I wasn't comfortable in creating a PR :D
Hmmm, I thought that this is how things were supposed to be working. just_audio returns
Yeah, both Pato05's and mine implementations of just_audio_media_kit doesn't have a
Yeah- and no. In the original just_audio_media_kit library, |
It's amazing @Zensonaton you've created a fork covering this! I have seen your commits, and really good job. Though your implementation as of right now would be incompatible with the prefetching I've introduced some commits ago. Maybe we could keep a cache of all the sources and then feed something like 4 at a time to the player, and whenever the shuffle order changes, we could just re-iterate over those few elements and add them to the underlying player. Something like this would allow the player to pre-fetch the next track, and there wouldn't be any issues regarding the player automatically going to the next track (instead of having it be fed). If you want, you could make a PR already, and mark it as a draft, so that I can also try suggesting changes. I just have to ask one thing before doing this: please merge the changes, since it's quite behind some commits. |
Also @Chaphasilor if you need shuffling in your player, instead of using If there are a lot of items in the queue, you can take a look at the |
Wait, I thought that the |
@Pato05 that's not really an option sadly. Not only would it mean re-implementing a lot of functionality (like our custom ShuffleOrder), but it would probably also break our playback history, and playback would be restarted when toggling shuffle. Not having shuffle for now is better imo. |
Hello! First of all, I wanted to say thank you for your package. Compared to
just_audio_windows
, your solution is much more stable.Unfortunately, the shuffle feature is broken here: Calling
setShuffleModeEnabled(true)
results in a weird indexes being returned from the player class:Not only
currentIndex
is broken, butnextIndex
(and probablypreviousIndex
as well). Because of that issue, my UI displays the wrong track after user tries to enable the shuffle.Second,
just_audio
'ssetShuffleModeEnabled
can be called before callingplayer.setAudioSource
, but media_kit doesn't allow that. Because of that, the playlist doesn't get shuffled.Comparing
just_audio_media_kit
with native (?) Android version ofjust_audio
, there aren't any issues with the shuffle: I can call thesetShuffleModeEnabled
before setting the playlist, and indecies are returning correctly.The text was updated successfully, but these errors were encountered: