Fix 404 issues in media-tag

pull/1/head
yflory 7 years ago
parent 01a3c13a8c
commit d558b9e3e8

@ -96,11 +96,17 @@
// Download a blob from href
var download = function (src, cb) {
var download = function (src, _cb) {
var cb = function (e, res) {
_cb(e, res);
cb = function () {};
};
var xhr = new XMLHttpRequest();
xhr.open('GET', src, true);
xhr.responseType = 'arraybuffer';
xhr.onerror = function () { return void cb("XHR_ERROR"); };
xhr.onload = function () {
// Error?
if (/^4/.test('' + this.status)) { return void cb("XHR_ERROR " + this.status); }

Loading…
Cancel
Save