How to pass authorization header in HTTP request when using HTML5 player (audio tag) for security

I am using an HTML5 audio player as follows:

<audio controls> <source src="<url>" type="audio/mp3"> </audio> 

Now I want to protect my application, so I want to pass some sessionId in the Header parameter in the http request for mp3.

I could not find a way to do this, please help if anyone knows a solution.

or

Is there any other player who gives this support ???

+7
jquery security authentication html5 html5-audio
source share
1 answer

I think you should use HTMLAudioElement and directly play audio with javascript instead of html. Now that you are using javascript, you can use secure URLs to extract the audio file and present it to the audio element. This might work for you.

+1
source

All Articles