我想拍摄并显示正在播放的视频图片我认为它们被称为缩略图并且每分钟都在变化,我使用youtube iframe api显示视频,现在我想拍摄当前播放的视频并显示图片和每分钟都在改变,我该怎么做? youtube data api?
答案 0 :(得分:0)
为此,有两种方法
YTPlayerView *thumbnailView=[[YTPlayerView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[mainPlayerView loadWithVideoId:Enter Video Id];
[self.view addSubView thumbnailView]
UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
NSString *strURl=@"YouTube Video Id Here";
NSString *strMain=[NSString stringWithFormat:@"http://img.youtube.com/vi/%@/mqdefault.jpg", strURl];
//sd_setImageWithURL
// if not using sd_setImageWithURL then load image from data
[imageView sd_setImageWithURL:[NSURL URLWithString:strMain]];
[self.view addSubview:imageView];