Music app skips second track of a playlist in iOS16 & 16.1

I've had several users report weird track progression in my app. There was no code changed in my app, but around the time of iOS16 or iOS16.1 users started reporting unexpected results from track progression when my app loads a playlist to MPMusicPlayer and lets the music player have control of track progression.

A little more sleuthing has led me to see that often (though not always) when a playlist is loaded by creating an MPMediaItemCollection with saved mediaItems and using setQueueWithItemCollection to load to the music player, the first track plays as exected, but when the track end is reached and the music player should progress to the second track, instead it progresses to the third track. No stutter, no error and the logic of my app just follows the playing track, so my users have a bad experience.

Is anyone else having this problem? If so, any ideas how to solve?

Replies

BTW - if MPMusicPlayer is loaded with an array of Apple Music track StoreIDs with setQueueWithStoreIDs, play seems to progress as expected. Since I have several users with oldish iTunes libraries, I can't use setQueueWithStoreIDs.