Thursday, February 07, 2008

Create an XSPF Playlist - XML Playlist Generator

This script was long overdue for an update. The new version includes added functionality and several bug fixes. The two biggest changes are:
  • The output file is now encoded in UTF-8.
  • The playlist now processes all filetypes supported by Jeroen Wijering's FLV Media Player. You can add/remove filetypes by editing the script (see Release Notes for more information).

The script can be tailored for use with any XSPF-capable player. I recommended using the popular (and free!) FLV Media Player by Jeroen Wijering.

Here's the new script, followed by instructions on its use:

http://www.iol.ie/~craigcharlie/files/XSPF_Playlister.vbs


Instructions:

  1. Move the .vbs file into the directory that contains the folder you want to playlist. This is necessary to preserve the relative paths that the player requires.
  2. Drag n' drop the folder onto the .vbs file, and it will output a playlist.xml file in the same directory as the script.
  3. If you're using FLV Media Player, perform the following additional steps:

  4. Copy the playlisted folder and the playlist.xml file into the folder containing mediaplayer.swf
  5. Edit the html file that references mediaplayer.swf, changing the value of the "file" variable to "playlist.xml".
  6. That's it! The next time you open the player, it will include your playlisted files, including a Google search link for each file name.



Release Notes

New Functionality

  • Playlister now includes all filetypes supported by Jeroen's player. The following are currently included: "flv","mp3","h264","swf","jpg","png","gif". You can add or remove filetypes by editing the values in the sExtToGetArr variable.
  • Randomizer functionality added. Search for "Randomizer" and uncomment that section if you'd prefer a random song order.

Bug Fixes

  • Playlist.xml is now saved in UTF-8. The old version saved in Unicode, and didn't work unless the file was edited and resaved in UTF-8 format.
  • Removed underscore characters in the popup message that caused the script to fail on XP SP2.
  • Removed uppercase method for the filename location. The title is still uppercased as the sort function needs this to work correctly.
  • Removed "./" from before filename location; this relative path was read incorrectly on some servers.
  • Changed "annotation" tag to "title" tag, as this is the correct tag for track names (and is now expected by Jeroen's player).

Labels: , ,