Question

Having some quirky issues with Airplay. I am playing a video using MPMoviePlayerController with Airplay on (not mirroring). I want to pause the video and play a video commercial using AVPlayerLayer (AVPlayer). The AVPlayer successfully uses Airplay to play the commercial (not sure why, but that's good I guess). However, after the commercial the MPMoviePlayerController wants to start at zero again (on some devices and not others) so the timing get's all messed up. Sometimes it will jump back to the paused time.

I suspect that Airplay is like a singleton that only allows one stream to be active at anytime. Sort of the way MPMoviePlayerController can only show one embedded video at a time.

I ended up branching and testing with two MPMoviePlayerControllers and got the same results, except setting the currentplaybacktime (and initialplaybacktime for good measure) and that didn't work. It just started the video over at zero. I'm tempted to put a delay on the currentplaybacktime setting, but that seems hacky. I could use the same MPMPC, but I would prefer not to kill the buffer while switching between urls.

Everything works fine on the ipad. I'm using http streaming for the MPMoviePlayerController but the commercials are raw mp4's over the web. I suspect that could be a problem too. This is with 5.1 ipad with Apple TV.

Where are my AV gurus? (invalidname are you out there?) :) What's going on with Airplay? I don't see much documentation for it.

Was it helpful?

Solution

The solution was to completely destroy the first movie stream before starting the next. Pausing one stream, playing another stream, then going back to the paused stream is simply a no-go. I even made sure the stream was completely stopped by listening for the state notifications before starting the next stream. That seemed to have fixed the issue.

OTHER TIPS

AVQueue can't support this ?

I think the new feature of iOS 7/8 SHOULD support multiple streams AV decoding or downlaoding.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top