NSURL *youTubeURL = [NSURL URLWithString:@"http://www.youtube.com/watch?v=HPwyVw_6vsQ&feature=youtu.be"]; // URL is a string which needs to be placed in @"" and close method call with ].
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:youTubeURL];
imageSel = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];

我正在使用此代码从视频获取缩略图,并且在
imagesel。有人可以帮助我解决此问题吗?我使用的是YouTube URL。当我对主 bundle 包中的视频使用此代码时,它可以正常工作。

最佳答案

做这个:

首先从Video URL Link中提取videoID。

现在,请引用this链接以获取视频缩略图。

10-07 19:05
查看更多