How to support airplay in the background in iOS6

airplay, background, ios6, video

Solution

Found the solution: this problem can be solved by setting the right AVAudioSessionCategory

NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &setCategoryError];

Problem

My app should stream video's to an AppleTV via Airplay, even when the app is in the background. Under iOS5 it worked perfectly. In iOS6 it does not. Xcode gives me a deprecated warning on this line of code: ``` moviePlayerViewController.moviePlayer.useApplicationAudioSession = NO; ``` Is this the reason why my app isn't functioning correctly anymore. What is the equivalent of this piece of code in iOS6?

Original source