js 请求媒体文件, 通过video播放
var xhr = new XMLHttpRequest(); xhr.open("get", "lib/test.rar", true); xhr.responseType = "blob"; xhr.onload = function() { if (this.status == 200) { var blob = this.response; $('video')[0].src=window.URL.createObjectURL(blob); } }; xhr.send();
关键词 XMLHttpRequest, blob createObjectURL

浙公网安备 33010602011771号