Cool hack - html5tube

Did I mention I hate flash? I do. It crashes a lot, and is overall a bad thing for the web, in my opinion. But I do enjoy watching videos on the web, and unfortunately, up to this day, flash is what most sites use to show videos. Months ago I read a couple of blog posts with nice hacks to make Firefox able to play youtube videos without using the flash player. Some recent discussions with colleagues at work got me itching to try my hand at something similar for Epiphany.

HTML5Tube working

So I went ahead, and wrote a new extension that does just that - in youtube video pages, it finds the flash player element, and replaces it with an HTML5 video tag pointing to the actual movie file. This causes the internal HTML5 media player built into WebKitGTK+, that is based on GStreamer, to play the movie. That means you only need to have the necessary GStreamer magic, and the extension enabled, to enjoy the movie.

There are some caveats - in-video text messages are gone (though I’m pretty sure we could get them added somehow), playlists, and other places which display videos other than the ‘normal’ video watching page are not handled, youtube needs to think you have the flash plugin installed, at least, so the only way to make it work right now is to actually have a flash plugin installed. I think we could probably get away with the last problem somehow, by looking at what the totem youtube plugin code does, for instance, and replicating it.

12 Responses to “Cool hack - html5tube”

  1. philn Says:

    Nice!!

  2. Rodney Dawes Says:

    The Totem YouTube plug-in uses the API which YouTube has published, and streams the videos that way. It never touches the actual web pages. It does have some other issues though, like blocking the UI quite a lot, and being generally slow, and I don’t know if it handles the HD streams. I’d like to see the bugs fixed, and a firefox or whatever extension that converts the YouTube flash videos into thumbnail links with play buttons that when clicked, open the video in Totem instead. And it would do this for any URLs pointing at a YouTube video as well. Sort of how it works on my phone.

  3. Glauco Vinicius Says:

    Awesome! Really a cool hack!

  4. mrmcq2u Says:

    What would make this even more super cool is if epiphany supported the fullscreen video javacript hooks that the latest webkit supports :D

  5. ReinoutS Says:

    We haven’t had an epiphany-extensions release for 2.29.x yet. Can we add this one to the official extensions set and release it into the wild?

  6. A new extension for GNOME's Epiphany Web browser makes YouTube use GStreamer and the HTML 5 video element instead of Flash. Says:

    [...] Web browser makes YouTube use GStreamer and the HTML 5 video element instead of Flash. Read more: Gustavo Noronha about January 18, 2010 5:02 PM - by Ryan [...]

  7. Remco Says:

    A Greasemonkey script for Firefox works without Flash installed. Maybe you could apply the same magic that they do:
    http://userscripts.org/scripts/show/50771

    Another interesting idea might be this:
    http://www.0xdeadbeef.com/weblog/2009/11/bringing-theora-to-youtube-the-hard-way/
    It converts the video to Theora before displaying it. Impractical, but nicely subversive! ;)

  8. Brian Says:

    Wow. This sounds really cool. I’m not sure I understand how to apply the patch to try this out. Can you either explain how to do that or provide the extension directly in some way that will make Epiphany install it automagically?

  9. Danilo Says:

    Hey, perhaps it’s also worth checking out http://www.youtube.com/html5 (I’ve tried their HTML5 player and it doesn’t really work for me)

  10. kov Says:

    @Danilo - yeah, that is a good initiative! The problem with those videos not playing is that GStreamer, despite using libsoup in most setups, does not share the same SoupSession used by webkit, so the cookies we should be sending do not get sent =(. We’re working on a fix: https://bugs.webkit.org/show_bug.cgi?id=34003

  11. Djavan Fagundes Says:

    Very cool! Thank you!

  12. Pierre St Juste Says:

    Just got your HTML5Tube through Debian unstable, epiphany-extensions, epiphany-extension-more, it works great for me, thanks for the hack, I’m a big epiphany/webkit fan, thanks for adding to the experience

Leave a Reply