【问题标题】:MPMoviePlayerViewController observes '_serverConnectionDiedNotification'MPMoviePlayerViewController 观察到“_serverConnectionDiedNotification”
【发布时间】:2012-05-27 10:19:28
【问题描述】:

在使用 MPMoviePlayerViewController 时,我收到如下错误通知并且应用程序崩溃。

_serverConnectionDiedNotification。 Info -- notification=Error Domain=AVFoundationErrorDomain Code=-11819 "Cannot Complete Action" UserInfo=0x5dfcb0 {NSLocalizedRecoverySuggestion=稍后再试。, NSLocalizedDescription=Cannot Complete Action}, AVPlayer = , currentTime = 0.00

2012-05-27 15:32:41.777 AnswerMania[3885:707] * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“一个 AVPlayerItem 不能与多个实例关联的AVPlayer'

这并不总是发生。我已经观察到所有 MpMoviePlayerController 通知,但无法观察到此错误。它与服务器连接有关吗? serverConnectionDiedNotification 如何观察到?

【问题讨论】:

  • Plus 1. 我也面临这个问题,我不知道为什么会发生这种情况或如何解决

标签: ios avplayer


【解决方案1】:

在播放视频时出现日历提醒时,我遇到了类似的问题。通过不使用应用程序音频会话为我解决了这个问题:

moviePlayer.useApplicationAudioSession = NO;

编辑: 它与以下错误有关,没有看到 _serverConnectionDiedNotification:

AVPlayerItem cannot be associated with more than one instance of AVPlayer

【讨论】:

  • 该属性自 iOS6 以来已被弃用。你应该改用[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error]
  • Nimrod,这不是理想的解决方案,因为在 ios6 中不推荐使用 useApplicationAudioSession。我有同样的问题。尚未修复:( :(
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-13
相关资源
最近更新 更多