MPMusicPlayerController setQueueWithItemCollection not working?

My app uses MPMusicPlayerController's setQueueWithItemCollection to define music to play. However, in the ios 10.3 public beta 1, this function doesn't appear to set the queue at all; it just returns without changing the queue. Then, when I start the player, it just starts playing random music from the library.


I'm calling the function from the main thread, and I've included the NSAppleMusicUsageDescription key in my plist file (as I've had to do since 10.0).


Using xcode, I was able to verify that I was creating the MPMediaItemCollection with an array of the right MPMediaItems (I called their valueForProperty: @"title" method). When I update the nowPlayingItem property in the systemMusicPlayer, and then read it back, it always reads back as 0.


Has anyone seen this problem?

Did you find a solution for that? Have a similar problem in iOS 15. Setting up the queue with an array of MPMediaItems and play() them. Sometime (do not when exactly :-?) the queue seems to be randomized. The order is broken.

MPMusicPlayerController setQueueWithItemCollection not working?
 
 
Q