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

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

Github user shazron commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-media-capture/pull/79#discussion_r120506321
  
    --- Diff: src/ios/CDVCapture.m ---
    @@ -292,6 +295,65 @@ - (CDVPluginResult*)processVideo:(NSString*)moviePath 
forCallbackId:(NSString*)c
         return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsArray:fileArray];
     }
     
    +- (void)showAlertIfAccessProhibeted
    +{
    +    if (![self hasCameraAccess]) {
    +        [self showPermissionsAlert];
    +    }
    +}
    +
    +- (BOOL)hasCameraAccess
    +{
    +    if (![AVCaptureDevice 
respondsToSelector:@selector(authorizationStatusForMediaType:)]) {
    +        return YES;
    +    }
    --- End diff --
    
    Just a note here regarding iOS support for this plugin. The code is sound, 
but this selector already exists since iOS 7. I'm wondering if we should add 
iOS engine restrictions to this plugin's plugin.xml instead of all this runtime 
checking.
    
    FYI The latest cordova-ios only supports iOS 9 or greater.


> captureVideo doesn't close camera picker and doesn't show alert message about 
> prohibited camera usage
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CB-12882
>                 URL: https://issues.apache.org/jira/browse/CB-12882
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-media-capture
>    Affects Versions: 1.4.2
>            Reporter: Sergii Stotskyi
>              Labels: ios
>
> *Steps to reproduce*:
> # Create a simple application which calls `captureVideo()` method
> # Deploy application to real device
> # Click on button which starts video capturing
> # Click "No" when it asks permissions for camera
> *Expected result*:
> camera picker is animated out. And every time when user clicks on capture 
> video alert is shown as in `cordova-plugin-camera`: Access to the camera has 
> been prohibited, please enable it in the Settings app to continue. And 2 
> buttons are shown: OK, Settings
> *Actual result*:
> camera picker is not hidden. It's possible to click on record button and 
> record black screen. Eventually video is saved and viewed



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to