[Playlist] an alternate xspf over json implementation
Chris Anderson
jchris at mfdz.com
Sun May 13 00:42:50 UTC 2007
Fabricio Zuardi has been using a xspf-ish json document at CCHits,
which you can look at here. The differences between his and the one
we're using for Grabb.it are very slight:
- the whole thing is under a "playlist" node
- the track's media file url is stored as a string under "location",
rather than as an array of strings under "locations"
- similarly, there is an identifier, instead of identifiers
- there is a "license" key for each track, with a url to relevant license.
here is an example:
http://cchits.ning.com/recent/?fmt=json&var=cchitsPlaylist
I'm especially enamored of the license element, because json does not
have the equivalent of attributes on elements, so rel does not work
(although it can be simulated... at the expense of readability).
I'm starting to see some parallels between json and xml: In xml, when
you need to add more content than a particular standard allows, you
can bring in an additional namespace. In json, you can just add
elements that are not specified by the standard. Parsers will ignore
those elements, and players will gracefully degrade the experience, as
long as a bare minimum of information is in the standard elements. I
guess this tends toward "tag soup" / "associative array soup" :) as
accepting this pattern obviates the need for things like XSPFs
extension namespace.
... I'm getting kinda abstract here ... maybe this is better suited to
a javascript / json list.
But you all have a history of well reasoned opinions about standard
formats, so I guess the takehome question is - Is it better to support
the "license" element, despite its absense from the XSPF spec, in
favor of compactness and readability (the json way), or is it better
to stay as close to XSPF v1 as possible?
I guess this question was bound to come up eventually, and it has
practical implications now, as I'd really like to start propagating
Creative Commons info out to the browser on Grabb.it playlists.
JSPF - a JSON serialization of XSPF
vs
JSPF - JSON inspired by XSPF
Thanks for feedback!
--
Chris Anderson
http://jchris.mfdz.com
More information about the Playlist
mailing list