XML Playlists

 

An XML playlist is a text-based file that contains information about each playlist "item".. The Wimpy XML playlist format uses a simple and flexible structure. Refer to the Track Dataset page for details on the information that can be included for each <item>

NOTE: If you're not familiar with XML, click here for a brief introduction to XML.

The Wimpy XML Format is structured as follows:

<playlist>
<item>
<file>example_A.mp3</file>
<title>Song A</title>
<artist>Some Artist</artist>
<image>path/to/image.jpg</image>
</item>
<item>
<file>example_B.mp3</file>
<title>Song B</title>
<artist>Some Other Artist</artist>
<image>path/to/image.jpg</image>
</item>
</playlist>

 

Where a single <playlist> tag defines the playlist document and contains any number of <item> tags.

- playlist
      - item
          - data set
      - item
          - data set
      - item
          - data set
      - item
          - data set
      - item
          - data set

Again, details on what can be included in the data set are explained in detail on the Track Dataset page.

 

 

Loading an XML playlist into the player

To load an external XML playlist file, simply set "data-media" to the URL to the XML file.

<div data-wimpyplayer data-media="path/to/playlist.xml"></div>

 

You can also load XML data directly into the "data-media" option:

<div data-wimpyplayer data-media="<playlist>
<item>
<file>song1.mp3</file>
<title>Song A</title>
<artist>Some Artist</artist>
<image>song1.jpg</image>
</item>
<item>
<file>song2.mp3</file>
<title>Song B</title>
<artist>Some Other Artist</artist>
<image>song2.jpg</image>
</item></playlist>"></div>

 

Or in javascript:

var myPlayer = new wimpyPlayer({
skin:"path/to/skin.tsv",
media:"<playlist> \
<item> \
<file>song1.mp3</file> \
<title>Song A</title> \
<artist>Some Artist</artist> \
<image>song1.jpg</image> \
</item> \
<item> \
<file>song2.mp3</file> \
<title>Song B</title> \
<artist>Some Other Artist</artist> \
<image>song2.jpg</image> \
</item></playlist>"
});

NOTE: Line breaks were added to the XML data above for sanity's sake. Newline's should be removed for testing. Mind your quotes!

NOTE: When embedding raw XML directly into the HTML, do NOT inlcude the <?xml version="1.0"?> prologue. But do include it when your XML is a stand-alone, external file.

See Also

- About XML
- Track Dataset
- Playlists Within Playlists