Thursday, December 06, 2007

New <video> enabled experimental Firefox builds

I've uploaded new builds of Firefox with experimental support for the WHATWG <video> element. They are (compiled from this git commit):The git repository has been updated with the code for this build.

Note that the code in these builds, and the git repository, is advanced from that in the patch attached to the video element bugzilla entry. That code can be accessed from git via the patch11 tag.

The usual disclaimer with the builds I provide applies.
Be aware that these are builds from a random point in the Mozilla CVS tree, with the Video patch applied. I don't guarantee they'll work for much more than demonstrating video support and it's very likely to contain bugs. That said, I run these builds often.
Two main additions with this build. The first is fixing the annoying bug whereby leaving a page that is playing video would leave the sound running in the background. This was due to the 'bfcache' keeping the page around in case the user hits the back or forward buttons. The video is effectively paused now when the page is in the bfcache.

The second is preliminary support for the <source> element, which can be used to provide a list of media resources, with mime types, and the browser selects out of the list the media resource to play based on what it supports. This initial implementation only supports a 'type' attribute set to 'video/ogg'. What this will let you do though, is add a source element for an MP4 encoding, and one for an Ogg encoding. When played on Firefox the Ogg version will play, and a browser that currently doesn't support Ogg but supports MP4 can choose to play that instead.

Issues I have partial fixes for but haven't yet made it into the main branch of the git repository, and not in these builds are:
  1. Sound support on Linux is patchy. I'm using sydney audio's OSS support which has issues when multiple devices open /dev/dsp. This can occasionally affect synchronisation of the video.
  2. There is no buffering for network loads. The video plays immediately so on a slow pipe or large video the playback will stutter. You can pause the video to let the download catch up but there is no progress indication yet. This can make performance look worse than it is in bandwidth constrained environments.
  3. Seeking forward and back in the stream. There is some support, but it's a work in progress and quite broken.
You might notice that full page zoom works in this build. And it works with videos. You can zoom a page and any videos on the page are zoomed. You can test this with Ctrl+ (Apple-+ on the Mac).

Test videos are available at my test page, or Opera's page.

There are sites using the <video> right now.

The Metavid project has support for the <video> element. If you look at the videos in a <video> enabled browser, the player is the interface provided with the 'controls' attribute set. For example, Senate Proceeding 11-16-07. Nice job, Metavid, and thanks for using <video>!

The Wikimedia video's seems to have experimental support for it. Unfortunately the test to see if the video element is supported appears to be done last, so usually the Java applet, etc is found first. You can get around this by setting a cookie. When the Wikimedia video page open, enter this in the URL bar:
javascript:wgOggPlayer.setCookie('ogg_player', 'videoElement', 7*86400*1000, false, false, false, false)
Remove it by deleting the 'commons.wikimedia.org' cookie if you want to go back to the default ordering of selections.

You'll notice some issues, which is probably why it's currently right at the end of the chain. Clicking on the video picture and pressing play works fine. But clicking the play button on the main page listing all the videos does not correctly display the video. I'll look into what's causing this.

If you know of any other <video> supported sites, please let me know in the comments.

I'll be attending the W3C Video on the Web Workshop in San Jose on the 12th and 13th of December. I fly out from Auckland on the 9th and leave San Francisco on the 16th. If you're in the area and want to catch up, let me know.

Categories: firefox,

Labels:

13 Comments:

Blogger Огнян Кулев said...

The important question for many of us is: Will it be part of Firefox 3? :-)

7:55 PM  
Blogger Peter Gasston said...

I'm getting a 404 for the Linux build.

9:33 PM  
Anonymous hsivonen said...

Is the code expected to work on Mac PPC? I pulled from git on Dec 4th. I built with --enable-video --enable-ogg. In my test cases, the Vorbis sound track played but video was not painted. Soon afterwards Firefox started allocating insane amounts of memory. It had over 2 GB of real memory when I managed to get rid of the process.

10:04 PM  
Anonymous jonathan said...

Working links are on the test page:
http://www.double.co.nz/video_test/

I really hope this gets in Firefox 3, can't be waiting a year to play with video on the web. (maybe 3.1 if not? ;D)

11:41 PM  
Blogger TheBeesAreDisappearing said...

Hey - 404 on the Ubuntu build... please do fix before heading out for the conference:-) - can't wait to play with this... thanks for all the work !

11:53 PM  
Blogger Chris Double said...

Ugh, sorry everyone, I had the files linked wrong. As Jonathan said the were linked right on my test page. I've fixed the blog links though.

I can't say what version of FF it'll be in as unfortunately I don't know. Make some noise to let people know you want it :-)

hsivonen, I haven't tested it on PPC yet - I'll find one to try it out on and let you know. It's possible that I've not got the theora library compiling correctly for that platform. In fact that's highly likely. Something quick to try would be to edit mozilla/modules/libtheora/lib/Makefile.in, and remove the DEFINES += -DUSE_ASM that is in the Darwin section just before the CSRCS. Then do a make -f client.mk build again.

1:31 AM  
Blogger Mike said...

Chris knows this, but others might not: the most effective form of "noise" to be made in advocating for a platform feature's inclusion is that of compelling demonstrations of use cases, especially those that demonstrate interesting mixes with other web features. Me-too comments in bugs and developer threads aren't nearly as welcome. :)

2:32 AM  
Blogger Martijn said...

With those new builds, the sound still doesn't stop when I close the tab containing the video.

Also, I still crash when saving http://www.double.co.nz/video_test/test1.html locally for instance, and then trying to play it from there.

5:05 AM  
Blogger Chris Double said...

Thanks Mike :-) "noise" = use <video>, write demos, integrate it into your sites in interesting ways. Wikimedia and Metavid are leading the way here at the moment it seems.

Martijn, what platform are you on? Yes, the video still continues when closing a tab - it's the bfcache issue that was fixed, that of navigating to a different page on the same tab. Closing the tab issue will be fixed in the next build, sorry.

11:14 AM  
Blogger Martijn said...

I'm on windowsXP.
I don't mind that the sound goes on after closing the tab, but I got the impression you thought that was fixed.

11:25 AM  
Blogger Chris Double said...

Thanks Martijn, your impression was right :-) In fixing the bfcache issue I didn't try the case of just closing the tab, oops! I'll track down the cause of the crash you are seeing to.

11:43 AM  
Anonymous hsivonen said...

I did a git pull and removed DEFINES += -DUSE_ASM. Now even sound doesn't play but there is no memory allocation badness, either.

5:40 AM  
Blogger nicu said...

You label the Linux build "Ubuntu", but it is just a generic Linux tarball, it almost made me, a Fedora user, to not try it believing it will not work on my system, but it worked.

9:34 PM  

Post a Comment

<< Home