Monday, October 20, 2008

Video Element Update

Some updates to the video element have landed and are now in the Firefox nightly builds. Bug 449159 was landed which refactors the Ogg backend to improve stability and add seeking support. Some of the changes include:
  • Improved stability. Deadlocks and crashes involving shutdown have been fixed.
  • Improved performance. CPU usage of video playback is better. There were problems that would result in the CPU usage pegging at 100% at times, especially after playback. These have been resolved.
  • After a video has completed playing, calling the play() method, or using the built in controls, will now restart playback.
  • The totalBytes DOM attribute is implemented.
  • Seeking is supported in certain cases. If the playback is from a local file, or a server that supports HTTP byte ranges, then seeking should work. There is no UI yet, but setting the currentTime attribute to a floating point value representing the number of seconds to seek should work. A 'seeking' event is raised when seek starts, and a 'seeked' event is raised when seeking completes.
  • Playback of video and audio would miss a portion of the end of the file. This was especially noticeable on small audio samples. Now files should play back completely.
My video test page has byte range support if you want to test seeking out. Since there's no user interface I recommend using the JavaScript Shell bookmarklet and interact with the video from JavaScript. Here's an example interaction:
var v = document.getElementsByTagName("video")[0];
v.play()
v.addEventListener("seeked", function() { print('seek completed!'); }, true);
v.currentTime=10
Categories: , ,

Labels:

6 Comments:

Blogger pd said...

Chris could you provide some more information on HTTP byte support?

What is it, is there an Apache mod for it, or a config tweak? I'd like to get a video player ready, supporting ogg from the day of Firefox 3.1 release :)

10:27 AM  
Blogger Carey said...

pd: byte ranges are a standard part of HTTP/1.1, which is over nine years old. All versions of Apache should have support built in, although some modules (like old versions of mod_php) and filters can cause problems. Stupid proxies are the most likely cause of trouble.

11:13 AM  
Blogger Chris Double said...

Have a look at section 14.35 of the HTTP 1.1 specification for the full details. The client can send along with its request a head of the form:

Range: bytes=500-

This means retrieve bytes 500 through to the end of the file. The server will respond with a status code of 206, meaning partial response, and include the requested range.

As far as I know Apache supports it out of the box. My double.co.nz/video_test page is running Apache and I didn't have to configure anything for it to work.

11:16 AM  
Blogger pd said...

I just did some fiddling around trying to see how <video> is coming along whilst trying the tracemonkey-enabled nightly.

Whilst I know Chris you've undoubtedly put in a lot of time to make <video> support a reality, do you think the <video> element is really up to a production release standard at the moment?

There seems to be a lot of problems.

Is there a link to a bugzilla search query that can show me all the <video> bugs? I guess I can then add any that may not be there, rather than ranting on about the issues here, which would be less effective :)

11:28 PM  
Blogger Chris Double said...

pd, mentioning the general problems you're having here would be useful.

For bugzilla, this query show's the video bugs:

5:22 AM  
Blogger pd said...

Hi Chris

I read your latest update and I've tried the DirectShow backend build.

It's very cool to play anything I can play elsewhere on my system also in Firefox. IMHO this means <video> in Firefox will not be reliant on the OGG codecs which few people use. The most popular codec in P2P circles seems to be XviD and soon Firefox will (indirectly) support that :)

I've read through a lot of the bug list and some of my issues are covered there. Some not. There seems to be a lot of duplication in that list. Perhaps someone should be triaging more?

One bug that is missing is support for Properties of the video type on the right-click menu. This should display all available metadata about the video. Also presumably similar code to Properties support will be needed for the Page Info -> Media tab.

Great to see southern hemisphere Mozilla contributors. I'm a web developer in Melbourne who can only really poke around testing and bug lists along with reading planet mozilla to help Mozilla. I'd like to do more but do not have C skills and find it difficult to communicate with the majority of the community which is of course based in the northern hemisphere and in weird time zones.

I guess I'll just have to focus on helping whateever you are doing :) Yourself and the other Kiwi Chris (Pearce) that is :)

After Firefox gets video support I promise I'll never tell you a sheep joke or ask you which number comes after 5 :)

3:21 AM  

Post a Comment

<< Home