Play youtube video in full screen ?

Posted by Madhup on Stack Overflow See other posts from Stack Overflow or by Madhup
Published on 2010-04-13T06:49:25Z Indexed on 2010/04/13 6:53 UTC
Read the original article Hit count: 282

Filed under:
|
|
|
|

Hi all,

First of all sorry, If somebody finds this question is repeated (haven't found any by myself).

I am developing for an iPad application and trying to play youtube videos using this code:

        NSString *embedHTML = @"\
        <html><head>\
        <style type=\"text/css\">\
        body {\
        background-color: transparent;\
        color: white;\
        }\
        </style>\
        </head><body style=\"margin:0\">\
        <embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
        width=\"%0.0f\" height=\"%0.0f\"></embed>\
        </body></html>";
        NSString *html = [NSString stringWithFormat:embedHTML, youTubeUrl, 142.0, 129.5];
        [wbView loadHTMLString:html baseURL:nil];

The code works fine when used in an iphone application (i.e. you touch on the webview and it starts playing the youtube video in fullscreen.) But when used in the iPad, on clicking the web view it starts playing the video in the web view itself and shows options to go to full screen, while I want to start the playback in the full screen from the beginning, like it does in the iPhone.

Anybody having some ideas or people who have done it before please help.

Thanks,

Madhup

© Stack Overflow or respective owner

Related posts about ipad

Related posts about ipad-sdk