Method for launching audio player on Android from web page for streaming media

Brad picture Brad · Feb 14, 2011 · Viewed 13.2k times · Source

To link to SHOUTcast/HTTP internet radio streams, traditionally you would link to a playlist file, such as an M3U or PLS. From there, the browser would launch the audio player registered to handle the playlist. This works great on any PC, Palm, Blackberry, and iPhone.

This method does not work in Android without installing extra software. Sure, Just Playlists or StreamFurious can handle it just fine, but I am assuming there has to be a way to invoke the audio or video player commonly installed by default on Android installations.

By default, no audio player is capable of handling M3U or PLS. The player seems to open it, but says "Unsupported Media Type".

To make this more annoying, the browser is capable of streaming MP3 audio over HTTP, simply by opening a link to an MP3 file. I have tried simply linking directly to the MP3 stream hosted by SHOUTcast, which should end up in the same result, but SHOUTcast detects "Mozilla" in the user-agent string, and instead of sending the stream, it sends the information page for the station.

How should I link to a SHOUTcast stream on Android, from a normal mobile site, without using extra applications?

Answer

fredley picture fredley · Feb 17, 2011

As noted in the comments, what you're asking is impossible, at least until 3.0 comes out and even then it'll be a long time before the functionality is on most devices. The 'without extra apps' constraint is far too limiting. Here are some alternatives that violate this constraint that I urge you to consider instead:

  • Ask users to install an app
    Yes it's not what you want, but it's the easiest thing to do. Just Playlists (as you've discovered) would be a good one to recommend.

  • Use flash
    Not everyone has flash, but for those that do you can embed a flash widget to play the playlist. I found one that sounds like it'll work just from a quick google. Does SHOUTcast have it's own flash player?

  • Wait
    Basically your only other option, since this functionality just isn't there in Android, yet.