How do I play music using MPMusicPlayerController?

痴心易碎 提交于 2020-01-02 08:20:08

问题


Can any one suggest me how to play the music using MPMusicPlayerController in my application.

Anyone's help will be very much appreciated.

Thank you, Monish.


回答1:


Create a MPMediaPickerController so you can choose some music from the iPod, then in the mediaPicker:didPickMediaItems: call back you do this:

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


来源:https://stackoverflow.com/questions/2288747/how-do-i-play-music-using-mpmusicplayercontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!