1

I send a secondary UI to AirPlay - on iOS 5.1.

On the iPad, the user may use a UIWebView to play a video, and if they have Airplay setup, the video will be sent to the AirPlay device. When the video finishes playing or if the user pauses, the UIWebView does not clear out the image from the AirPlay screen.

If I then load a different URL to the UIWebView, the AirPlay image will clear out, but only after a few seconds.

I've tried to work-around this by loading a blank page, and then reloading the original video page, but that does not seem to work. Any thoughts?

Rob Reuss
  • 1,400
  • 10
  • 20
  • My latest sub-optimal work-around is to hide my UIWebView, and then unhide it after a delay triggered in webViewDidFinishLoad. Works okay, but obviously adds a slight delay. – Rob Reuss Mar 19 '12 at 22:40

1 Answers1

0

In my effort to also clear other types of content from a UIWebView, I happened to discover that the following statement will also disconnect the AirPlay video connection immediately, and thereby revealing any underlying secondary UI sent via UIScreen.

[myWebView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML = \"\";"];
Rob Reuss
  • 1,400
  • 10
  • 20