Site hosted by Build your free website today!

Instructions : extendedReporting Engine

All our playheads include the Draftlight extendedReporting engine. If developers try to debug the playhead via the Flash IDE, they can hit problems with access to the configuration files and media due to the security sandbox. If you don't have the Flash IDE you still want to be able to watch the playhead in action, so you can work out what's causing problems with your configuration. Normally in Flash this would be impossible, however our playheads report all their actions and errors via the external API, so a detailed log of progress can be collected by JavaScript as the playhead runs live on your server, or locally from a file on your computer. There's no need to change the SWF file in any way.

The DEBUG EXAMPLE webpage supplied with your software includes the script sections for extendedReporting. To add the display to your own webpage you just need to add the following JavaScript to your page's HEAD section:-

<script language="JavaScript"> <!-- function xtrace(_st) { document.traceForm.text.value += _st + '\n'; } // --> </script>

Then, somewhere out of the way on your page, add a textarea like this:-

<form name="traceForm" method="get" action=""> <textarea name="text" rows="15" cols="80"></textarea></form>

Now you can see exactly what's going on, or what's going wrong! Remember to remove the above code before letting your visitors loose on your page - it's not a security risk, but it may confuse them to see all the strange messages.

extendedReporting codes

Each message sent from the playhead starts with a three-digit numeric code. It allows your JavaScript to read the messages and take action based on them - for example if the playhead reports the name of a track, your JavaScript can load an image or some information about that artist. If the playhead stops due to an error, you could even redirect your visitors to another page.

For example, here's a script that will open an 'alert' box if the Now Playing data is missing:-

<script language="JavaScript"> <!-- function xtrace(_st) { if (_st.substring(0,3)=='202') alert('Sorry - I cannot display track information for this stream'); } // --> </script>

Here's the full list of message codes broadcast by your playhead:-

Code numberMessage
100Wakeup and playhead loaded successfully
103Mountpoint definition found in config file
104PLS playlist file definition found in config file
105Info website definition found in config file
106Stream title definition found in config file
107URL for now-playing data found in config file
108Volume has been changed by a program action (not by the UI slider)
109Slot status report (generated during the first 10 secs of audio)
110Shoutcast DNAS-style playlist file loaded from a remote server
111Shoutcast DNAS-style playlist file parsed OK
112JavaScript 'setconfig' function has been called
113JavaScript 'setconfig' and/or 'play' functions have been registered for use
114Config file loaded and parsed OK
120Audio stream is being loaded from the mount URL
121Audio stream has loaded OK
150Reload event in XFade mode has begun
151Reload event in XFade mode has completed OK
201Change in reported song title - message format is 201:SongTitle=xxxxxxx
202The URL for now-playing data is unavailable or the data is bad
501Audio playback has been stopped (a reason will be given in square brackets)
502MP3 stream failed to load (server down or network problems)
503Trying the next entry in the playlist of mounts
504Stream bad format (under 10kb, so probably returned an HTML page instead of an MP3)
505Stream bad format (over 10kb but unplayable - probably a non-MP3 audio file)
506Config file format bad (an XML formatting error or a missing/unreachable URL)

The exact order of the messages posted may vary where several tasks are running simultaneously. It is possible to use a JavaScript/AJAX script to pass messages back to your server, for example to collect error data, but normally they are retained within the browser and used only for initial debugging of your setup. Running important actions based on the extendedReporting messages on a live website may lead to problems if your visitors have JavaScript disabled.