5

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?

murze
  • 4,015
  • 8
  • 43
  • 70

2 Answers2

10

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

NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &setCategoryError];
murze
  • 4,015
  • 8
  • 43
  • 70
1

Besides @murze's solution you should also set value App plays audio for Required background modes key in infoPlist file like @ACBurk suggested: https://stackoverflow.com/a/8807958/384864

Community
  • 1
  • 1
Borut Tomazin
  • 8,041
  • 11
  • 78
  • 91