Search code examples
iphoneioscocoa-touchuiwebviewairplay

When playing a movie through a UIWebView, and then outputting to AppleTV via Airplay, turning off iPhone screen stops playback. Why?


When playing a movie through a UIWebView, and then outputting to AppleTV via Airplay, turning off iPhone screen stops playback. Why?

Anyone know how to solve this so AirPlay continues when the screen is off with my app?


Solution

  • Doing these two things solved it for me:

    1. Airplay of audio using AVPlayer does not work in the background (Put the key "audio" as the key in the XML of the property list)

    2. UIWebView: HTML5 audio pauses in iOS 6 when app enters background

    Looks like it works for video too!