[vlc-devel] [PATCH] Adding metadata support to web-plugin

Niles Bindel zaggal69 at gmail.com
Wed Sep 9 17:38:25 CEST 2009


Jean-Baptiste,

After reading your comments, I think my comments using the media_t*
references may have confused what I was trying to say.
What I'm proposing a new Media object for Javascript.  That would
allow for direct access to information related to the Media object
(such as the meta data).  The Media object would essentially be a
wrapper of a media_t structure to allow access to its data members.

For example, here are a few different ways to play an item with my
envisioned changes:

     var mediaItem = vlc.media.create(mrl, options);
     var artist = mediaItem.getMetaData("Artist");

     vlc.playlist.playItem(mediaItem);

or with the addition of playlist iterators:

     var playlistIterator = vlc.playlist.add(mediaItem);
     vlc.playlist.play();

and

     vlc.playlist.playItem(playlistIterator.getMediaItem());


For the time being, the iterator changes would not be necessary.  We
could leave the indexes in place and query the playlist.items for the
media item.

    var mediaItem = vlc.playlist.items.atIndex(index);
    vlc.playlist.playItem(mediaItem);

With the exception of using iterators for playlist traversal, I
believe all of these changes could be made without altering LibVLC.  I
hope the above illustrates how this decoupling of the media items from
the playlist will allow you to create your own playlists in javascript
without having to deal with invalid indexes and also allow for direct
access to the meta data.  Additionally, there could be new "helper"
functions added to retrieve the currently playing media item and to
check whether an index was currently valid.

Regards,

Niles



More information about the vlc-devel mailing list