通过大视频的Javascript Blob

时间:2015-11-05 14:44:53

标签: javascript

我正在尝试通过bigvideojs加载blob?我需要为视频创建一个预加载器,看起来这可能是构建它的唯一方法:

var xhr = new XMLHttpRequest(), blob;

xhr.open("GET", "412858008.mp4", true);
// Set the responseType to blob
xhr.responseType = "blob";

xhr.addEventListener("load", function () {
if (xhr.status === 200) {
console.log("Video retrieved");

 // Blob as response
 blob = xhr.response;

 console.log("Blob:" + blob);
 url = window.URL.createObjectURL(blob);
 console.log(url);

 BV = new $.BigVideo();
 BV.init();
 BV.show(url);


            }
        }, false);
        // Send XHR
        xhr.send();

0 个答案:

没有答案