Accessing a video saved in the filesystem gallery? Capacitor 3 and Ionic 5 / Android 11

I’m using Capacitor 3 and Ionic 5 angular, physical device Samsung Galaxy s20 and Android 11

I0’ve used the media capture plugin for recording a video and i get a result like this:

[MediaFile]
0: MediaFile
end: 0
fullPath: "file:///storage/emulated/0/DCIM/Camera/20210522_185343.mp4"
lastModified: null
lastModifiedDate: 1621702425000
localURL: "cdvfile://localhost/sdcard/DCIM/Camera/20210522_185343.mp4"
name: "20210522_185343.mp4"
size: 13596835
start: 0
type: "video/mp4"
__proto__: File
length: 1

What should i do if i want to access that video and send, for example, uploading it to my server?

I’ve tried this:

public async addNewToGallery() {
    this.mediaCapture.captureVideo().then(
      (data: MediaFile[]) => {
        console.log(data);
        this.videos.unshift({
          filepath: data[0].fullPath,
          webviewPath: data[0].fullPath
        });

        this.videoUrl = Capacitor.convertFileSrc(data[0].fullPath);
      },
      (err: CaptureError) => console.error(err)
    );
  }

  <ion-grid>
    <ion-row>
      <ion-col size="6">
        <video type="video/mp4" [src]="this.videoService.videoUrl"></video>
      </ion-col>
    </ion-row>
  </ion-grid>


If I inspect the html element i get this:


http://capacitor_file/storage/emulated/0/DCIM/Camera/20210522_185343.mp4

but seems like i can’t access the file.
can you help me?

thanks

@mhartington hello Mike! Sorry to bother you!
Do you have any idea about it? Is it my fault or do i need to wait an update for the media capture plugin or for the camera plugin (it works fantastically with images) to be updated? (right now the capacitor camera plugin works only with pictures)

thanks :slight_smile:

1 Like

Hello!
Did you find any solution?
Facing a similar kind of issue.
Was trying with the File plugin but it’s not working.

At the end I’ve gave it up and i never tried again.

I donr know if the current updates fixed the issue

Oh okay!
I have tried with the latest ionic capacitor project but still not working.