2

我想movie.Stop()从我的代码中删除这些行。

我可以使用什么其他方法从电影中获取缩略图?

NSUrl data = new NSUrl(info.ObjectForKey(new NSString("UIImagePickerControllerMediaURL")).ToString());

//get the video thumbnail
MPMoviePlayerController movie = new MPMoviePlayerController(data);
movie.Stop();
UIImage videoThumbnail = movie.ThumbnailImageAt(0.0, MPMovieTimeOption.NearestKeyFrame);
movie.Stop();
4

1 回答 1

0

我运行如下代码,它似乎在我编写的应用程序中运行良好。注意 ShouldAutoplay=false;

NSUrl data = new NSUrl(info.ObjectForKey(new NSString("UIImagePickerControllerMediaURL")).ToString());

//get the video thumbnail
MPMoviePlayerController movie = new MPMoviePlayerController(data);
movie.ShouldAutoplay = false;
UIImage videoThumbnail = movie.ThumbnailImageAt(0.0, MPMovieTimeOption.NearestKeyFrame);
于 2012-05-17T18:13:12.287 回答