Update jPlayer track/listeners on a webpage with jsonp

With version 2.4, IceCast is shipping their own xml2json template. IceCast 2.4 doesn’t yet deal with the CORS issue so if you want to parse the metadata/listener count etc. client-side, you will still need to output JSONP. IceCast 2.4.1 has fixed this.

I recently found myself working on a small web-radio project for some friends, and I stumbled upon some interesting technical “challenges” (to say so).

I wanted a HTML5 Web-Radio Player (I used the excellent jPlayer project, which supports html5’s <audio>in a wide range of browsers, but also has a fall-back to Adobe Flash for older browsers), but I also wanted the current playing track and a listener count on it. I modified a default jPlayer skin to show up the elements I needed, but I was still left with the issue of actually getting the data from the icecast server to my webpage (player).
Continue reading…