views:

36

answers:

1

Is there any way to know when the Youtube player/plugin on iPad goes fullscreen?

I have a UIWebview being displayed inside a Modal view controller that contains a Youtube video. If the user choose to view the Youtube video in fullscreen mode, it's displayed in fullscreen (naturally), but behind the UIWebview's modal view.

I'd like to know if some Notification or Delegate message is sent when the video starts to play in fullscreen mode, so that I would be able dismiss my modal view controller (or bring the Youtube fullscreen video to front in some way).

Thanks in advance.

+1  A: 

Hello

I think the best way is to :
1°) Know it by JS (because it's inside the UIWebView), like adding a click() event on the youtube object.
2°) Do an JS action and caught it with the UIWebViewDelegate

Maybe there is a better solution.

Good Luck !

Vinzius
Thanks for the answer Vinzius. I'll try your approach. I really don't know a thing about Javascript specifics. Could you indicate me some starting point guide to achieve what you proposed? Thanks
Eduardo Coelho
You should take a look at http://www.jqtouch.com/ event on the youtube object. Then to send a signal to the webview Delegate by trying to access a page (with - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType)
Vinzius