Tag Archives: portal

Totem YouTube plugin

Update (2011-08-27): A lot has happened to the Totem YouTube plugin since this blog post. It's been ported to C, extended to do HD videos, trimmed down to no longer do HD, and then moved to Grilo, where it now lives. It can be used in Totem from the Grilo plugin, which provides a unified UI for accessing video websites like YouTube from Totem. For more information on the history of the plugin, see my blog posts about Totem.

YouTube has come to Totem…

…in the form of a plugin I've written which allows you to browse YouTube from the comfort of everyone's favourite movie player. It allows searching for videos, and when you play a video, it displays its related videos.

The feature I'm most proud of though, is the fact that it automatically paginates when you scroll down the search results, loading more results as you go down. With a hint from Patrys in the comments in my blog post on it (and thanks to the other guys who left comments :)), it works by loading results immediately if you scroll 80% or more of the way down the treeview with the mouse or keyboard, or if you let go of the scrollbar handle more than 80% of the way down when moving it with the mouse. Query pages are loaded in a separate thread, and then the results are brought in with an idle function. This isn't quite as lag-free as I'd've wanted, but I can't see much more I can do to improve things.

Anyway, try things out by downloading and compiling SVN Totem, then enabling the "YouTube browser" plugin. You'll need the GData Python library (that's what the YouTube API uses, PyGTK 2.12 and Python 2.5. Before anyone asks, there's no way to sanely support video uploading yet, as Google unfortunately haven't yet exposed a public upload API. :(

Oh, and the cake is a lie.