我有一个使用AVPlayer播放音频的应用程序。我已经通过将音频类别设置为AVAudioSessionCategoryPlayback
并在info.plist中将所需的UIBackgroundModes
设置添加到audio
来启用了背景音频。当背景应用程序/双击主页按钮时,音频崩溃
在iOS 5上,当您按下home按钮时,应用程序会在后台运行,音频仍会播放一段时间,但是当我双击home按钮时,整个设备锁定大约10秒钟,音频最终停止。
但是,该应用程序仍在运行,因为我可以启动它并看到应用程序的状态。不幸的是,音频系统看起来很麻烦,因为任何后续的操作通常会导致崩溃。
当音频停止,我看到在设备的控制台以下:
Jun 26 12:39:28 unknown SpringBoard[15] <Warning>: Unable to deliver SBApplicationNotificationStateChanged notification to port com.apple.springboard.appstatechanged: (ipc/send) timed out
Jun 26 12:39:53 unknown mediaserverd[25406] <Error>: <<<<FIGSERVER>>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate [25406] with reason 'fig rpc timeout -- FigSharedRemote_VolumeCategoryForAudioCategory'
Jun 26 12:39:53 unknown ReportCrash[25468] <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[25406] <Error>: <<<<FIGSERVER>>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; stackshot generated
Jun 26 12:39:53 unknown mediaserverd[25406] <Error>: <<<<FIGSERVER>>>> FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process [25406]
Jun 26 12:39:53 unknown com.apple.launchd[1] <Notice>: (com.apple.mediaserverd) Exited: Killed: 9
Jun 26 12:39:54 unknown com.apple.mediaserverd[25469] <Notice>: 2012-06-26 12:39:54.083477 PM [AirTunes] HAL plugin started
Jun 26 12:39:54 unknown kernel[0] <Debug>: launchd[25469] Builtin profile: mediaserverd (sandbox)
Jun 26 12:39:54 unknown mediaserverd[25469] <Error>: 12:39:54.317795 com.apple.AVConference: /SourceCache/GameKitServices/GameKitServices-344.21/AVConference.subproj/Sources/AVConferenceServer.m:1867: AVConferenceServerStart
这似乎是通过分享超过只影响的iOS 5