Re: Favorites functionality



Hello Roland,

El 2012-02-03 07:35, Roland Peffer escribió:
Hi,

I am just thinking how to implement a Favorites functionality in my
grilo based media application.
Is there already such functionality within the existing plugins. Or
do I have to build a new one?

If I remember correctly, there is a bookmarks plugin that you can use for that purpose. Actually, I wrote a plugin for Totem that used this to implement the favourites functionality, you can even see a screencast of how it worked here (skip to 1:10 for the relevant part).

http://people.igalia.com/itoral/totem-grilo.ogv

The bookmarks plugin allows you to create categories and media objects, so you can use APIs like grl_media_source_store and grl_media_source_remove to manipulate its contents. The way I used it was very trivial, I simply obtained GRL_METADATA_KEY_URL from the media I wanted to bookmark as favourite, and then used grl_media_source_store to push a new media element to my bookmarks plugin, passing that URL information (you can of course copy more metadata but I think the bookmarks plugin only supports a reduced subset of the metadata supported by grilo).

Of course all this was a long time ago and some of the APIs involved may have changed a bit since then. Anyway, here is the source code of that plugin for your reference, I think it should e easy to replicate using current APIS:

http://gitorious.org/itoral-totem-grilo/totem-grilo/blobs/master/plugin/totem-grilo.c

Maybe some other Grilo dev can give more up-to-date references :)

Hope this helps.

Iago


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]