AdemDemirFE commented on issue #288:
URL: 
https://github.com/apache/cordova-plugin-media-capture/issues/288#issuecomment-2298613333

   Even if I give permission, I get this error when I trigger media capture. 
When I check, I get a permission denied error even though I gave permission.
   {code: 4, message: 'Permission denied.'}
   
   My Ionic code: 
   recordVideo() {
     debugger;
     this.videoCreationDate = moment(new Date).format("YYYY-MM-DDTHH:mm:ssZ");
     this.mediaCapture.captureVideo({ quality: 0.4 }).then((data: any) => {
       if (data.length > 0) {
         if (!this.platform.is("ios")) {
           this.convertVideoToBase64(data[0].fullPath);
         } else {
           this.convertVideoToBase64("file://" + data[0].fullPath);
         }
       }
     },
     (err) => {
       debugger;
       if (err.code === 4) {
         if (this.platform.is("ios") || this.platform.is("android")) {
           
this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA)
             .then(result => {
               if (!result.hasPermission) {
                 console.log('Has permission?', result.hasPermission);
                 
this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
                   .then(() => this.requestOtherPermissions());
               } else {
                 this.requestOtherPermissions();
               }
             })
             .catch(err => console.error(err));
         }
         this.selectFromGallery();
       } else {
         console.error('Capture video error: ', err);
       }
     });
   }


-- 
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-unsubscr...@cordova.apache.org

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


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

Reply via email to