视频显示在iPad上。您可以点击以打开控件。全屏按钮显示在右下角,但点击它没有任何作用。它应该会让播放器进入全屏模式。有什么我可以添加到这个代码中使其工作吗?
NSString *htmlStr = [NSString stringWithFormat:@"<body style="margin:0;padding:0;" ><iframe class="youtube-player" type="text/html" width="420" height="226" src="http://www.youtube.com/embed/%@" frameborder="0" allowfullscreen></iframe>",video_ID];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:thumb.frame];
videoView.backgroundColor = [UIColor darkGrayColor];
videoView.scrollView.scrollEnabled = NO;
[videoView loadHTMLString:htmlStr baseURL:nil];
[videoCcontainer addSubview:videoView];
尝试使用embed,而不是iframe:http://mobiledevelopertips.com/video/display-youtube-videos-without-exiting-your-application.html
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>";