iOS, XMLHttpRequest and Video

So… Safari on iOS supports HTML5 video element. That’s great, good job Apple.
BUT - why can’t you take the extra step of allowing the video element to work with blob object URL as the source?!
1
2
3
4
5
6
7
8
9
10
11
12
  var oReq = new XMLHttpRequest();
  oReq.open("GET", URL, true);
  oReq.responseType = "blob";

  oReq.onreadystatechange = function() {
    if((oReq.readyState == 4) && (oReq.status == 200)) {
      var blobURL = (window.URL || window.webkitURL).createObjectURL(oReq.response);
      $("#myVideo").attr("src", blobURL);
    }
  }

  oReq.send();
Comments

Comments