[Kde-silk] [Draft] Video Providers DataEngine

Alessandro Diaferia alediaferia at gmail.com
Sun Oct 11 12:53:26 CEST 2009


As usual i forgot to forward the message :/ Sorry for it..

---------- Forwarded message ----------
From: Alessandro Diaferia <alediaferia at gmail.com>
Date: 2009/10/10
Subject: Re: [Kde-silk] [Draft] Video Providers DataEngine
To: Sebastian Kügler <sebas at kde.org>




2009/10/9 Sebastian Kügler <sebas at kde.org>

> Hi,
>
> On Friday 09 October 2009 17:14:41 Alessandro Diaferia wrote:
> > 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.
>
> Cool, that sounds like nice progress :)
>
> > 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 :).
>
> Hm, this would make the query specific per provider, something we don't
> want. Can we
> abstract this maybe? I'd imagine that a keyword field is useful anyway, and
> for those
> providers where it's not supported, we could add it to the query term. Or
> just leave
> it (depends on testing).
>

See the end of my reply for the answer to this.


>
> > 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.
>
> I think knowing it makes sense, for example to show "Searching youtube,
> vimeo, blip,
> ..."
>
> > 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.
>
> Nevertheless good to have a unique id for purposes of handling the data
> inside the
> applets...
>
> >  -   *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.
>
> QImage or QPixmap? Depends if we want the user to do the
> downloading/conversion. It
> might makes more sense to do that in the dataengine, we could also cache it
> there.
>

This sounds straightforward to me, i'd try implementing the downloading and
conversion to QPixmap in order to also make use of KPixmapCache. This will
take care of keeping the pixmap as long as the source stays available i
suppose.


>
> >  -   *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.
>
> * *FullUrl*: website to visit to view the video (the url on youtube for
> embedded
> videos, for example)
>
embeddedHTML provides the HTML code for embedding the video. Would FullUrl
give the url to the video provider site itself?


> * other formats: Blip.tv for example offers also other formats, at least
> the one
> you've uploaded the video in (and it accepts .ogv). It would be a shame if
> we didn't
> offer that (since obviously showing the video in a native client is more
> silky than
> embedding a Flash plugin in a webview in a widget).
>

This of course  should go in. Would it be in the form of a {Q,K}Url to the
file?

>
> More, more or less random ideas:
>
> * Classification? Under 18, above 21, suitable all ages, we are actively
> supporting
> porn applet writers, no? (The Internet is for ... look that up in the
> engine :D)
> * Popularity
> * Rating
> * Feed (some shows have the concept of shows, with episodes, maybe next /
> previous
> would also make sense)
>

+1

> This is what i achieved so far but suggestions for eventual additions to
> > this list are also welcome.
>
> One question came to mind: the engine searches different providers, right?
> So a
> search for "KDE" will show video hits from all providers, not just one?
>

As from what you pointed out at the beginning of the reply the engine should
be less specific as possible. So if i remove the provider specification from
the query the engine should be supposed to return results from every
provider. An option might be allowing also per-provider queries. Those would
start with the provider specification. Ideas?


>
> > 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 :)
>
> I'll give it a try later tonight, on a train right now :)
>

Nice :)

> --
> sebas
>
> http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
>
> _______________________________________________
> Kde-silk mailing list
> Kde-silk at kde.org
> https://mail.kde.org/mailman/listinfo/kde-silk
>
>


-- 
Alessandro Diaferia
KDE Developer



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


More information about the Kde-silk mailing list