The XSPF Playlist Format, version 0

This document describes a playlist format named "XSPF", which stands for "XML Shareable Playlist Format". "XSPF" can be pronounced "spiff" or maybe "spliff."

This is an informal document not associated with any standards body. It is intended to be clear and readable rather than conformant with existing standards for such documents.

This is the fourth draft of this document. It is a major rewrite, and there are a number of areas where the result is rough. This document assumes that your browser supports CSS reasonably well; versions of Internet Explorer older than version 6 don't. Items marked like [[fixme: this]] are markers for work yet to be done. See the todo list for more details about this document.

The home of our working group is http://xspf.org. On IRC, we use #playlist on irc.freenode.net. There are perhaps six regular contributors, with another six commenting from time to time. Contributors came from two major audio software vendors, a major weblog aggregator, the W3C, and two significant .org sites related to music. We worked in the skunkworks style and were not sponsored by any organization or standards body. Our purpose was to engineer a high-quality design rather than to create normative requirements for interoperability.

This document is maintained by Lucas Gonze.

Creation date of this document is Sunday, May 9, 2004. The most recent edit is July 11, 2004.

Table of Contents

    1. Abstract
    2. Publication status and authorship
    3. Introduction
    4. Example
    5. Element definitions
      1. xml
        1. version
        2. encoding
        1. playlist
          1. xmlns
          2. version
          1. title
          2. annotation
          3. creator
          4. info
          5. location
          6. identifier
          7. image
          8. date
          9. license
          10. attribution
          11. link
            1. rel
          12. meta
            1. rel
          13. trackList
            1. track
              1. location
              2. identifier
              3. info
              4. image
              5. annotation
              6. creator
              7. title
              8. album
              9. trackNum
              10. duration
              11. link
                1. rel
              12. meta
                1. rel
    1. Recipes
      1. How do I set relative paths in an XSPF playlist, for example if I want to use it as a file manifest?
      2. How to I convert XSPF to M3U?
      3. How to I convert XSPF to HTML?
      4. How to I convert XSPF to SMIL?
      5. How to I convert XSPF to Soundblox?
    1. Design and architecture
      1. Usecases
      2. Requirements
      3. Features
      4. Principles
        1. Catalogs vs. [[fixme: ??]]
        2. Fuzzy names
        3. Content resolvers
    1. Administrative
      1. Todo list
      2. Validate

The genesis of this project came from the mutual recognition that the quality of playlist formats fell far below the normal standard for hypertext document types like HTML, RDF and Atom. Our goals were to create a playlist format that is all three of:

  1. Open -- existing formats are either ad-hoc standards with no owner, like M3U, or proprietary, like ASX.
  2. Portable -- you should be able to send a playlist sans content to your friend, or open the same playlist with different software on the same machine, and have it be usable. Existing formats lack a number of features needed to make this work well.
  3. Well made -- there is a glaring lack of craftsmanship to existing formats. For example, no dominant playlist format declares a namespace. And while there are independent efforts to write a format with a high level of craftsmanship, the Gnomoradio format for example, writing data formats is too hard to succeed without a team.

Over the course of our work we also realized that the format had to scale down well. The dominant playlist format is M3U, which is just a flat listing of song paths, and many developers are satisfied enough to stick with it. SMIL is all three of open, portable and well made, but is too complex for many needs; simple SMIL playlists are not simple to implement. Similarly, RDF offered well made solutions to many problems we faced, but RDF tools are never trivial (as of this writing). We went to great lengths to make trivial playlists trivial to implement.

A very simple document looks like this:

<?xml version="1.0" encoding="UTF-8"?> <playlist version="0" xmlns = "http://xspf.org/ns/0/"> <trackList> <track><location>file:///mp3s/Yo+La+Tengo/And+Then+Nothing+Turned+Itself+Inside-Out</location></track> <track><location>file:///mp3s/Yo+La+Tengo/Genius+%2B+Love+%3D+Yo+La+Tengo+%28Disc+2%29</location></track> <track><location>file:///mp3s/Yo+La+Tengo/I+Can+Hear+The+Heart+Beating+As+One</location></track> <track><location>file:///mp3s/Yo+La+Tengo/Nuclear+War</location></track> <track><location>file:///mp3s/Yo+La+Tengo/Summer+Sun</location></track> </trackList> </playlist>

1.0
utf-8
http://xspf.org/ns/0/
0
A human-readable title for the playlist. xspf:playlist elements MAY contain exactly one.
A human-readable comment on the playlist in text/plain format. xspf:playlist elements MAY contain exactly one.
Human-readable name of the entity (author, authors, group, company, etc) that authored the playlist. xspf:playlist elements MAY contain exactly one.
URI of a web page to find out more about this playlist. Likely to be homepage of the author, and would be used to find out more about the author and to find more playlists by the author. xspf:playlist elements MAY contain exactly one.
Source URI for this playlist. xspf:playlist elements MAY contain zero or more location elements.
Canonical ID for this playlist. Likely to be a hash or other location-independent name. MUST be a legal URI. xspf:playlist elements MAY contain zero or more identifier elements.
URI of an image to display in the absence of a //playlist/trackList/image element. xspf:playlist elements MAY contain exactly one.
ISO8601 creation date (not last-modified date) of the playlist. xspf:playlist elements MAY contain exactly one.
URI of a resource that describes the license under which this playlist was released.

An ordered list of URIs. The purpose is to satisfy licenses allowing modification but requiring attribution. If you modify such a playlist, move its //playlist/location element or //playlist/identifier to the top of the items in the //playlist/attribution element. xspf:playlist elements MAY contain exactly one xspf:attribution element.

<attribution> <location>http://snafu.com/modified_version_of_modified_version_of_original_playlist.xspf</location> <location>http://bar.com/modified_version_of_original_playlist.xspf</location> <location>http://foo.com/original_playlist.xspf</location> </attribution>

The link element allows non-XSPF web resources to be included in XSPF documents without breaking XSPF validation.

<link rel="http://foaf.org/namespace/version1">http://socialnetwork.org/foaf/mary.rdfs</link>

URI of a resource type.

URI of a resource.

The meta element allows non-XSPF metadata to be included in XSPF documents without breaking XSPF validation.

<meta rel="http://example.org/key">value</meta>

URI of a resource defining the metadata.

Value of the metadata element. MUST be valid text/plain, not XML.

Ordered list of xspf:track elements to be rendered. xspf:track elements MUST be rendered in the order in which they appear, from top to bottom, unless a different ordering is otherwise indicated. If an xspf:track element cannot be rendered, a user-agent MUST skip to the next xspf:track element and MUST NOT interrupt the sequence.

URI of resource to be rendered. Probably an audio resource, but MAY be any type of resource with a well-known duration, such as video, a SMIL document, or an XSPF document. The duration of the resource defined in this element defines the duration of rendering. xspf:track elements MAY contain zero or more location elements, but a user-agent MUST NOT render more than one of the named resources.
Canonical ID for this resource. Likely to be a hash or other location-independent name, such as a MusicBrainz identifier or isbn URN (if there existed isbn numbers for audio). MUST be a legal URI. xspf:playlist elements MAY contain zero or more identifier elements.
URI of a place where this resource can be bought or more info can be found.
URI of an image to display for the duration of the track. xspf:track elements MAY contain exactly one.
A human-readable comment on the track in text/plain format. xspf:track elements MAY contain exactly one.
Human-readable name of the entity (author, authors, group, company, etc) that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it. xspf:track elements MAY contain exactly one.
Human-readable name of the track that authored the resource which defines the duration of track rendering. This value is primarily for fuzzy lookups, though a user-agent may display it. xspf:track elements MAY contain exactly one.
Human-readable name of the collection from which the resource which defines the duration of track rendering comes. For a song originally published as a part of a CD or LP, this would be the title of the original release. This value is primarily for fuzzy lookups, though a user-agent may display it. xspf:track elements MAY contain exactly one.
Integer with value greater than zero giving the ordinal position of the media on the xspf:album. This value is primarily for fuzzy lookups, though a user-agent may display it. xspf:track elements MAY contain exactly one.
Number giving the length of the media. This value is primarily for fuzzy lookups, though a user-agent may display it. A user-agent MUST NOT use this value to determine the rendering duration, since the data will likely be low quality. The exact format of this value is still under discussion. xspf:track elements MAY contain exactly one.

The link element allows non-XSPF web resources to be included in xspf:track elements without breaking XSPF validation.

<link rel="http://foaf.org/namespace/version1">http://socialnetwork.org/foaf/mary.rdfs</link>

URI of a resource type.

URI of a resource.

The meta element allows non-XSPF metadata to be included in xspf:track elements without breaking XSPF validation.

<meta rel="http://example.org/key">value</meta>

URI of a resource defining the metadata.

Value of the metadata element. MUST be valid text/plain, not XML.

?

See the XML Base specification or IETF RFC 2396:

The rules for determining the base URI can be summarized as follows (highest priority to lowest):
  1. The base URI is embedded in the document's content.
  2. The base URI is that of the encapsulating entity (message, document, or none).
  3. The base URI is the URI used to retrieve the entity.
  4. The base URI is defined by the context of the application.
?
Use the xspf2m3u.xsl stylesheet.
?
Use the xspf2html.xsl stylesheet.
?
Use the xspf2smil.xsl stylesheet.
?
Use the xspf2sblx.xsl stylesheet.
[[fixme: clean up and incorporate the requirements list from the wiki]]
Catalogs vs. [[fixme: ??]]
  1. Architectural notes on fuzzy search, catalogs, and content resolvers.
  2. Bug and issue list for XSPF.
  3. Contact address for bugs in this document and in XSPF.
  4. Spell check.
  5. Solicit feedback on formatting of this document.
  6. Section to tell developers why they should support XSPF.
  7. Names of WG contributors.
  1. HTML
  2. CSS