Any way to make a blob video url on the backend?

Hi there,
Is there any way to make a blob file and a URL using the backend? I can make a blob file with various packages, but no URL. Any ideas? Would prefer Node.js but PHP will do. Is it even possible? Here’s the javascript code I usually use (clientside): https://glitch.com/edit/#!/eddiestechvidplayer. Would be great if someone could put me in the right direction. Am using blobs to hide original video URLs, but the URL is shown anyway in inspect element as the code is clientside. Any other methods of protection would be good to know as well :slight_smile:

Eddie

Blobs are a substitute for files for the front-end web, where you normally don’t have access to a filesystem. On a backend you normally do have access to a filesystem, so often you would make a temporary file instead. Then, whatever web framework you use, route an opaque path to a handler that responds with the content of that file. A URL to that path becomes something like the blob URL.

Blobs have a kind of nice property that they are scoped to a web page. When the page gets unloaded, the browser can forget about any blobs that it made. But these backend servers tend to run for longer periods of time. Be careful that you don’t end up piling up tons of temporary files.

3 Likes