[vlc-devel] XSPF support in VLC

Sebastian Pipping webmaster at hartwork.org
Fri Oct 12 14:12:44 CEST 2007


Rafaël Carré wrote:
>>> btw, I saw you are an author of URIparser, maybe you can advice me about
>>> URI use in VLC ?
>> Sure, what's the problem?
> 
> URI encoding.
> 
> For example, a ':' in a file: URI must be %encoded, but in a http: URI,
> it can be a port delimiter, so must be kept as it.

Both HTTP and FILE URIs follow the general syntax which only allows
colons to come between host and port part:

   <scheme>://<host>:<scheme>/

The file URI for a path like "/usr/bin" is

   file:///usr/bin

with three slashes and an empty host part. A Windows example could
be "file:///C:/".

What are you trying to do - convert filenames to file URIs?



> Does lipspiff take care of this, doing the right encoding for every URIs ?

You can use uriparser for resolving/escaping/... URIs.
libSpiff returns plain strings.



> Here is what we use atm:
> 
>     <extension application="http://www.videolan.org/vlc">
>         <node title="mp3">
>         <node title="113 - 113 degrés">
>             <item href="0" />
>             <item href="1" />
>             <item href="65" />
>         </node>
>         <node title="ACDC">
>         <node title="Back In Black">
>             <item href="66" />
> .....
> the item href is keyed on the track identifier, so there is no need to
> put extra information in each track

To be honest I don't really get this. Can you point me to a real
life file using this? Maybe that makes me understand.



> should "http://videolan.org/tr/meta/hier_ref/1/" be a .dtd describing
> the extension? (i don't know very well xml...)

My example included three URIs:
* extention.xmlns:vlc
* extention.application
* trackList.track.meta.rel

The first one is pure XML and declares a namespace prefix.
The other two are from XSPF and used as identifiers for the
extensions and meta keys you invent. I chose

   http://videolan.org/tr/meta/hier_ref/1/

here to make the key show that it's
* related to the VLC player ("http://videolan.org")
* related to tracks, not whole playlist ("tr")
* a meta key, not an extension ("meta")
* a reference to a playlist hierarchy item ("hier_ref")
* of version 1 to be distinguishable from future revisions ("1")

Choosing "http://videolan.org/some/text/" is valid XSPF
as well but not as functional.



> :/ I must have seen your name associated with some french text, don't
> know where.
> 
> Entschuldigung :)

No problem. My name is misspelled Sebastien with "e" from time to time.
Maybe that's why. Whatever :-)



Sebastian




More information about the vlc-devel mailing list