You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/01/02 05:53:40 UTC

[GitHub] [cordova-plugin-media-capture] billyjacobs2014 commented on issue #135: Read the video file on android

billyjacobs2014 commented on issue #135: Read the video file on android
URL: https://github.com/apache/cordova-plugin-media-capture/issues/135#issuecomment-570123926
 
 
   It appears you have to request permissions at run-time in order to access the file. 
   I used this plugin - cordova-plugin-android-permissions
   
   Then before I capture the video I do the following:
   
   ` 
   var permissions = (window as any).cordova.plugins.permissions;
   permissions.checkPermission(permissions.READ_EXTERNAL_STORAGE, (status: {hasPermission: boolean}) => {
             if(status.hasPermission) {
               (navigator as any).device.capture.captureVideo(this.takeVideoFromHybridApp, (error: any) => {
                 // Error Handling Here
               }, {limit:1});
             } else {
               permissions.requestPermission(permissions.READ_EXTERNAL_STORAGE, (status: {hasPermission: boolean}) => {
                 if(status.hasPermission) {
                   (navigator as any).device.capture.captureVideo(this.takeVideoFromHybridApp, (error: any) => {
                     // Error Handling Here
                   }, {limit:1});
                 } else {
                   // Error Handling Here
                 }
               }, () => {
                 // Error Handling Here
               });
             }
           }, () => {
             // Error Handling Here
           `});``

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


With regards,
Apache Git Services

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