I am having a super strange issue. I am using iOS13 MPMediaPickerController
to get some songs from the users apple music library in order to play it via the [MPMusicPlayerController applicationMusicPlayer]
.
Now with some non-downloaded songs from some playlists that I have added to my library the delegate function
- (void)mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection
returns for
mediaItemCollection.items.firstObject
an object of the type MPModelObjectMediaItem
which cannot be played by the player. (I can also not cast to that type because it's unknown. Also there is no documentation out there for this type. It seems to be a private class inside the mediaplayer framework.)
I am expecting the type MPConcreteMediaItem
which is incoming for all downloaded (and all other cloud items that are not in playlists)
The picker is configured like this
musicPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
musicPicker.showsCloudItems = true;
musicPicker.showsItemsWithProtectedAssets = true;
musicPicker.delegate = self;
musicPicker.allowsPickingMultipleItems = false;
Any tips whats going on there?