我正在尝试通过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();