Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access the recorded video Ionic & Capacitor #221

Open
ciccilleju opened this issue May 22, 2021 · 1 comment
Open

Can't access the recorded video Ionic & Capacitor #221

ciccilleju opened this issue May 22, 2021 · 1 comment

Comments

@ciccilleju
Copy link

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

I’ve used the media capture plugin for recording a video which is saved in my gallery.

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[]) => {
this.videos.unshift({
filepath: data[0].fullPath,
webviewPath: data[0].fullPath
});

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

}

but it dosnt let me access the file, which now have this "address", after the conversion:

http://capacitor_file/storage/emulated/0/DCIM/Camera/20210522_185343.mp4
but seems like i can’t access the file.

it depends on me or is an android 11 problem?
thanks

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [ x] I included all the necessary information above
@danielhdz56
Copy link

Running into the same issue, were you ever able to send it to your server?
on my end when I do capture image the image does get saved to my gallery, but I’m unable to save videos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants