Hello all,
I have currently a music app where I set a track from the playlist to play and queue the next one. So 1 track gets played and we prepare the next one by inserting it in the queue. I'm using MPMusicPlayerControllerNowPlayingItemDidChange API to get notified when a track has changed (aka ended) so that I get to queue the next one. In this way we make sure that we always have the next track ready to play in the queue (also if the user decides to hit next in lock screen).
Now, hitting the "next" button on the lock screen will correctly go through the tracks which tells me the queue is working properly. BUT if I just let the tracks finish on their own then this logic isn't working correctly.
The problem I'm facing is that now when one of the songs ends the API returns nowPlayingItem one of the previous songs, thus repeating the previous track and breaking the implemented logic.
I'm facing this in iOS 15.5 and I know this used to work in the past. I'm not sure at what version it broke but I wanted to see if there's others that are expecting the same behavior and if somebody is looking into this issue.