Question

I have been looking for several days to find a way to do SHOUTcast Streaming in all major browsers without using a Flash Player, but I haven't been able to do so (except on Safari):

<audio controls src="http://38.96.175.97:7736/;"></audio>

The semicolon at the end of the "src" attribute forces the SHOUTcast server to ignore the user-agent string and use MPEG OVERRIDE instead, which does not contain Mozilla and is assumed to be an audio player. Sadly, this trick has only worked for me on Safari so far.

Does anyone have any idea of how to do this in other browsers (Chrome, Firefox, etc)?

Was it helpful?

Solution

The problem is not the issue with the User-Agent sniffing, but the fact that SHOUTcast servers do not send standard HTTP responses.

A normal HTTP response starts off with a status line that looks like this:

HTTP/1.0 200 OK

SHOUTcast servers send this instead:

ICY 200 OK

This works for many HTTP clients, but more and more HTTP clients break on a response like this.

The solution is to stop using SHOUTcast. Icecast is a good alternative. I have written my own called AudioPump Server to help with compatibility in browsers as well as Android clients.

If the stations you want to play aren't yours, you would have to proxy that playback through your own server to fix the status line problem.

OTHER TIPS

You should try this tool.

http://www.schillmania.com/projects/soundmanager2/

It worked for me in any browser.

It also works on Android and iOS devices. Ta-ta for now :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top