XSPF Examples in the wild

From XiphWiki
Jump to navigation Jump to search

This page contains examples of XSPF as found in the wild on playlisting websites and services. Please keep new examples in alphabetical order when adding them, so we can cut down on duplicates. Please use code and pre tags around your examples to avoid nasty surprises in less-capable browsers.

ccMixter

Example XSPF:

  <?xml version="1.0" encoding="UTF-8"?>
  <playlist xmlns="http://xspf.org/ns/0/" version="1">
    <title>ccMixter</title>
    <creator>http://ccmixter.org/</creator>
    <annotation>Download, Sample, Cut-up, Share.</annotation>
    <info>Download, Sample, Cut-up, Share.</info>
    <location>http://ccmixter.org/media/api/query?f=xspf</location>
    <date>Sat, 05 May 2007 14:04:44 CDT</date>
    <trackList>
      <track>
        <location>http://ccmixter.org/people/FFGreen/FFGreen_-_Baltimore_Dreaming_(FF_remix).mp3</location>
        <identifier>10165</identifier>
        <title>Baltimore Dreaming (FF remix)</title>
        <creator>FFGreen</creator>
        <duration>2976018</duration>
        <meta rel="http://creativecommons.org/licenses/by-nc/2.5/">http://creativecommons.org/licenses/by-nc/2.5/</meta>
        <image>http://ccmixter.org/avatars/FF-old-ccmixterpic.jpg</image>
      </track>
    </trackList>
  </playlist>


Commentary:

There is not yet consensus on how to markup Creative Commons licensed music in XSPF. There was a proposal to use http://xspf.org/rel/license/v1 as rel attribute for the link tag when the link url specifies a license document. The ccMixter XSPF predates that proposal and uses the meta tag rather then the rel tag. The confusion on this issue is holding back license-aware user agents and aggregators.


SeeqPod

See the SeeqPod documentation here.

Example XSPF:

  <?xml version='1.0' encoding='UTF-8' ?>
  <playlist version="1" xmlns="http://xspf.org/ns/0/" start="0" end="0" 
    total="26" prev="None" next="1">
  <title></title>
  <trackList>
    <track>
    <location>http://joniverse.com/resources/music/u2-one.mp3</location>
    <title>One</title>
    <creator>U2</creator>
    <extension application="seeqpod_metadata">
      <mp3_url_id>19646033</mp3_url_id>
      <has_music_rex>True</has_music_rex>
      <song_id>39445</song_id>
    </extension>
    </track>
  </trackList>
  </playlist>


Commentary (from Lucas on the Playlist mailing list):

First off, let's move the attributes in the root element to a namespace:

  <playlist version="1" xmlns="http://xspf.org/ns/0/"
  xmlns:pg="http://xspf.org/ns/pagination"
  pg:start="0" pg:end="0" pg:total="26" pg:prev="None" pg:next="1" />


(I don't know what all those values are, by the way. But I do think it would be great to do a pagination API, maybe based on Mark Nottingham's feed history RFC for Atom, and I am confident that this belongs in a namespace.)

Second, let's move that song_id up a level, so that other apps can use it too:

    <track>
    <location>http://joniverse.com/resources/music/u2-one.mp3</location>
    <title>One</title>
    <creator>U2</creator>
    <identifier>http://seeqpod.com/song_id/39445<identifier>
    <extension application="seeqpod_metadata">
      <mp3_url_id>19646033</mp3_url_id>
      <has_music_rex>True</has_music_rex>
    </extension>
    </track>

About the construction of the extension element here, I'm really happy to see somebody using that element well. Given how unclear the spec is on the topic it's rare to see that. You might argue that this stuff needs to be namespaced, but I honestly don't know if that's true. I would just say that anything within an extension element is not XSPF.

The one correction I'd make to this extension element is to change the "application" attribute to a URI:

  <extension application="http://seeqpod.com/seeqpod_metadata">