Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70764

Storing video locally and embed into view

$
0
0

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

  1. this.http.post(url, null, { responseType: ‘blob’ }).subscribe(…
  2. 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);
  3. Filesystem.writeFile({ path: ‘video.mp4’, data: filedata, directory: FilesystemDirectory.Data })…
  4. Filesystem.getUri({ path: ‘video.mp4’, directory: FilesystemDirectory.Data })…
  5. 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

Read full topic


Viewing all articles
Browse latest Browse all 70764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>