createBlob = async function Blob(link){
const file = await fetch(link)
return file.blob()
}
downloadBlob = async function download(link){
const result = await this.createBlob(link);
if(result){
let atag = document.createElement("a");
atag.download = 'myVid';
atag.href = window.URL.createObjectURL(result);
document.body.appendChild(atag);
atag.click();
document.body.removeChild(atag)
}
}
if twitter is your thing come say hi Tweet to @MhlunguSfundo or drop a question i am happy to answer.
Top comments (0)