I have this idea of integrating a video player in my website that can stream files that are download only by default , so far I have researched that concluded to a question , that Can I create a blob object on client side and stream it ?
<video id="player" src="THE_BLOB_OBJECT">
<script>
function blob_create(){
passedUrl = 'PASSED FROM BACKEND'
function blob_obj(url){
// MAGIC CODE TO CREATE A BLOB
return link
}
createdObj = blob_obj(passedUrl)
document.getElementById('player').src = createdObj
}
</script>
I don't know if the above is possible as I have a very little understanding of blob, any alternates to stream a download file will work too.
You can use URL.createObjectURL(param) to convert the passed url to blob Object.
Example:
function blob_obj(url){
return URL.createObjectURL(url);
}