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 2019/11/23 04:17:21 UTC

[GitHub] [cordova-plugin-camera] neerajsaxena0711 commented on issue #506: iOS13 file_uri error picking video from gallery

neerajsaxena0711 commented on issue #506: iOS13 file_uri error picking video from gallery
URL: https://github.com/apache/cordova-plugin-camera/issues/506#issuecomment-557765346
 
 
   So I am having a "Upload Video from gallery" feature on my app. When I run it on iOS emulator, it works as expected. That is, I am able to choose a video file from the gallery, and then upload it. 
   However when I run the app on my iPhone, I am able to pick the file from the gallery and then I get error code - 1.
   
   Here is my code - 
   
   My options are - 
   
     public options = {
       allowEdit: true,
       SAVEDPHOTOALBUM: true,
       sourceType: this.camera.PictureSourceType.SAVEDPHOTOALBUM,
       mediaType: this.camera.MediaType.VIDEO,
       destinationType: this.camera.DestinationType.NATIVE_URI,
     }
   
   My getVideo function - 
   
   ` async openVideo() {
       try {
         await this.camera.getPicture(this.options).then((filreUri => {
           window.resolveLocalFileSystemURL(filreUri, FE => {
             FE.file(async file => {
               // this.presentToast("I have come here");
               this.fileInfo = file;
               if (file.type == "video/mp4") {
                 const FR = new FileReader();
                 FR.onloadend = ((res: any) => {
                   let AF = res.target.result;
                   this.blob = new Blob([new Uint8Array(AF)], { type: file.type });
                   console.log("Done");     
                 });
                 FR.readAsArrayBuffer(file);
               } else {
                 //
               }
             });
           }, (error)=>{
   			console.log("error resolving file"+ error)
   		});
         })).catch((err) => {
           this.fileInfo = ""
           console.log("Inside err of camera.getpicture");
         });
       } catch (e) {
       } finally {
         // console.log( "Finally", JSON.stringify(this.fileInfo));
         if (this.fileInfo != undefined)
           this.navCtrl.push('UpoadMediaPage', { "blob": this.blob});
       }
     }`
   
   My code goes into - error resolving file - with error code - 1
   
   I have tried the changes mentioned above by @markerio - changed my camera.h and camera.m files 
   and also solution provided by @litiobat. 
   
   Am I doing something wrong?
   Kindly help.

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