function urlToBlob(the_url, callback) {
let xhr = new XMLHttpRequest();
xhr.open("get", the_url, true);
xhr.responseType = "blob";
xhr.onload = function() {
if (this.status == 200) {
if (callback) {
callback(URL.createObjectURL(this.response));
}
}
};
xhr.send();
}
urlToBlob(classInfo.videoUrl,function (res) {
console.log(res)
video.src = res
})
前端转化视频链接
最新推荐文章于 2023-12-04 10:00:32 发布