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.
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.
January 17th, 2010 at 4:57 pm
Nice!!
January 17th, 2010 at 7:16 pm
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.
January 17th, 2010 at 11:38 pm
Awesome! Really a cool hack!
January 18th, 2010 at 9:47 am
What would make this even more super cool is if epiphany supported the fullscreen video javacript hooks that the latest webkit supports
January 18th, 2010 at 10:18 am
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?
January 18th, 2010 at 8:48 pm
[...] 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 [...]
January 18th, 2010 at 9:16 pm
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!
January 19th, 2010 at 12:27 am
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?
January 22nd, 2010 at 6:13 pm
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)
January 22nd, 2010 at 6:48 pm
@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
January 29th, 2010 at 4:18 pm
Very cool! Thank you!
March 14th, 2010 at 1:11 am
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