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.

Answer: 
You should use string formatting, either old or new-style.

Old style:

```
text1 = open('%s.txt' % (name,), 'wt')

```

New style:

```
text1 = open('{}.txt'.format(name), 'wt')

```
Make sure to use raw\_input to get a string as well.