Create a view base application and add a webView on it and call this html string to get the video of the desired url of youtube you want........
you can use this part of 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, urlString];
UIWebView *videoWebView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:nil];
//here u can add this to your own calayer or on any view you want.....
[videoWebView release];
Thanks dude it's all running for me it works...
ReplyDeleteGreat! Really useful. Thanks
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehey i am facing problems in this line:
ReplyDeleteUIWebView *videoWebView = [[UIWebView alloc] initWithFrame:frame];
compiler says frame not a struct or union.
Please reply.I feel helpless.
Dude actually your frame variable is not initialized.You need to initialize as follows....
ReplyDeleteframe=CGRectMake(xcoord,ycoord,width,height);