Skip to content

Commit

Permalink
fix: video quality on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvan Adrian committed Aug 31, 2021
1 parent 5b82637 commit 1a40478
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ios/CDVCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ - (void)displayPopover:(NSDictionary*)options
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if([navigationController isKindOfClass:[UIImagePickerController class]]){

// If popoverWidth and popoverHeight are specified and are greater than 0, then set popover size, else use apple's default popoverSize
NSDictionary* options = self.pickerController.pictureOptions.popoverOptions;
if(options) {
Expand All @@ -290,8 +290,8 @@ - (void)navigationController:(UINavigationController *)navigationController will
[viewController setPreferredContentSize:CGSizeMake(popoverWidth,popoverHeight)];
}
}


UIImagePickerController* cameraPicker = (UIImagePickerController*)navigationController;

if(![cameraPicker.mediaTypes containsObject:(NSString*)kUTTypeImage]){
Expand Down Expand Up @@ -743,6 +743,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 1a40478

Please sign in to comment.