cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-10180) Add support for video capture quality on iOS
Date Thu, 04 Oct 2018 23:25:00 GMT

    [ https://issues.apache.org/jira/browse/CB-10180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16639030#comment-16639030
] 

ASF GitHub Bot commented on CB-10180:
-------------------------------------

jcesarmobile closed pull request #65: CB-10180: (iOS) implement the 'quality' property in
captureVideo()
URL: https://github.com/apache/cordova-plugin-media-capture/pull/65
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 28580b0..5ba0961 100644
--- a/README.md
+++ b/README.md
@@ -372,6 +372,10 @@ capturing a video clip, the `CaptureErrorCB` callback executes with a
 ### iOS Quirks
 
 - The __limit__ property is ignored.  Only one video is recorded per invocation.
+- iOS supports an additional __quality__ property, to allow capturing video at different
qualities.  A value of `1` means high quality and value of `0` ( the default ) means low quality,
suitable for MMS messages.
+  See [here](https://developer.apple.com/reference/uikit/uiimagepickercontrollerqualitytype?language=objc)
for more details.
+  A value of 0 corresponds to UIImagePickerControllerQualityTypeMedium (the default value
of the [UIImagePickerController.videoQuality](https://developer.apple.com/reference/uikit/uiimagepickercontroller/1619154-videoquality?language=objc)
property)
+  A value of 1 corresponds to UIImagePickerControllerQualityTypeHigh
 
 ### Android Quirks
 
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 53e1b2b..53eb9e8 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -219,10 +219,11 @@ - (void)captureVideo:(CDVInvokedUrlCommand*)command
         options = [NSDictionary dictionary];
     }
 
-    // options could contain limit, duration and mode
+    // options could contain duration, limit, mode and quality
     // taking more than one video (limit) is only supported if provide own controls via cameraOverlayView
property
     NSNumber* duration = [options objectForKey:@"duration"];
     NSString* mediaType = nil;
+    NSNumber* quality = [options objectForKey:@"quality"];
 
     if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
         // there is a camera, it is available, make sure it can do movies
@@ -263,7 +264,9 @@ - (void)captureVideo:(CDVInvokedUrlCommand*)command
         // iOS 4.0
         if ([pickerController respondsToSelector:@selector(cameraCaptureMode)]) {
             pickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
-            // pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
+            if (quality && [quality intValue] == 1) {
+                pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
+            }
             // pickerController.cameraDevice = UIImagePickerControllerCameraDeviceRear;
             // pickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> Add support for video capture quality on iOS
> --------------------------------------------
>
>                 Key: CB-10180
>                 URL: https://issues.apache.org/jira/browse/CB-10180
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-plugin-media-capture
>    Affects Versions: 1.1.0
>         Environment: iOS
>            Reporter: Nicolas Leclerc
>            Priority: Major
>              Labels: iOS, triaged
>
> iOS does not support the new {{quality}} option.
> Adding it would be great.
> I submitted a PR some time ago but rebased it to v1.1.0.
> https://github.com/apache/cordova-plugin-media-capture/pull/48



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message