audio.js

Installation

  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 audio.js:

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

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

Examples

A series of API tests & examples for using and extending audio.js

Example 1 Test multiple load types

Example 2 Custom markup/css

Example 3 Multiple players, testing preload, loop & autoplay attributes

Example 4 Customised player

Example 5 Customised playlist player

Example 5 Volume Control

Source code

All efforts have been made to keep the source as clean and readable as possible. Until we release more detailed documentation, the annotated source is the best reference for usage.

Annotated source / Source on Github