Skip to content

Commit

Permalink
Enabe High quality video mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Jan 14, 2022
1 parent 08d215f commit 1a50e9c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ios/CDVCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ - (void)showCameraPicker:(NSString*)callbackId withOptions:(CDVPictureOptions *)
self.hasPendingOperation = NO;
} else {
cameraPicker.modalPresentationStyle = UIModalPresentationCurrentContext;
// set videoQuality to High
cameraPicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
cameraPicker.editing = YES;

[self.viewController presentViewController:cameraPicker animated:YES completion:^{
self.hasPendingOperation = NO;
}];
Expand Down Expand Up @@ -291,11 +295,13 @@ - (void)navigationController:(UINavigationController *)navigationController will
}
}


UIImagePickerController* cameraPicker = (UIImagePickerController*)navigationController;

if(![cameraPicker.mediaTypes containsObject:(NSString*)kUTTypeImage]){
[viewController.navigationItem setTitle:NSLocalizedString(@"Videos", nil)];
// video quality high
cameraPicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
cameraPicker.editing = YES;
}
}
}
Expand Down Expand Up @@ -743,6 +749,9 @@ + (instancetype) createFromPictureOptions:(CDVPictureOptions*)pictureOptions;
NSArray* mediaArray = @[(NSString*)(pictureOptions.mediaType == MediaTypeVideo ? kUTTypeMovie : kUTTypeImage)];
cameraPicker.mediaTypes = mediaArray;
}
if (@available(iOS 11.0, *)) {
cameraPicker.videoExportPreset = AVAssetExportPreset1920x1080; //full hd
}

return cameraPicker;
}
Expand Down

0 comments on commit 1a50e9c

Please sign in to comment.