如何在 a 中获取 YouTube 视频UITableViewCell
,以及如何处理播放视频的-Done
按钮UIWebView
?
我已将视频嵌入到视图中,但就像在图像上一样。我想要这张Done
图片中的这个按钮:
我想在返回视图时打开另一个屏幕,而不是前一个视图。
-(void)viewDidLoad {
[super viewDidLoad];
videoURL = [[NSString alloc]init];
videoURL =@"http://www.youtube.com/watch?v=aE2b75FFZPI";
[self embedYouTube:videoURL frame:CGRectMake(10, 85, 300, 180)];
}
- (void)embedYouTube:(NSString*)url frame:(CGRect)frame {
NSString* embedHTML = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: red;\ }\ </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, url, frame.size.width, frame.size.height];
if (videoView == nil) {
videoView = [[UIWebView alloc] initWithFrame:frame];
[self.view addSubview:videoView];
NSLog(@"html%@",html);
}
[videoView loadHTMLString:html baseURL:nil];
}
我需要一些帮助。我进行了搜索,但没有得到任何东西。