问题
i am using MusicPlayerController
object in my app to play music.
i know that its possible to keep playing my app music when it's terminate on the iphone ipod app.
how can i do it?
回答1:
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
来源:https://stackoverflow.com/questions/7993236/how-to-switch-music-from-my-app-to-the-ipod