You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/03/11 23:45:02 UTC

[GitHub] [cordova-plugin-media-capture] ath0mas commented on a change in pull request #162: (iOS) implement the 'quality' property in captureVideo()

ath0mas commented on a change in pull request #162:
URL: https://github.com/apache/cordova-plugin-media-capture/pull/162#discussion_r592801955



##########
File path: src/ios/CDVCapture.m
##########
@@ -266,7 +267,18 @@ - (void)captureVideo:(CDVInvokedUrlCommand*)command
         // iOS 4.0
         if ([pickerController respondsToSelector:@selector(cameraCaptureMode)]) {
             pickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
-            // pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
+            switch((int)([quality doubleValue]*10)) {

Review comment:
       Is this operation always safe to do here and necessary, or shouldn't we have a more "direct" _switch_ on `quality` value itself?
   
   For example if the user has bad options `{quality: null}`, or _undefined_, a string, a boolean, or any wrong/not number value for `quality` param. Or maybe the use of `NSNumber* quality = [options objectForKey:@"quality"];` will fail first in those cases?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org