Sunday 15 April 2012

javascript - Change User-Agent of audio tag -


I'm working on an HTML5 (not Flash) Shotastik Client For some streams, I have a < Code> & lt; Audio & gt; I can set the src of the tag and it plays just fine.

But there is a stream that does not work in that way because the URL of the stream is like the steam's index.html page, it uses a user agent If it's a browser, you get an HTML page; If it is not, you receive an MP3 stream.

Then, & lt; Audio & gt; How can I edit the request header sent by the browser when requesting a resource for the tag? I do not want to send this user-agent.

I do not think there is no way to change the user-agent but you can use SHOUTcast Finally, the semicolon ; By adding the service to the stream, SHOUTcast will ignore the user-agent.

HTML5 example:

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt; Audio control & gt; & Lt; Source src = "http: //72.13.82.82-12100/;" /> & Lt; Em> Sorry, your browser does not support HTML5 audio. & Lt; / Em> & Lt; / Audio & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

You can http: //72.13.82.82-12100/; can verify the action by going directly to the browser. You should see some ICI metadata after MPEG stream.

No comments:

Post a Comment