[Kde-silk] [Draft] Video Providers DataEngine

Alessandro Diaferia alediaferia at gmail.com
Fri Oct 9 17:14:41 CEST 2009


Hello dear silky people :)
I've thrown some code into the MediaCenter land and now it is possible to
create simple video providers plugin for the video dataengine.
The video dataengine is supposed to provide an high level query "api" to
retrieve video pieces of information from webservices like blip, vimeo,
youtube and so on.

The little-but-working api i've just started implementing works as follows:

A Plasma::DataEngine called "video" accepts queries in the following form:

[1] "videoservice:searchTerm&constaint1=value1&constraint2=value2.."

where &constraints are optional (and currently not handled). Constraints are
supposed to give filtering options when doing a query so that one can query
the service with statements like:
"I want a video of a Queen group's performance with the keywords "wembley"
and "stadium", searched from YouTune". This would become
"youtube:queen&keywords=wembley,stadium" and should work as expected :).

The second possible type of query is more of internal purposes and is simply
"providers". This query returns the available plugins installed that provide
the service to the video dataengine.

As already discussed with Marco on irc there was the need to keep the
relation query <-> result in addition to also add new data sources to the
dataengine. As from what we agreed the dataengine now works this way:

after the query a source is created named like searchTerm from [1]. This
source will have the list of found videos ids as value.
In addition to this a source for each video id will be created. The name for
each source will be the video id (as expected). The following values will
then be provided for each video:

 -   *QString id*: this is probably redundant.
 -   *QString title*: the title of the video, no further explanation needed.
 -   *QString description*: the description of the video as well.
 -   *QString thumbnail*: an url to the thumbnail of the video. I decided to
keep this as QString but suggestions are welcome of course.
 -   *QStringList keywords*: the eventual list of keywords for this video.
 -   *QString author*: the author of the video aka the one who published the
video.
 -  * uint duration*: the duration of course.
 -   *QString category*: the eventual category of the video.
 -   *QString embeddedHTML*: and this is probably the most interesting: the
HTML code provided to embed the video in any web page. Since few video
providers (probably only blip) give the chance to retrieve the real video
file this is a sort of hack to retrieve the video and put it anywhere. Of
course this would be accomplished using a QWebView to reproduce the video
setting its html code to this one provided. Of course suggestions about this
are really really appreciated.

This is what i achieved so far but suggestions for eventual additions to
this list are also welcome.

The code is in the KDE's svn, exactly under
trunk/playground/base/plasma/MediaCenterComponents
the video dataengine is under dataengines/video. In this folder you'll also
find the videoprovider/ folder which hosts the plugin abstract class. The
YouTube plugin is instead hosted under
MediaCenterComponents/videoproviders/youtube.

Have a try and let me know :)

Cheers devs :p

-- 
Alessandro Diaferia
KDE Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-silk/attachments/20091009/8f8e7301/attachment.htm 


More information about the Kde-silk mailing list