youtube视频嵌入iphone应用程序,但给了我一个白色的空盒子

youtube视频嵌入iphone应用程序,但给了我一个白色的空盒子,iphone,objective-c,ios,youtube,Iphone,Objective C,Ios,Youtube,我正在尝试在我的应用程序中嵌入youtube视频,我正在使用此功能 - (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame { NSString *embedHTML = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: white;\ }\ </sty

我正在尝试在我的应用程序中嵌入youtube视频,我正在使用此功能

- (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame {
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, frame.size.width, frame.size.height];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:nil];
[self.view addSubview:videoView]; }
但当我运行应用程序时,它会给我一个白色的空盒子


这里是我的问题:如何确保嵌入工作可能?

如果创建html页面并将其加载到safari中,它是否工作?不,怎么做?在web服务器上创建一个包含相同代码的网页并在safari中打开它。你也可以在本地用模拟器来做这件事,很可能是《谢谢你》,我在我的iphone上试过了,很可能可以用了。。
[self embedYouTube:@"http://www.youtube.com/watch?v=5ABkqmqiYEI" frame:CGRectMake(30, 200, 260, 200)];