選擇或拍攝視頻後,我想在下面的同伴代表旁邊用該視頻的縮略圖更新我的UIUImageView
。我如何使用PHAsset
來做iOS 9和Objective C
?如何從iOS 9和Objective C中的.MOV文件中獲取縮略圖?
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) {
NSURL *videoUrl=(NSURL*)[info objectForKey:UIImagePickerControllerMediaURL];
NSData *videoData = [NSData dataWithContentsOfURL:videoUrl];
}
}
的MPMoviePlayerController在iOS的8 – Rokon