I am making a google chrome extension that is like a notes editor. I am trying to add a feature where the user can download their notes as a word document (initially I tried pdf, after doing research I found that pdfs cannot render video and audio), and the notes can contain embedded html5 audio and video ( and ). I searched up how to generate a word document from html and I used the code I found, but audio and video are not being rendered. I did a lot of research and found nothing about this. My code for making the word document is below:
const preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title>NoteLab Notes</title></head><body>";
const postHtml = "</body></html>";
const html = preHtml + notes.innerHTML + postHtml;
const blob = new Blob(['\ufeff', html], {
type: 'application/msword'
});
const url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
const filename = prompt("What should be the name of the file?") + '.doc'
const downloadLink = document.createElement("a");
document.body.appendChild(downloadLink);
if(navigator.msSaveOrOpenBlob ){
navigator.msSaveOrOpenBlob(blob, filename);
}
else {
downloadLink.href = url;
downloadLink.download = filename;
downloadLink.click();
}
document.body.removeChild(downloadLink);
How am I supposed to get video and audio rendered?