Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the blob: protocol work as <video> source?

Tags:

html

video

A friend of mine was trying to download a Twitter embedded video and found something like this in the HTML code:

<video preload="auto" data-id="content" data-type="content" src="blob:https%3A//twitter.com/7897de6d-6eed-4905-9ed2-00ea3d2c99d5" class="visible paused" style="width: 100%; height: 100%;"></video>

I'm as puzzled as he was when I tried to find out the real source of the video stream (either by inspecting the browser network console and hitting a proxy). As the video played, the bytes seem to come out of nowhere.

How does the browser understand the blob "protocol"?

like image 464
Humberto Avatar asked Jul 12 '16 13:07

Humberto


People also ask

Can we store video in blob?

Azure Blob Storage is the object-storage solution provided by Microsoft Azure Cloud. It is very similar to AWS's S3 object storage. We can upload video files to it and load them on the user's device.

What is blob in video?

Blobs are used to store a specific type of information, such as images and multimedia files. They also typically require a lot more space than other types of data. Blob URLs contain pseudo protocols that can create a temporary URL to audio and video files.

How do I read a blob video?

Method 1: Use VLC Media Player to Convert and Download Blob Video. VLC Media Player might not be as popular as it once used to be, but the app still has its uses. The media player can convert blob URL videos into downloadable MP4 files and save them to your PC.

What is the blob protocol?

Blob URL/Object URL is a pseudo protocol to allow Blob and File objects to be used as URL source for things like images, download links for binary data and so forth. For example, you can not hand an Image object raw byte-data as it would not know what to do with it.


1 Answers

Blobs are a way of handling memory that belongs to the browser. This could be files, or data from a canvas, or data that is computed in some other way. When data is loaded in such a way that JavaScript has a blob access to it, you can create a BlobURI, which is a url pointing to the internal memory structure.

In the case of twitter using blob url's for video, I would suspect that they are either proxying the video through a canvas in order to apply a filter, or are using blobs for some sort of local buffer. Either way, this means that the memory was accessible to JS at some point in the past.

like image 63
Mobius Avatar answered Oct 06 '22 19:10

Mobius