I have a button on my video player that allows users to select a file from their computer to play that through the HTML5 video player. It
$('#LocalClip').on('change', function() {
var file = $(this)[0].files[0];
var url = URL.createObjectURL(file);
$('video').attr('src', url);
});
It gets the file from an input, then converts it to a blob url, then changes the video source to it.
I wanted it to persist across reloading the page, so I tried storing the url in localStorage. (Also tried the file but that won't store).
But when I reload the page, the blob url is invalid. Is there a way to have that URL persist across reloading the page, without storing the actual video file in a javascript filesystem?
Edit: Just to clarify, I don't want to store the actual video in localStorage. Just a reference to the video to be loaded whenever the user loads the page again.