Convert blob url into blob source code in jQuery
// blob url
var videoblob = $('.j-video_result').attr('src');
var blobUrl = videoblob;
alert(blobUrl);
var xhr = new XMLHttpRequest;
xhr.responseType = 'blob';
xhr.onl oad = function() {
var recoveredBlob = xhr.response;
var reader = new FileReader;
reader.onl oad = function() {
var blobAsDataUrl = reader.result;
// window.location = blobAsDataUrl;
// $('.audiovalue').val(blobAsDataUrl);
alert(blobAsDataUrl);
};
reader.readAsDataURL(recoveredBlob);
};
xhr.open('GET', blobUrl);
xhr.send();
});
var blobUrl = videoblob;
alert(blobUrl);
var xhr = new XMLHttpRequest;
xhr.responseType = 'blob';
xhr.onl oad = function() {
var recoveredBlob = xhr.response;
var reader = new FileReader;
reader.onl oad = function() {
var blobAsDataUrl = reader.result;
// window.location = blobAsDataUrl;
// $('.audiovalue').val(blobAsDataUrl);
alert(blobAsDataUrl);
};
reader.readAsDataURL(recoveredBlob);
};
xhr.open('GET', blobUrl);
xhr.send();
});
Comments
Post a Comment