jbavari/cordova-plugin-video-editor

Can't read file

Opened this issue · 2 comments

I'm not able to edit the captured video.

My code:

captureVideo2(){
    this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE)
        .then(status => {
            if (status.hasPermission) 
            {
              this.captureVideoOther();
            } 
            else 
            {
              this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE)
              .then(status =>{
                if(status.hasPermission) {
                  this.captureVideoOther();
                }                          
              });
            }
        })
        .catch((error) => { console.log(error)})     
  }
captureVideoOther(){
    console.log("captureVideoOther");
    let options: CaptureVideoOptions = {limit: 1, quality: 1, duration: 30 };
    
      this.mediaCapture.captureVideo(options)
          .then( 
                (data: MediaFile[]) => {               
                console.log(data);
                this.editVideoCaptured(data);            
                this.videoGravado = true;
            },
            (err: CaptureError) => console.error(err)
          )
          .catch((error:any) => console.log('erro', error))   
      
  }
  editVideoCaptured(urlvideo){
    this.videoEditor.transcodeVideo({
      fileUri: urlvideo[0].fullPath,
      outputFileName: 'output-mobile',
      outputFileType: this.videoEditor.OutputFileType.MPEG4,
      saveToLibrary: false,
      deleteInputFile: true,    
      maintainAspectRatio: true,
      width: 640,                 
      height: 360,             
    })
    .then((fileUri: string) => console.log('Video Transcode success', fileUri))
    .catch((error:any) => console.log('video transcode erro', error))   
  }

ERRO in CONSOLE:

video transcode erro java.io.IOException: can't read file: file:///storage/1E34-1801/DCIM/Camera/VID_20210720_152112.mp4 -> /storage/1E34-1801/DCIM/Camera/VID_20210720_152112.mp4

I got the same problem , I even added the WRITE_EXTERNAL_STORAGE androidPermission during run time , and still didnt work

did you manage to find a workaround regarding the issue ?