Latest News

Two Tier3+ Datacenters

With Every Amenity

Click here to read more about our data center facilities.

Icecast Embedded AACplus Flash Player with Metadata


If the player won't work for your Icecast server, please rent a compatible Icecast Server. We cannot offer support for 3rd party servers, sorry.

Update: May 5th, 2010 - Song title (metadata) support has been added!

This article describes how to embed a Flash-based player and now-playing metadata on your website to use with your Icecast streams on an Icecast (KH) server.

You can stream mp3, aac, and even aacplus streams directly to an embedded Flash player. Metadata support is provided using Javascript hooks to JWplayer.

Place following code on an HTML page in the location you want the player:

<div id="metadata">
  <
p> <!-- Now Playing shows up here --> </p>
</
div>

<
script type="text/javascript" src="https://www.fastserv.com/player/player.js"></script>
<div id="player"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</ato hear this stream.</div>
<
script type="text/javascript">
    
// SET THE FOLLOWING VARIABLES ACCORDING TO YOUR STREAM
     
var stream 'http://ic1.dread.fastserv.com:80/dreadlockradio_aacp';
     var 
autostart 'true';
    
// DO NOT EDIT ANYTHING BELOW THIS POINT
     
var so = new SWFObject('https://www.fastserv.com/player/player.swf','mpl','470','20','9');
     
so.addParam('allowscriptaccess','always');
     
so.addParam('allowfullscreen','false');
     
so.addVariable('autostart'autostart);
     
so.addVariable('file'stream+'%3Ftype%3D.flv');
     
so.write('player');
</script> 

Notes:

  • This code works ONLY with Fast Serv FLV enabled Icecast servers (Icecast KH). Icecast KH send special headers for Flash players and have the correct crossdomain.xml and frame alignment required by Adobe. This code WILL NOT work with standard Icecast servers or other non-FLV compatible servers.
  • Use only standard sample rates: 11.025, 22.05, or 44.1KHz only. Flash doesn't understand other sample rates.
  • Stream types supported: MP3, AAC, AACplus.
  • Be sure to update stream with a direct url to your stream's Icecast mount. You cannot link to an m3u or pls; it must be a direct stream link without any pls, m3u or other playlist extension. In the case of the previous example code, we're linking the player to http://ic1.dread.fastserv.com:80/dreadlockradio_aacp
  • If you prefer that the player does not auto start, change
    var autostart 'true'
    to
    var autostart 'false'
  • Only edit the stream and autostart variables. Everything else needs to be left alone.
  • You can move the now-playing (metadata) div tag anywhere you want on the page.

Icecast with AACplus Flash Player Demo

Click Play to Start

Get the Flash Player to hear this stream.



Share the Love

Back to Streaming Media