Video decoding seems to interrupt audio apps and vice versa (I think it can even interrupt yourself). You can disable this behaviour by configuring "mix with others" on your audio session:
NSError *error;
if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&error]) {
// handle error
}
if (![[AVAudioSession sharedInstance] setActive:YES error:&error]) {
// handle error
}
I don't know why, but setting a simple AVAudioSessionCategoryAmbient
category with no options works too:
if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&error]) {
// handle error
}
I used to have complicated theories on why mix-with-others
was necessary and even obvious for this sort of use case, but I've forgotten them and would prefer a pointer to some documentation instead.
p.s. I'm pretty sure both the above solutions will disable remote control events for your app. hope that's ok. once again, would love some doco.