-
Notifications
You must be signed in to change notification settings - Fork 52
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
playNextInQueue not working for more than 2 items? #96
Comments
Hey, so the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe I'm doing something wrong but this seems like a basic enough example:
then I have a button with the following action:
player.queue(urls: items) // player is AudioPlayer()
this plays file 1
I have another button that calls the following:
player.playNextInQueue()
this jumps to file 2
then I call (again)
player.playNextInQueue()
but this does nothing and file 2 continues playing
has this function not been tested/used much or am I using it wrong?
update 1:
so if I just queue the songs and let them play, they play correctly. if I queue the songs and skip to file 2, and let file 2 finish, it does NOT go on to file 3. so regardless of that second playNextInQueue call above, the issue happens when I call It the first time
update 2:
it seems that playNextInQueue calls this:
playerContext.setInternalState(to: .pendingNext)
which will make its way to calling processSource at some point, and in processSource it has this:
specifically, shouldClearQueue is set to true, so the queue is being emptied. changing it from true to false makes it work, but im not sure if this breaks any other functionality, so id prefer to wait to see what anyone has to say
update 3:
it seems the only other time the internal state is set to pendingNext is in the
play(audioEntry: AudioEntry)
function (someone double check me), which already clears the queue as shown below:so it SEEMS that changing shouldClearQueue in the above update to false wouldn't break it since it already clears the queue (in fact it seems that in its current form the queue is being cleared twice - once in play() and the other in processSource)? however im not sure how this may impact functionality that may be added in the future, so again I will wait to hear back if its a simple boolean value change
The text was updated successfully, but these errors were encountered: