如何将音乐从我的应用程序切换到 iPod
我在我的应用程序中使用 MusicPlayerController
对象来播放音乐。 我知道当 iPhone ipod 应用程序终止时,可以继续播放我的应用程序音乐。
我该怎么做?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这涉及到一些事情。
您必须在两个音乐播放器(应用程序音乐播放器和 iPod 音乐播放器)之间进行选择:
如果您选择 iPodMusicPlayer,音乐将继续在后台播放,用户可以使用 iPod(或音乐)应用程序停止播放。
如果您选择应用程序MusicPlayer,默认情况下音乐将在您发送到后台时停止。如果你想继续玩,你必须在 Info.plist 文件中设置 UIBackgroundMode 来告诉系统你应该继续运行。
请参阅:应用状态和多任务处理和 Info.plist 键
There are a few things involved.
You have to choose between two music players, the application music player and the iPod music player:
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