Playing a locally saved video in Angular

1.4k Views Asked by At

I'm building a small Angular application, in which the user should be able to view a collection of locally saved videos and save the collection in order to rewatch these videos at a later point in time. The paths of the videos are saved in a JSON-File, which means I only have access to the string of a path like this:

C:\My Videos\UploadedVideo.mp4

Passing this path to the src of a video-HTML-element doesn't allow me to play it though. I've seen workarounds where a input-element is used and the file is passed to the video-element, but this doesn't work in my case as I have the file path and don't want the user to reselect the videos over and over again.

1

There are 1 best solutions below

0
Adamicov On

You're not able to use your system path in browser.

You have two options:

  • Add your videos to your Assets folder in Angular

  • Put video online
    (eg: create Bucket on Amazon S3 for this kind of files and access it via the bucket link).