As usual i forgot to forward the message :/ Sorry for it..<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Alessandro Diaferia</b> <span dir="ltr">&lt;<a href="mailto:alediaferia@gmail.com">alediaferia@gmail.com</a>&gt;</span><br>
Date: 2009/10/10<br>Subject: Re: [Kde-silk] [Draft] Video Providers DataEngine<br>To: Sebastian Kügler &lt;<a href="mailto:sebas@kde.org">sebas@kde.org</a>&gt;<br><br><br><br><br><div class="gmail_quote">2009/10/9 Sebastian Kügler <span dir="ltr">&lt;<a href="mailto:sebas@kde.org" target="_blank">sebas@kde.org</a>&gt;</span><div class="im">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<div><br>
On Friday 09 October 2009 17:14:41 Alessandro Diaferia wrote:<br>
&gt; Hello dear silky people :)<br>
&gt; I&#39;ve thrown some code into the MediaCenter land and now it is possible to<br>
&gt; create simple video providers plugin for the video dataengine.<br>
&gt; The video dataengine is supposed to provide an high level query &quot;api&quot; to<br>
&gt; retrieve video pieces of information from webservices like blip, vimeo,<br>
&gt; youtube and so on.<br>
<br>
</div>Cool, that sounds like nice progress :)<br>
<div><br>
&gt; The little-but-working api i&#39;ve just started implementing works as follows:<br>
&gt;<br>
&gt; A Plasma::DataEngine called &quot;video&quot; accepts queries in the following form:<br>
&gt;<br>
&gt; [1] &quot;videoservice:searchTerm&amp;constaint1=value1&amp;constraint2=value2..&quot;<br>
&gt;<br>
&gt; where &amp;constraints are optional (and currently not handled). Constraints<br>
&gt;  are supposed to give filtering options when doing a query so that one can<br>
&gt;  query the service with statements like:<br>
&gt; &quot;I want a video of a Queen group&#39;s performance with the keywords &quot;wembley&quot;<br>
&gt; and &quot;stadium&quot;, searched from YouTune&quot;. This would become<br>
&gt; &quot;youtube:queen&amp;keywords=wembley,stadium&quot; and should work as expected :).<br>
<br>
</div>Hm, this would make the query specific per provider, something we don&#39;t want. Can we<br>
abstract this maybe? I&#39;d imagine that a keyword field is useful anyway, and for those<br>
providers where it&#39;s not supported, we could add it to the query term. Or just leave<br>
it (depends on testing).<br></blockquote></div><div><br>See the end of my reply for the answer to this.<br> <br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div><br>
&gt; The second possible type of query is more of internal purposes and is<br>
&gt;  simply &quot;providers&quot;. This query returns the available plugins installed<br>
&gt;  that provide the service to the video dataengine.<br>
<br>
</div>I think knowing it makes sense, for example to show &quot;Searching youtube, vimeo, blip,<br>
...&quot;<br>
<div><br>
&gt; As already discussed with Marco on irc there was the need to keep the<br>
&gt; relation query &lt;-&gt; result in addition to also add new data sources to the<br>
&gt; dataengine. As from what we agreed the dataengine now works this way:<br>
&gt;<br>
&gt; after the query a source is created named like searchTerm from [1]. This<br>
&gt; source will have the list of found videos ids as value.<br>
&gt; In addition to this a source for each video id will be created. The name<br>
&gt;  for each source will be the video id (as expected). The following values<br>
&gt;  will then be provided for each video:<br>
&gt;<br>
&gt;  -   *QString id*: this is probably redundant.<br>
<br>
</div>Nevertheless good to have a unique id for purposes of handling the data inside the<br>
applets...<br>
<br>
&gt;  -   *QString title*: the title of the video, no further explanation<br>
<div>&gt;  needed. -   *QString description*: the description of the video as well.<br>
&gt;  -   *QString thumbnail*: an url to the thumbnail of the video. I decided<br>
&gt;  to keep this as QString but suggestions are welcome of course.<br>
<br>
</div>QImage or QPixmap? Depends if we want the user to do the downloading/conversion. It<br>
might makes more sense to do that in the dataengine, we could also cache it there.<br></blockquote><div> </div></div><div>This sounds straightforward to me, i&#39;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.<br>

 <br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
&gt;  -   *QStringList keywords*: the eventual list of keywords for this video.<br>
<div>&gt;  -   *QString author*: the author of the video aka the one who published<br>
&gt;  the video.<br>
&gt;  -  * uint duration*: the duration of course.<br>
&gt;  -   *QString category*: the eventual category of the video.<br>
&gt;  -   *QString embeddedHTML*: and this is probably the most interesting: the<br>
&gt; HTML code provided to embed the video in any web page. Since few video<br>
&gt; providers (probably only blip) give the chance to retrieve the real video<br>
&gt; file this is a sort of hack to retrieve the video and put it anywhere. Of<br>
&gt; course this would be accomplished using a QWebView to reproduce the video<br>
&gt; setting its html code to this one provided. Of course suggestions about<br>
&gt;  this are really really appreciated.<br>
<br>
</div>* *FullUrl*: website to visit to view the video (the url on youtube for embedded<br>
videos, for example)<br></blockquote></div><div>embeddedHTML provides the HTML code for embedding the video. Would FullUrl give the url to the video provider site itself?<br> <br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


* other formats: Blip.tv for example offers also other formats, at least the one<br>
you&#39;ve uploaded the video in (and it accepts .ogv). It would be a shame if we didn&#39;t<br>
offer that (since obviously showing the video in a native client is more silky than<br>
embedding a Flash plugin in a webview in a widget).<br></blockquote><div> </div></div><div>This of course  should go in. Would it be in the form of a {Q,K}Url to the file?<br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<br>
More, more or less random ideas:<br>
<br>
* Classification? Under 18, above 21, suitable all ages, we are actively supporting<br>
porn applet writers, no? (The Internet is for ... look that up in the engine :D)<br>
* Popularity<br>
* Rating<br>
* Feed (some shows have the concept of shows, with episodes, maybe next / previous<br>
would also make sense)<br></blockquote></div><div><br>+1<br><br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>&gt; This is what i achieved so far but suggestions for eventual additions to<br>
&gt; this list are also welcome.<br>
<br>
</div>One question came to mind: the engine searches different providers, right? So a<br>
search for &quot;KDE&quot; will show video hits from all providers, not just one?<br></blockquote></div><div><br>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?<br>

 <br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br>
&gt; The code is in the KDE&#39;s svn, exactly under<br>
&gt; trunk/playground/base/plasma/MediaCenterComponents<br>
&gt; the video dataengine is under dataengines/video. In this folder you&#39;ll also<br>
&gt; find the videoprovider/ folder which hosts the plugin abstract class. The<br>
&gt; YouTube plugin is instead hosted under<br>
&gt; MediaCenterComponents/videoproviders/youtube.<br>
&gt;<br>
&gt; Have a try and let me know :)<br>
<br>
</div>I&#39;ll give it a try later tonight, on a train right now :)<br></blockquote><div> </div></div><div>Nice :) <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<font color="#888888">--<div class="im"><br>
sebas<br>
<br>
<a href="http://www.kde.org" target="_blank">http://www.kde.org</a> | <a href="http://vizZzion.org" target="_blank">http://vizZzion.org</a> | GPG Key ID: 9119 0EF9<br>
</div></font><br>_______________________________________________<br>
Kde-silk mailing list<br>
<a href="mailto:Kde-silk@kde.org" target="_blank">Kde-silk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-silk" target="_blank">https://mail.kde.org/mailman/listinfo/kde-silk</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Alessandro Diaferia<br>KDE Developer<br>
</font></div><br><br clear="all"><br>-- <br>Alessandro Diaferia<br>KDE Developer<br>