我想从我的代码中删除 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();
最佳答案
我运行如下代码,它似乎在我编写的应用程序中运行良好。注意 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);
关于c# - 如何在不启动 Monotouch 播放的情况下从电影中获取缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10481063/