MPMoviePlayerController 多任务问题
我在 iPhone 上开发一个应用程序,使用 MPMoviePlayerController 来播放音频文件。 当应用程序进入后台时,如果 mpmovieplayer 正在播放,iPhone 会继续播放当前音乐,但当播放结束时,下一首曲目不会开始。
我尝试在 MPMoviePlayerPlaybackDidFinishNotification 中启动下一个音频文件,当我使用调试器跟踪代码时,我可以看到该方法被调用并且代码被执行,但下一个音频文件仍然没有启动。
这在 iOS 4.1 上可行还是有限制?
此致 萨曼莎
I develop an application on iphone that uses MPMoviePlayerController to play audio file.
When Application goes to background, if mpmovieplayer is playing, iphone continues to play the current music, but when it ends, the next track doesn't start.
I try to start the next audio file in the MPMoviePlayerPlaybackDidFinishNotification and when I follow the code using the debugger I can see that the method is invoked and the code executed, bat the next audio file still doesn't start.
Is this possible on iOS 4.1 or this is a limitation?
Best regards
Samantha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我通过在委托文件中添加以下两行来使其工作:
I got it working by putting following two lines in Delegate file:
可能是你忘记添加这个
may be you forget to add this in
您应该阅读技术问答QA1668:
如何使用 MPMoviePlayerController 在后台播放音频。
所需步骤摘要:
You should read the Technical Q&A QA1668:
How to play audio in the background with MPMoviePlayerController.
Summary of the steps needed: