Let's start with an example:
- You visit youtube.com, which uses Media Source Extension (MSE) with HTML5 for certain devices.
- MSE injects the <video> tag with a blob URL. It looks something like this: blob:https://www.youtube.com/blahblahblah"
- Throughout streaming the entire video, your browser makes multiple network calls to download the various chunks of video, and appends them to the MSE's SourceBuffer
- Therefore, the Meda Source object as a whole is updated throughout the video stream
- However, the blob URL that was initially attached to the <video> element, which is suppose to represent the Media Source object, remains constant.
To me, this doesn't seem to make much sense. Blob URLs are suppose to represent chunks of immutable data that never changes. But it seems like MSE is able to make them represent a mutable buffer of memory.
How does this work under the hood? And if we also want to make blob URLs represent some mutable buffer of memory, how can we do this ourselves with javascript?