How To Switch music from my app to the ipod

本秂侑毒 提交于 2019-12-02 06:04:07

There are a few things involved.

You have to choose between two music players, the application music player and the iPod music player:

+ (MPMusicPlayerController *)applicationMusicPlayer;
+ (MPMusicPlayerController *)iPodMusicPlayer;

If you choose the iPodMusicPlayer, music will continue to play in the background and the user can stop it using the iPod (or Music) app.

If you choose the applicationMusicPlayer, by default the music will stop when you get sent to the background. If you want to continue playing, you'll have to set UIBackgroundMode in your Info.plist file to tell the system you should continue to run.

See: App States and Multitasking and Info.plist keys

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