Objective c MP_PlaybackInterruptOnDidendNotification出现奇怪错误

Objective c MP_PlaybackInterruptOnDidendNotification出现奇怪错误,objective-c,Objective C,有人知道这个控制台输出意味着什么吗 我在雪豹的xcode 4.0.2上使用4.3.3 SDK 经常在录制视频或播放时 我在控制台上收到了这个消息 MP _playbackInterruptionDidEndNotification :: NSConcreteNotification 0x6402a80 {name = AVController_PlaybackInterruptionDidEndNotification; object = <AVController: 0x64a35f0&

有人知道这个控制台输出意味着什么吗

我在雪豹的xcode 4.0.2上使用4.3.3 SDK

经常在录制视频或播放时

我在控制台上收到了这个消息

MP _playbackInterruptionDidEndNotification :: NSConcreteNotification 0x6402a80 {name = AVController_PlaybackInterruptionDidEndNotification; object = <AVController: 0x64a35f0>; userInfo = {
"AVController_InterruptionStatusNotificationParameter" = "non-resumable.SoloAmbientSound";
"AVController_InterruptorNameNotificationParameter" = "AudioSession-2113";
如果有人能解释它的含义或如何摆脱它


提前感谢

在全屏打开MPMoviePlayerViewController实例的情况下使用多任务手势4个手指滑动时,我遇到了相同的错误。这导致应用程序严重崩溃,导致iPad无法旋转,最终导致iPad死亡

造成这种情况的主要原因似乎是没有正确设置.plist文件

打开您的.plist文件并找到键所需的背景模式如果您显示的是原始键值,则称为UIBackgroundModes。 打开所需背景模式的下拉列表,然后单击项目0或在其中添加新行 在“值”列中,输入App plays audio。如果单击“添加行加号”旁边的箭头,您可以在下拉菜单中看到它 一旦你这样做了,你就不应该再收到那个错误了

//编辑 只要你在应用程序或其他应用程序的其他地方时,应用程序不需要播放视频和音频,你可能就不想继续播放视频流并吃掉这些资源。因此,添加并检查应用程序是否未在.plist的后台框中运行

至于播放,在播放过程中可能会发生很多事情,导致应用程序和设备崩溃。在打开MPMoviePlayerController的方法之前添加此方法:

- (void) moviePlayerPlaybackStateDidChange: (NSNotification *) notification {
if (movplayer.playbackState == MPMoviePlaybackStateStopped) {
    [movplayer setContentURL:[movplayer contentURL]];
    [movplayer play];
}
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil];
然后将此观察者添加到调用MPMoviePlayerController的方法中:

- (void) moviePlayerPlaybackStateDidChange: (NSNotification *) notification {
if (movplayer.playbackState == MPMoviePlaybackStateStopped) {
    [movplayer setContentURL:[movplayer contentURL]];
    [movplayer play];
}
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil];

这将捕获一个更改,如视频播放器正在完成,或快速转发到视频的结尾,如果iOS不喜欢某个内容,则将视频重置为开头。管理播放器发生的此类错误/崩溃很有帮助。

我检查了我的.plist文件,但没有在其中找到所需的背景模式。因此我添加了一个,希望它能工作,不幸的是,它仍然存在。您也可以尝试将应用程序不在后台运行添加到。plist并检查框。您可以解释导致您在控制台中出现此错误的几个操作吗?我的应用程序可以录制视频并播放视频。我通常在视频播放完毕并将应用程序发送到后出现此错误出身背景例如:我按了“主页”按钮。所以应用程序在后台,但视频已经播放完毕。当应用程序进入前台时……有时会显示错误消息……问题是,它并不是每次都这样做,所以我无法真正跟踪编辑到我的原始答案……这些解决方案中的一个或两个应该对您的原因有所帮助。