views:

282

answers:

1

Right now now I'm thinking about getting a playlist through MPMediaQuery and then add the items inside my MPMediaPlaylist to the MPMusicPlayerController using setQueueWithItemCollection. Is there a way to pass the MPMediaPlaylist directly to the player?

+1  A: 

Can you show your code, or explain a little further?

It should be possible to configure the player either by passing the playlist directly to -[MPMusicPlayerController setQueueWithItemCollection:] (MPMediaPlaylist is a subclass of MPMediaItemCollection), or, if you're creating your playlist from a media query, to use -[MPMusicPlayerController setQueueWithQuery:]. Is that not direct enough?

Sixten Otto
So I guess `setQueueWithItemCollection` is the one to use (missed the subclass thing in the docs). I guess setQueueWithQuery would be more complicated to use (and pointless) as I would need to build a MPMediaQuery to retrieve the songs from a given playlist. Thanks for the confirmation.
ruibm