美文网首页
UIImagePickerController kUTType

UIImagePickerController kUTType

作者: iPhone | 来源:发表于2018-05-21 11:14 被阅读31次

在iOS 11以上的版本,使用 UIImagePickerController获取相册视屏,权限弹框延时弹出或者不弹出导致崩溃的解决方法;
但是,最好在有时间的情况下,还是别在使用该方法获取视频;使用PH完成!
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if ([UIImagePickerController isSourceTypeAvailable:type]) {
if ([self showCameraOrAssetlibraryLimit:type]) {
YTImagePickerController *picker = [[YTImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = type;
// picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
picker.mediaTypes = @[(NSString *)kUTTypeMovie];
picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
// picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
[weakSelf presentViewController:picker animated:YES completion:nil];
}
}
}];

相关文章

网友评论

      本文标题:UIImagePickerController kUTType

      本文链接:https://www.haomeiwen.com/subject/yjrfjftx.html