Tuesday, 15 December 2020

How do I send headers while setting audio src?

I'm trying to play an audio file using html5 audio tag.

It plays fine..

But for some reason it is required that the request browser is making for the source, must include a specific header that the browser (safari in my case) is not adding. (where as I see chrome adds)

the header is: Accept-encoding: gzip

How can I make this happen?

I do not want to download entire file beforehand... I want audio tag to handle it, with a new header.

document.getElementById("audio").load();
document.getElementById("audio").play();
<audio id="audio" src="https://upload.wikimedia.org/wikipedia/commons/transcoded/7/7b/FurElise.ogg/FurElise.ogg.mp3"> <audio>
    

once again, when this code runs, I just want to modify header for every request made for this...



from How do I send headers while setting audio src?

No comments:

Post a Comment