多任务的MPMoviePlayerController问题 [英] MPMoviePlayerController multitasking problem

查看:154
本文介绍了多任务的MPMoviePlayerController问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发iPhone上使用的MPMoviePlayerController播放音频文件的应用程序。
当应用程序被切换到后台,如果mpmovieplayer是打,iphone继续发挥目前的音乐,但是当它结束时,下轨不启动。

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.

我尝试启动在MPMoviePlayerPlaybackDidFinishNotification下一个音频文件,当我使用调试器按照code,我可以看到,该方法被调用,code执行,蝙蝠下一个音频文件仍然没有按' ŧ开始。

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.

这是可能在iOS 4.1或这是一个限制?

Is this possible on iOS 4.1 or this is a limitation?

最好的问候
萨曼莎

Best regards Samantha

推荐答案

我把它通过将以下两行代表文件的工作:

I got it working by putting following two lines in Delegate file:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive: YES error: nil];

这篇关于多任务的MPMoviePlayerController问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆