Reputation: 159
I have an app that plays several webvideos like Youtube and Vimeo in a UIWebView. When the video plays it is possible to send it to an Apple TV over AirPlay.
Currently, during playback over AirPlay the video stops when I pause the app and move it to the background.
My desired result is that the video will keep playing on the Apple TV.
After some research I found out that I have to set the Required background modes
in the Info.plist to App plays audio
. Unfortunately this did not work.
So what does need to be set to keep the video playing over AirPlay when the app is moved to the background.
Upvotes: 4
Views: 3873
Reputation: 1592
i've tested this on iOS6 with UIWebView loading video webpage, and it does the job. the audio session needed to be set as AVAudioSessionCategoryPlayback
in order to be played in background.
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
Upvotes: 6