Changing MPMusicPlayerController's shuffle mode more than once breaks its queue (on iOS 8.4)

Originator:cljoseph
Number:rdar://21671141 Date Originated:July 3, 2015
Status:Open Resolved:
Product:iOS SDK Product Version:8.4
Classification:Serious Bug Reproducible:Always
 
Summary:
Sometimes changing MPMusicPlayerController's shuffleMode when setting its queue to be the same as its current queue will cause setNowPlayingItem to stop working. Once it gets into this state where setNowPlayingItem doesn't work if you try to change the shuffleMode it will just clear its queue (which can also be reproduced in Music.app).

Steps to Reproduce:
For a given array of MPMediaItems "items":

1) Run the following code:

[[MPMusicPlayerController systemMusicPlayer] setQueueWithItemCollection:[MPMediaItemCollection collectionWithItems:items]];

[[MPMusicPlayerController systemMusicPlayer] setShuffleMode:MPMusicShuffleModeDefault];

[[MPMusicPlayerController systemMusicPlayer] setNowPlayingItem:[items firstObject]];

[[MPMusicPlayerController systemMusicPlayer] play];

2) Now try this code:

[[MPMusicPlayerController systemMusicPlayer] setQueueWithItemCollection:[MPMediaItemCollection collectionWithItems:items]];

[[MPMusicPlayerController systemMusicPlayer] setShuffleMode:MPMusicShuffleModeSongs];

[[MPMusicPlayerController systemMusicPlayer] setNowPlayingItem:[items firstObject]];

[[MPMusicPlayerController systemMusicPlayer] play];

3) Now either try calling MPMusicPlayerController's setNowPlayingItem with any item, or try changing its shuffleMode. (For the latter you can do so from code or from the system Music app's player).

Expected Results:
The currently playing item changes (or the shuffle mode changes).

Actual Results:
Nothing happens (or the player is reset and closes).

Version:
iOS 8.4

Notes:


Configuration:
iPhone 6 128GB

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!