You are here: Home » Reply

Reply To: FireSpiff – Export XML playlist (XSPF)




I have managed to get this working with a bit of XSL and PHP on my local WAMP server to transform the results of an RSP query on playlist 1. I know very little about coding so this is a real lashup (which you can probably tell from my code) so feel free to try and ask questions however I may not be able to provide much support. In fact any suggestions or improvements would be very welcome.

The XSPF works in both VLC and Foobar2000 (with the foo_xspf component). Unfortunately Foo doesnt seem to like playing streamed wavs from Firefly which is a bit of a limitation for those of use who stuff that Firefly has to transcode. VLC works fine but has limited navigation.

Put the following in an file called “rsp2xspf.xsl”. You will need to replace the Firefly server address and port.

Put this in a file called “playlist.php”. You will need to change the port.

header('Content-type: application/xspf+xml');
header('Content-Disposition: attachment; filename="playlist.xspf"');
$dom = new domDocument();
$proc = new xsltprocessor;
$xsl = $proc->importStylesheet($dom);

$document = new DomDocument();
print $proc->transformToXml($document);

Put both files in a folder on your web server.

Run the php file from your browser. It should churn for a few mins then ask you to download an XSPF. Open the XSPF in VLC or Foobar2000 and play away.

Its not fast but seems to work.