4
我有MPMoviePlayerController,應該在後臺播放視頻音頻,並應該由多任務播放/暫停控件控制。iOS MPMoviePlayerController在後臺播放音頻
更新的.plist文件,Required background modes
並調用後,以下:
- (void)startBackgroundStreaming
{
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
NSError *activationError = nil;
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayback error:&activationError];
[audioSession setActive:YES error:&activationError];
}
的應用程序圖標顯示在多任務播放/暫停吧,但這些按鈕沒反應。
謝謝!
可以從View Controller調用 - (void)remoteControlReceivedWithEvent:(UIEvent *)事件,而不是AppDelegate – khunshan 2014-08-06 11:43:24