Why does the Infinite Jukebox only work in Chrome and Safari?

The most common complaint I’ve heard about the Infinite Jukebox is that it doesn’t work in Firefox or Internet Explorer.  I’ve  been accused of either being part of some vast conspiracy to infect everyone’s computer with the Chrome virus or being a lazy programmer that couldn’t go the extra mile and deal with the usual cross-browser differences.

Indeed, I may be lazy, but that’s not why you need Chrome or Safari to run the Infinite Jukebox. The real reason is that the Infinite Jukebox relies on the Web Audio API for rendering audio.  The Web Audio API  is a W3C draft standard that provides a high-level Javascript API for manipulating, processing and synthesizing audio in web applications. The Infinite Jukebox needs to be able to take an MP3 and  play subsections of that MP3 at very accurate time intervals.  This capability is provided by the Web Audio API. Without this capability, the Infinite Jukebox would be impossible.

As the following chart shows, only Webkit-based browsers like Safari and Chrome support the Web Audio API.

Can I use the Web Audio API? from caniuse.com

The exciting bit is that the Web Audio API is supported by  Safari on IOS 6.0 devices.  This means that the Infinite Jukebox will run on your iPhone or your iPad.  Surprisingly, it even runs on my two year old, very slow iPhone 4:

The good news is that Mozilla has announced that they will support the Web Audio API in an upcoming version of Firefox. It is on their roadmap, but it no date has been given.  Even when they do though, there still is the problem that Firefox does not support the playing of MP3 audio.  As for IE,  Microsoft hasn’t announced any plans to support Web Audio.

So no vast conspiracy, it’s just that the Infinite Jukebox needs an advanced browser feature that is only supported in 2 of the 4 major browsers.  Perhaps in a year, Firefox and IE will have caught up.  Until then, you’ll need to download Chrome or if you are on a Mac, fire up Safari to play an infinite version of your favorite song.

The Web Audio API  is an extremely powerful API and I suspect will be a big part of music on the web for the next decade. If you write music apps, you should pay attention to it.  Some good places to start are:  HTML5 Audio  and the multimedia section of HTML5 Rocks.

  1. #1 by Brian Utterback on November 22, 2012 - 10:38 am

    Alas, it crashes Safari on my even older iPhone 3gs.

    • #2 by Paul on November 22, 2012 - 10:39 am

      bummer. Does IOS 6 run on an iPhone 3gs? Time for a new phone I think. — P

      • #3 by Brian Utterback on November 22, 2012 - 10:43 am

        Yep, it’s running IOS 6. Afraid it’s going to be awhile before I get a new phone though.

  2. #4 by Jory Prum on November 22, 2012 - 2:36 pm

    Thanks for the shout-out, Paul!