当从摄像机切换到视频时,UIImagePickerController崩溃

问题描述 投票:1回答:1

切换到视频捕获模式后,在使用ios 13真实设备的iPhone上,UIImagePickerController崩溃。崩溃在UIImagePickerController的第二次演示中重现。崩溃不会在ios 13(真实设备)之前的版本上重现。在使用Xcode 11.0构建的Info.plist测试应用中设置了相机和麦克风的使用描述键。

步骤:

目前的UIImagePickerController关闭UIImagePickerController目前的UIImagePickerController点按视频按钮->崩溃如果我设置videoQuality = UIImagePickerControllerQualityTypeHigh,则崩溃不会重现。但是我需要UIImagePickerControllerQualityTypeMedium。

@interface ViewController () < UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@end

@implementation ViewController

#pragma mark - IBActions

- (IBAction)showPicker:(UIButton *)sender {
    UIImagePickerController *pickerController = [UIImagePickerController new];
    pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    pickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
//    pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
    pickerController.delegate = self;

    [self presentViewController:pickerController animated:YES completion:NULL];
}

#pragma mark - UIImagePickerControllerDelegate

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey, id> *)info {
    [self dismissViewControllerAnimated:YES completion:NULL];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
    [self dismissViewControllerAnimated:YES completion:NULL];
}

@end

'NSInvalidArgumentException',原因:'***-[AVCaptureDevice setActiveColorSpace:]不支持-使用activeFormat.supportedColorSpaces'

切换到视频捕获模式后,在使用ios 13真实设备的iPhone上,UIImagePickerController崩溃。崩溃在UIImagePickerController的第二次演示中重现。崩溃了...

ios objective-c uiimagepickercontroller
1个回答
0
投票

在pickercontroller中设置视频质量

© www.soinside.com 2019 - 2024. All rights reserved.