Trying to switch my video streaming web application using the classic <video src="http://myserver/video.mp4"> with the url on blobs to avoid completely loading simple Ctrl + s on the page.
Using XMLHttpRequest seems mandatory to allow the creation of blob from a remote video file.
The problem is that XMLHttpRequest downloads the entire file, which cannot be used to gradually use the download.
The following code is the simplest example for loading a blob from a remote file.
var r = new XMLHttpRequest(); r.onload = function() // Triggered only when all video is downloaded { video.prop("src", URL.createObjectURL(r.response)); }; r.open("GET", "http://myserver/video.mp4"); r.responseType = "blob"; r.send();
As an application for a video stream, this method is not used (if we do not want the user to wait X minutes to download the entire file, which is not broadcast at all).
Is there a way to combine blob with progressive loading?
source share