I need streaming audio from my web API. In standard HTML-5 audio, the src attribute is set to the audio URI from the WebAPI.
The problem is this: the web API protected by the Asp.Net identifier requires that the token be passed in the headers, however the HTML AUDIO TAG does not allow us to do so. I finally left two alternatives:
Approach 1. Download HTML using an XHR request and play locally.
Approach 2. Pass the headers through the query string. So that we can token in the OWIN pipeline during request processing.
The first approach mentioned above is not viable, because if we download audio locally, we will skip the streaming functions provided by the web API.
Could you help with approach-2, i.e. so that on the Web API side, we can read the token from the URL and then initiate Asp.Net authentication?
html5 html5-audio asp.net-web-api asp.net-identity owin
Abhijeet
source share