To make the video always play in full screen mode, use the following line of code when setting up UIWebView :
webView.allowsInlineMediaPlayback = NO;
It seems that there are several ways to detect input and output from full screen mode , although it seems that this is not recommended. See the related StackOverflow question.
Depending on what you are trying to do, it seems that you are better off detecting a playerβs state change using the onStateChange . In the project I'm working on, the code is as follows:
function onStateChange(event) { window.location.href = 'ytplayer://onStateChange?data=' + event.data; }
Then I sniff this URL in a controller wrapper class or view:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if([request.URL.scheme isEqualToString:@"ytplayer"]) { NSString *action = request.URL.host;
Ikai lan
source share