@altinum-tech wrote:
Hello!
I am downloading a video from server as blob and storing it with capacitor.
So far this works, but i cant insert the locally file path in view, it cant find the source (but i can see the file via dev tools) or if i want to embed it via file:/// it will not allow to embed that.My steps:
- this.http.post(url, null, { responseType: ‘blob’ }).subscribe(…
- Blob response to text:
const reader = new FileReader();
reader.addEventListener(‘loadend’, (e: any) => {
const text = e.srcElement.result;
this.fileWrite(‘video.mp4’, text);
});
reader.readAsText(blobfile);- Filesystem.writeFile({ path: ‘video.mp4’, data: filedata, directory: FilesystemDirectory.Data })…
- Filesystem.getUri({ path: ‘video.mp4’, directory: FilesystemDirectory.Data })…
- Set Capacitor.convertFileSrc(‘file://’ + res.uri) as video source (while res.uri = /DATA/video.mp4)
What am i doing wrong?
Thanks in advance!
Kind regards,
Alex
Posts: 1
Participants: 1