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/09/23 11:48:11 UTC

[GitHub] [cordova-plugin-inappbrowser] Kernelogy commented on issue #706: Unable to access camera for record video online from inappbrowser

Kernelogy commented on issue #706:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/706#issuecomment-925737047


   Use "_self" instead of "_blank"
   
   Use the below code for getting permissions set
   And the permissions set for the app will applies only for the "_self"
   
   ```
           checkAndRequestPermissions: function () {
               var permissions = cordova.plugins.permissions;
               var list = [
                   permissions.RECORD_AUDIO,
                   permissions.MODIFY_AUDIO_SETTINGS,
                   permissions.WRITE_EXTERNAL_STORAGE,
                   permissions.RECORD_VIDEO,
                   permissions.READ_EXTERNAL_STORAGE,
                   permissions.CAPTURE_AUDIO_OUTPUT,
                   permissions.CAMERA,
                   permissions.MICROPHONE,
                   permissions.CAPTURE_SECURE_VIDEO_OUTPUT,
                   permissions.CAPTURE_VIDEO_OUTPUT
               ];
               permissions.hasPermission(list, this.permissionSuccess, this.permissionError);
           },
           permissionSuccess: function (status) {
               var permissions = cordova.plugins.permissions;
               var list = [
                   permissions.RECORD_AUDIO,
                   permissions.MODIFY_AUDIO_SETTINGS,
                   permissions.WRITE_EXTERNAL_STORAGE,
                   permissions.RECORD_VIDEO,
                   permissions.READ_EXTERNAL_STORAGE,
                   permissions.CAPTURE_AUDIO_OUTPUT,
                   permissions.CAMERA,
                   permissions.MICROPHONE,
                   permissions.CAPTURE_SECURE_VIDEO_OUTPUT,
                   permissions.CAPTURE_VIDEO_OUTPUT
               ];
               if (!status.hasPermission) {
                   permissions.requestPermissions(
                       list,
                       function (status) {
                           if (!status.hasPermission) this.permissionError();
                       },
                       this.permissionError());
               }
           },
           permissionError: function () {
               console.warn('Enabling permissions failed!');
           },
   ```
   
   The app permissions are not applied for the browser opening as "_blank"
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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