iOS - How to get thumbnail from video without play?
问题 I'm trying to get thumbnail from video and show it in my tableview. Here is my code: - (UIImage *)imageFromVideoURL:(NSURL *)contentURL { AVAsset *asset = [AVAsset assetWithURL:contentURL]; // Get thumbnail at the very start of the video CMTime thumbnailTime = [asset duration]; thumbnailTime.value = 25; // Get image from the video at the given time AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc] initWithAsset:asset]; CGImageRef imageRef = [imageGenerator