Airplay Mirroring + External UIScreen = full-screen video viewing in UIWebView?

I am currently playing with some application ideas using AirPlay mirroring, and a second UIScreen (a la Real Racing) on ​​my Apple TV2 along with HTML5 video content (x-webkit-airplay = "deny") in UIWebView (allowInlineMediaPlayback = YES, mediaPlaybackAllowsAirPlay = NO) on my iPad in iOS 5.

Without Airplay, the content in the UIWebView displays embedded on the iPad (as expected). After mirroring on air, the content is always played in full screen mode on the Apple TV (hiding the external interface of the screen) and shows the image "play video on the Apple TV" in UIWebView on the main screen:

airplay indicator

Here is my HTML:

<html> <head> <title>HTML 5 Video</title> </head> <body> <video controls="controls" x-webkit-airplay="deny" width="280" height="200"> <source src="http://html5demos.com/assets/dizzy.mp4" type="video/mp4" /> <source src="http://html5demos.com/assets/dizzy.webm" type="video/webm" /> <source src="http://html5demos.com/assets/dizzy.ogv" type="video/ogv" /> </video> </body> </html> 

Here is the relevant snippet of project code:

 NSString *urlString = @"http://medialog.roamrlog.com/video.html"; NSURL *url = [NSURL URLWithString:urlString]; NSURLRequest *urlRequest = [[NSURLRequest alloc] initWithURL:url]; _webView = [[UIWebView alloc] initWithFrame:CGRectMake(50, 20, 280, 200)]; _webView.delegate = self; _webView.allowsInlineMediaPlayback = YES; _webView.mediaPlaybackAllowsAirPlay = NO; [_webView loadRequest:urlRequest]; 

It seems that all settings are ignored when mirroring is enabled:

airplay mirroring on

(audio and video are transmitted to ATV via AirPlay with mirroring, as expected not )

And partially confirms them (see below) when mirroring is turned off:

airplay mirroring off

(audio is transmitted to ATV via AirPlay without mirroring, as expected) video does not match )

I need UIWebView content to always play in line regardless of AirPlay Mirroring. Any ideas how I can get around this problem?

Thanks in advance!

+2
source share
1 answer

I do not know how to do this, and I also need something.

There is a UIWebView property that should disable AirPlay in UIWebView, but it does not seem to work, at least for me:

http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIWebView/mediaPlaybackAllowsAirPlay

I have a question about this, so you want to close this question and vote for me. If you try to use this property and get better results than me, I would love to hear about it!

My question is: Assigning mediaPlaybackAllowsAirPlay property to UIWebView

+2
source

All Articles