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.can中返回null值我有人使用YouTube URL解决此问题。当我使用此代码的视频是在主要捆绑,那么它工作正常。如何从YouTube网址获取缩略图?
你知道MPMoviePlayer无法播放YouTube视频,对? –
@ RichardJ.RossIII MPMoviePlayer在我的代码中播放视频我已经从此链接完成https://github.com/comonitos/youtube_video/downloads,它工作正常 –