【发布时间】:2011-12-26 03:58:13
【问题描述】:
我正在尝试使用以下代码在我的 iphone 应用中观看视频:
-(void) viewDidLoad{
[super viewDidLoad];
UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.frame];
NSString *youTubeVideoHTML = @"<html><head>\
<body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
// Populate HTML with the URL and requested frame size
NSString *html = [NSString stringWithFormat:youTubeVideoHTML,@"http://www.youtube.com/watch?v=ZiIcqZoQQwg" , 100, 100];
// Load the html into the webview
[webView loadHTMLString:html baseURL:nil];
[self.view addSubview:webView];
}
谁能告诉我我做错了什么?我已经在几个例子中看到了这一点,但我仍然无法解决!
【问题讨论】:
标签: iphone ios video uiwebview youtube