开发者

Intercept control of UIWebView video on external screen

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:

  1. Listen to the UIWindowDidBecomeKeyNotification
  2. Check the class of the window becoming key against MPTVOutWindow

Like:

-(void)windowDidBecomeKeyNotification:(NSNotification*)notification {
    BOOL tvOut = [[notification description]
    rangeOfString:@"MPTVOutWindow"].length > 0;
    ...
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜