Home > Mobile >  why use XMLHttpRequest (XHR) and not HTTP 206 Partial Content?
why use XMLHttpRequest (XHR) and not HTTP 206 Partial Content?

Time:09-27

I see most video streaming sites use XMLHttpRequest (XHR) and not HTTP 206 Partial Content,

Why, Does XHR work better?

CodePudding user response:

The website you are referring to are probably using the MediaSource API (for instance YouTube does, that's why they use a blob:// URI).

This API allows to "compose" the media to be played using different sources. This is how most adaptive streaming is done. When the bandwidth can't cope anymore, the script will request a lower quality and push it to the end of the MediaSource, just like if it was the same file as the highest quality that got fetched until then.

  • Related