开发者

Play youtube videos-ipad

In my application i want to play the Youtube URL(ipad).I'm using the below code.It simply show me a White screen

Youtube url is:http://www.youtube.com/watch?v=x61GMbKwMkE

This is my code:

NSString *embed = @"\
<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=320 height=460></embed>\
</body></html>";
NSString *embedURL=[NSString stringWithFormat:embed,appDelegate.videoURL];  
NSLog(@"\n\n\n\n Myurl==%@   %开发者_Python百科@\n\n\n",embedURL,appDelegate.videoURL);
[[WebView.subviews objectAtIndex:0] setScrollEnabled:NO];
[WebView loadHTMLString:embedURL baseURL:nil];

I'm creating and connecting UIWebView in XIB.

Anyone Guide me to do this

Thanks For your consideration and effort


Flash is not supported in iOS. Check out the new embed code for YouTube videos that will automatically choose the correct player for each environment.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜