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