Domanda

I use both, a MPMoviePlayerViewController and a MPMoviePlayerController to play back videos in my app. I also allow the use of AirPlay to stream these videos on to an Apple TV.

This all works fine. The only problem is, that the streamed video pauses, when the screen gets locked.

I noticed, that a lot of apps support this, but I don't know how to achive this feature.

I tried to set:

moviePlayerViewController.moviePlayer.useApplicationAudioSession = NO;

But that didn't work on either iOS 5 or iOS 6 so I tried using :

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];

But that didn't even compile.

Both ways are discussed here: http://stackoverflow.com/questions/12814574/how-to-support-airplay-in-the-background-in-ios6

What can I do? Or what do I do wrong?

Thanks a lot!

Andreas

È stato utile?

Soluzione

This answer and this one as well should help you, I've had the same problem in one of my apps and these helped. Let me know if it doesn't work.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top