Using MPMusicPlayerController to play stuff from MusicKit?

Is it possible to use data retrieved from new MusicKit for Swift to provide the queue for MPMusicPlayerController from MediaPlayer framework?

Okay, I can map items id and provide it to setQueue(with storeIDs: [String])

Hello Adam,

Indeed, you can use MPMusicPlayerController's setQueue(with storeIDs: [String]).

However, MusicKit for Swift's ApplicationMusicPlayer and SystemMusicPlayer can be used to directly play any music item type that conforms to the PlayableMusicItem protocol. And since this mechanism is built on top of PlayParameters, it is expected to be more widely supported and more reliable.

This playback API in MusicKit for Swift is still young. But I would suggest you check it out, and if it's lacking a specific feature you need, please let us know so we can take that into consideration for possible inclusion in future updates to the API.

I hope this helps.

Best regards,

Thank you for the response. 😃

Yes, the ApplicationMusicPlayer/ObservableMusicPlayer lacks some stuff that I'd like to observe/get/set:
– observe when the track changes (FB9148193),
– set and observe the volume; if it has to be a dedicated view – maybe something more modern and configurable instead of MPVolumeView because it looks like it's forgotten (FB9155448),
– getter for the queue – I can set the queue, but I can't observe the state of the player (what I mean by that is the user observable state, like which track is now playing etc) so I can't even rely on my copy (FB9155477)

Hello Adam,

Thank you so much for the detailed feedback, this is very helpful to us. We'll keep track of those specific feedback item tickets. We'll investigate this further as soon as possible.

Best regards,

Using MPMusicPlayerController to play stuff from MusicKit?
 
 
Q