9

I am trying to build a website for an internet radio station. I would like to incorporate a feature that allows visitors to play the live audio stream on the website itself.

What technologies should I be looking at to get started? How is this commonly done? Is there a method that is often considered the best for live streaming?

Brad
  • 146,404
  • 44
  • 300
  • 476
Brian Roisentul
  • 4,180
  • 7
  • 50
  • 80

2 Answers2

2

Depending on the formats you stream to, you have a few options:

  • HTML5 Audio objects (codec compatibility varies from browser to browser and I am not aware of any format besides WAV that is cross-compatible; if you have OGG and MP3 you should cover all current browsers supporting HTML5 Audio). This allows you to control audio through Javascript and is very lightweight in terms of implementation. This will probably work well with modern browsers, but will not be great for Internet Explorer users as not so many users switched to IE9. example stats
  • A Flash-based player. This will allow you to stream MP3 or FLA audio. Development is clunkier than plain Javascript, but you probably have better penetration than HTML5 Audio. In my limited experience, the Flash player needs some time to initialize so the user experience is not as quick as with HTML5 Audio.
  • Native browser plugins. They are hacky, most likely don't work cross-platform. Stay away if you can.
Sorin Mocanu
  • 916
  • 4
  • 11
0

Flash is the most widely used for this, as evidenced by sites like NPR, and Bandcamp.

Java might also be a valid option if you are more of the programmer type.

Either way I recommend using the <object> tag, not <embed> or <applet>

For flash look at: http://www.alistapart.com/articles/flashsatay

For Java use something like:

<object width="" height=""
    type="application/x-java-applet"
    archive="containing.jar"
    classid="java:package.applet.class">
</object>

If, however you want to run from a folder, not a jar archive the codebase is added in as a <param /> not an attribute.

Hawken
  • 1,928
  • 17
  • 33