I'm adding an external display capability to my iPad and am having some trouble with UIWebView based video controls.
Whenever a UIWebView based video is played, the external screen is automatically taken over to display the video fullscreen. Unfortunately, I have no way to close that video and return the external screen to its previous webview. The fullscreen video on the external screen only appears to be cleared once the webview content is completely unloaded.
When a UIWebVi开发者_开发技巧ew video is played and the fullscreen video controller is created, where does that controller exist? Is there a way to detect or otherwise manage it? How can I manually force dismissal of this controller?
See this post: How to receive NSNotifications from UIWebView embedded YouTube video playback
Otherwise, I have used this workaround with some level of success:
- Listen to the UIWindowDidBecomeKeyNotification
- Check the class of the window becoming key against MPTVOutWindow
Like:
-(void)windowDidBecomeKeyNotification:(NSNotification*)notification {
BOOL tvOut = [[notification description]
rangeOfString:@"MPTVOutWindow"].length > 0;
...
}
精彩评论