ios - 后台应用程序/双击主页按钮时音频崩溃
<p><p>我有一个使用 AVPlayer 播放音频的应用。我通过将音频类别设置为 <code>AVAudioSessionCategoryPlayback</code> 启用了背景音频,并将所需的 <code>UIBackgroundModes</code> 设置添加到 info.plist 中的 <code>audio</code>。</p >
<p>在 iOS 5 上,当您按下主页按钮时,应用程序会进入后台,并且音频仍会播放一段时间,但是当我双击主页按钮时,整个设备会锁定 10 秒左右,并且最终会播放音频停止。 </p>
<p>但是,应用程序仍在运行,因为我可以启动它并查看应用程序的状态,就像原来一样。不幸的是,音频系统似乎很糟糕,因为任何后续操作通常都会导致崩溃。</p>
<p>当音频停止时,我在设备的控制台中看到以下内容:</p>
<pre><code>Jun 26 12:39:28 unknown SpringBoard <Warning>: Unable to deliver SBApplicationNotificationStateChanged notification to port com.apple.springboard.appstatechanged: (ipc/send) timed out
Jun 26 12:39:53 unknown mediaserverd <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate with reason 'fig rpc timeout -- FigSharedRemote_VolumeCategoryForAudioCategory'
Jun 26 12:39:53 unknown ReportCrash <Notice>: Saved crashreport to /Library/Logs/CrashReporter/mediaserverd-2012-06-26-123953.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Jun 26 12:39:53 unknown mediaserverd <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; stackshot generated
Jun 26 12:39:53 unknown mediaserverd <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process
Jun 26 12:39:53 unknown com.apple.launchd <Notice>: (com.apple.mediaserverd) Exited: Killed: 9
Jun 26 12:39:54 unknown com.apple.mediaserverd <Notice>: 2012-06-26 12:39:54.083477 PM HAL plugin started
Jun 26 12:39:54 unknown kernel <Debug>: launchd Builtin profile: mediaserverd (sandbox)
Jun 26 12:39:54 unknown mediaserverd <Error>: 12:39:54.317795 com.apple.AVConference: /SourceCache/GameKitServices/GameKitServices-344.21/AVConference.subproj/Sources/AVConferenceServer.m:1867: AVConferenceServerStart
</code></pre>
<p>这似乎只影响 iOS 5。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>通过共享多个 <code>AVPlayer</code> 实例,原来这是我的代码中的一个问题,这有时会导致音频系统崩溃。移除第二个玩家修复了这个错误。 <em>/叹息</em></p></p>
<p style="font-size: 20px;">关于ios - 后台应用程序/双击主页按钮时音频崩溃,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/11213887/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/11213887/
</a>
</p>
页:
[1]