Radio-T build of a cross-browser javascript wrapper for the html5 audio tag
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 6 commits ahead, 48 commits behind kolber:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

audio.js (Radio-T build)

audiojs is a drop-in javascript library that allows HTML5's <audio> tag to be used anywhere. It uses native <audio> where available and falls back to an invisible flash player to emulate it for other browsers. It also serves a consistent html player UI to all browsers which can be styled used standard css.

It plays mp3s. No ogg. Because, lets be honest, in the real world, no one really exports ogg files. Sadly, that means Opera and Firefox get flash audio. Hopefully they can add mp3 support soon.


  1. Put audio.js, player-graphics.gif & audiojs.swf in the same folder.

  2. Include audio.js:

     <script src="/audiojs/audio.js"></script>
  3. Initialise audiojs:

     <script> {
         var as = audiojs.createAll();
  4. Then you can use <audio> wherever you like in your HTML:

     <audio src="/mp3/juicy.mp3" preload="auto" />

Bugs / Contributions

  • Report a bug
  • To contribute or send an idea, github message me or fork the project


On OSX, you should install closure compiler following the instructions in Ben's gist.

Then you can run rake compile from root directory and it will package audio.js into audio.min.js.

Compiling Flash from the command line

If you want to mess around with the flash-side of things, you will need to be able to compile the .as file into a .swf.

Using the Flex SDK (which is free), flash movies can be compiled directly from the command line. It makes life that little bit less painful.

Installing mxmlc

  1. Download and unzip the current 'Milestone Release' 'Open Source Flex SDK' from:

  2. Copy the bin folder to /usr/local/bin/flex/bin/

  3. Add /usr/local/bin/flex/bin/ to your PATH

Compiling the SWF

Run the following command from within the audiojs folder.