バックグラウンドでiTunesの音楽を再生しています。次のコードを使用して「ビデオ」を再生するアプリを開始しました。
NSString* videoPath = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"m4v"];
if (player) {
[player release];
player = nil;
}
player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:videoPath]];
[self presentModalViewController:player animated:YES];
次のようにオーディオセッションを設定しています。
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive: YES error:nil];
ビデオの再生が始まると、バックグラウンドで再生されている iPod の音楽が停止します。ビデオの終了時にバックグラウンド ミュージックを再開するにはどうすればよいですか?