=?UTF-8?Q?media=5Ffrom=5Fsite=20API?=




Hi all,

we got a feature request to add the possibility of querying a source to provide the media representing a certain web url, for example, the GrlMEdia representing this media:
http://www.youtube.com/watch?v=UMCGeP-LVKs

Use case would be any app that deals with web content, could be a web browser or a plugin for a web browser for example. When it is playing back media from a site supported in grilo (like Youtube), it could use this feature to get a GrlMedia object from that web uri, and then use that GrlMedia to do fancy stuff, like for example, in the case of the web browser, opening the media in an external media player.

Although the requester is already using another library to get this done, I think the feature makes sense in Grilo and would interesting to have support for that in the framework.

I have attached patches implementing this in the bug report and would be nice to have some feedback, for the lazy ones here goes a description of what the patches add:

* grl_multiple_get_media_from_site

Goes through all available sources that support GRL_MEDIA_FROM_SITE_OP, then tests which one supports the web url passed in as parameter using grl_media_source_test_media_from_site() and, if a match is found, invokes grl_media_source_get_media_from_site() to resolve the media asynchronously.

* grl_media_source_test_media_from_site

It is intended to be a fast, synchronous way to check if a certain source supports a specific url.

* grl_media_source_get_media_from_site

It is intended to instruct a specific source to try and create a GrlMedia object from a given web url. This is asynchronous and will use network I/O to create the GrlMedia object, which will be handed to the client in a callback, just in the same way the grl_media_source_metadata callback works.

* A patch for grilo-plugins adding implementation for this feature in the Youtube source.

I tested this with a hack in grilo-test-ui to enable the feature, I could add proper support for testing this in the test-ui later on if the patch looks good to go forward.

Iago



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