2011-10-05 90 views
0

有没有人知道这个控制台的输出是什么意思?来自MP的奇怪错误_playbackInterruptionDidEndNotification

我对雪豹

使用上的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"; 

如果任何人都可以阐明它的含义或如何摆脱它?

由于事先

回答

0

我使用多任务手势(4手指滑动)以在全屏开放MPMoviePlayerViewController的实例时得到了同样的错误。这导致应用程序崩溃,最终导致iPad无法旋转并终止iPad。

看起来这是由于没有正确设置.plist文件造成的。

  1. 打开您的.plist文件并找到“必需的背景模式”键(如果您显示的是原始键值,则称为“UIBackgroundModes”)。
  2. 打开“所需背景模式”的下拉菜单并点击进入“Item 0”(或在其中添加新行)
  3. 在“Value”列中,输入“App plays audio”(您可以在下拉菜单,如果你通过添加行单击箭头加号

一旦你这样做,你应该不会再收到错误。

//编辑 只要应用程序并不需要当你在你的应用程序或其他应用程序中的其他地方播放视频和音频时,你可能不想保持视频流和吃这些资源。 d检查.plist中的“应用程序不在后台运行”框。

至于回放,有很多人认为可能会在回放过程中发生,可能会导致应用程序和设备崩溃。

- (void) moviePlayerPlaybackStateDidChange: (NSNotification *) notification { 
if (movplayer.playbackState == MPMoviePlaybackStateStopped) { 
    [movplayer setContentURL:[movplayer contentURL]]; 
    [movplayer play]; 
} 
} 

然后在调用你的MPMoviePlayerController的方法添加此观察者:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil]; 

这将赶上变化,像视频播放器整理,或打开你的MPMoviePlayerController的方法之前加入这种方法快速转发到视频末尾,如果iOS不喜欢某些内容,则将视频重置为开始。管理玩家发生的这类错误/崩溃是很有帮助的。

+0

感谢您的信息...我会给它一个看看它是如何摆出来的。 – skeo

+0

仍然显示在控制台中的错误, – skeo

+0

我检查了我的.plist文件并没有找到所需的背景模式在那里..所以我添加了一个,并希望它能工作,不幸的是它仍然存在 – skeo