How to play music using MPMusicPlayerController?

Can anyone suggest me how to play music using MPMusicPlayerController in my application.

Any help would be greatly appreciated.

Thanks, Monish.

+3
source share
1 answer

Create an MPMediaPickerController so you can select music from your iPod, then in the mediaPicker:didPickMediaItems: do the following:

 MPMusicPlayerController* playa; playa = [MPMusicPlayerController applicationMusicPlayer]; [playa setQueueWithItemCollection:mediaItemCollection]; [playa play]; 
+6
source

Source: https://habr.com/ru/post/908713/


All Articles