I'm working on an Angular [4+] application. In one of my HTML templates I have a HTML5 video tag.
I have n files located on the disk:
1.mp4
2.mp4
...
n-1.mp4
n.mp4
Once the user pressed the Play button, I want the video to start playing the first file:
1.mp4
Once the file ends, I want the same HTML video tag to start playing the file:
2.mp4
and so on till it reaches the n.mp4 and play it to it's end.
I want that the switching of the files would be as smooth as possible, with no latency, no loading time, as if the HTML video tag plays a single file without switching n files.
The only solution I have in mind is changing the src attribute of the HTML video tag, and maybe implement some buffer so that if the x.mp4 is about to reach it's end, the x+1 file already starts loading. Any ideas on how to implement this?
What do you think is the ideal solution for this scenario? (Note that combining those n files into one in advance is not an option, cause those files are created dynamically, and I know the exact amount of files only once the user has pressed play on the HTML video tag).