Mozilla

HTML5 video 'buffered' property available in Firefox 4

This is a repost from Chris Pearce’s blog.

Recently I landed support for the HTML5 video ‘buffered’ property in Firefox. This is cool because we can now accurately determine which time-segments of a video we can play and seek into without needing to pause playback to download more data. Previously you could only get the byte position the download had reached, which often doesn’t map to the time ranges which are playable very well, especially in a variable bit rate video. This also can’t tell you if there are chunks which we skipped downloading before the downloaded byte position. Once the video controls UI is updated, users will be able to know exactly which segments of their video are downloaded and playable and can be seeked into without pausing playback to download more data.

To see this in action, download a current Firefox nightly build , and point your browser at my video ‘buffered’ property demo. You’ll see something like the screenshot below, including an extra progress bar (implemented using canvas) showing the time ranges which are buffered.

I’ve implemented the ‘buffered’ property for the Ogg and WAV backends. Support for the ‘buffered’ property for WebM is being worked on by Matthew Gregan, and is well underway. At the moment we return empty ranges for the ‘buffered’ property on video elements playing WebM and raw video.

My checkin just missed the cutoff for Firefox 4 Beta 3, so the first beta release that the video ‘buffered’ property will appear in is Firefox 4 Beta 4.

19 comments

Comments are now closed.

  1. Richard Stallman wrote on August 20th, 2010 at 01:07:

    I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/LInux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

    Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

    There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.

    1. Cleroth wrote on September 5th, 2010 at 13:31:

      And, to shorten the definition, we just call it Linux.

      1. Peter wrote on October 24th, 2010 at 07:25:

        While I think we should give the Linux developers credit, if we wish to shorten the name, it would accurately be shortened to “GNU”.

    2. Guido wrote on October 23rd, 2010 at 16:23:

      What a dork. It’s like being pissed because someone calls Windows instead of “Microsoft Windows”.
      Everyone knows it’s GNU/Linux but who cares.
      And besides we couldn’t call it GNU for short, BSD also uses GNU and there is no way to tell what we are refering to.
      Just deal with it.

      1. Chris wrote on November 8th, 2010 at 22:27:

        Guido: “It’s like being pissed because someone calls Windows instead of ‘Microsoft Windows’.”

        Well this argument has no weight since in fact you are talking about a product made by the same company, GNU+Linux is in fact that GNU plus Linux, it is two very different things made by two very different projects that happened to work together very well. Lets give credit where credit is due.

        And you have made a mistake on the whole GNU , BSD situation, here is an excerpt from the GNU site:
        http://www.gnu.org/gnu/linux-and-gnu.html

        “People sometimes ask whether BSD too is a version of GNU, like GNU/Linux. The BSD developers were inspired to make their code free software by the example of the GNU Project, and explicit appeals from GNU activists helped persuade them, but the code had little overlap with GNU. BSD systems today use some GNU programs, just as the GNU system and its variants use some BSD programs; however, taken as wholes, they are two different systems that evolved separately. The BSD developers did not write a kernel and add it to the GNU system, and a name like GNU/BSD would not fit the situation”

        So the example would be like a “strawberry swirl cheese cake”, it would be insufficient to call it just “strawberry cake” or “cheesecake” it could only be called by what it is.

  2. Mardeg wrote on August 22nd, 2010 at 14:12:

    Does this mean the following test should pass?:

    http://samples.msdn.microsoft.com/ietestcenter/html5/MediaElements/media-rules-buffered.htm

    This is filed as https://bugzilla.mozilla.org/show_bug.cgi?id=589564

  3. N wrote on August 23rd, 2010 at 11:25:

    Oh my god… the 4Chan “interjection” meme is spreading beyond 4Chan…

  4. Felipe wrote on August 24th, 2010 at 12:26:

    The feature implemented is great! Way better than flash videos.

  5. Tsiolkovsky wrote on October 24th, 2010 at 07:18:

    @Guido. Calling someone that is fighting so hard for basic freedoms of computer users a dork is not a smart thing to do. And your argument about the right naming of the GNU/Linux is answered in this document:
    http://www.gnu.org/gnu/gnu-linux-faq.html
    I suggest you read it all as I have a feeling you may have some other misconceptions on which you then base your arguments.

  6. Peter wrote on October 24th, 2010 at 07:29:

    Calling Microsoft Windows, Windows is less explicit but still accurate. It’s simply a shorter name. Calling GNU/Linux, Linux isn’t less explicit, it’s misleading.

  7. David wrote on October 24th, 2010 at 11:05:

    @Guido

    I fully support and agree with Tsiolovsky’s reply to your comment and would add that to ignore the work done by those who gave us the GNU project and who have striven so long and so diligently to preserve and protect those freedoms mentioned in the link Tsiolovsky gave you by terming them “dorks” or any other insult at all risks losing those freedoms. If all it takes for you to support and acknowledge the work done on behalf of those who use GNU/Linux and to do your bit to keep and protect those freedoms mentioned in the link is to call thees products by their correct names it’s little enough to ask.

  8. Mike wrote on October 24th, 2010 at 12:41:

    @Guido – you are incorrect that everyone is aware that, when the term “Linux” is used in context of an entire operating system, that it implies “GNU/Linux”. In fact, the majority of casual (generally non-technical) GNU/Linux users I have spoken with are hardly aware of GNU. Not only does using the term GNU/Linux bring attention to the fact that they are using the GNU operating system and the freedoms that it provides, it also serves as a correction.

    Calling “Microsoft Windows” by the name “Windows” is correct – Microsoft is the company. Their product is in fact called “Windows”. However, GNU has no connection with Linux other than the fact that Linux is bundled with GNU in order to form a complete operating system. GNU isn’t the company behind Linux, so leaving GNU out of the equation doesn’t shorten it. It’s simply incorrect.

    Using the term GNU/Linux both gives credit to all the individuals who have fought so hard and put so much time into developing a free (as in freedom) operating system. That aside, calling someone a dork for protecting your freedoms is rather insulting, especially if you yourself are a GNU/Linux user (I’m not saying that you are or not). Especially when referring to the person who both started and devoted his life to the free software movement.

    All that said, I do understand why people use the term “Linux” when speaking aloud about the GNU/Linux operating system. It’s a mouthful and it is indeed much easier to simply say “Linux”. Everyone finds ways to shorten things. I make an attempt to say GNU/Linux wherever possible, though I do slip at times as well. It’s important to keep in mind that when shortening a term, that it should still convey the same meaning. However, there’s really no reason when writing an article or typing not to use the term GNU/Linux.

  9. Karthikeyan A K wrote on October 24th, 2010 at 18:53:

    I think its better for free software supporters to call GNU/Linux than Linux. If there was just Linux, it wouldn’t have been what it is now. Its because of GNU’s effort that Linux is more palatable. I would prefer to call GNU/Linux.

  10. Michael wrote on December 28th, 2010 at 11:21:

    Interesting discussion, albeit off-topic. I personally support calling it “GNU/Linux”. The reference to “Microsoft Windows vs Windows” is not accurate. More accurate would be a comparison between a (peanut-butter && jelly sandwich) and a (peanut-butter sandwich || jelly sandwich). With a PB&J, you can’t just call it a peanut-butter sandwich or a jelly sandwich; it’s gotta be “peanut butter and jelly”, else it doesn’t reflect reality.

    “There are a lot of generic brands on the market that are just as tasty as the real thing”
    — Chris Knight, Real Genius

  11. Brent J wrote on April 6th, 2011 at 11:33:

    To appease the Stallmanites, the new name for the mash-up of free software packaged as an operating system might be:

    GinLinG == Gnu is not Linux is not Gnu

    It even has an Asian ring, to match people’s trendy tatoos.

    There, now everyone is happy. :)

    1. Cleroth wrote on April 7th, 2011 at 01:19:

      In 5 years’ time, when I hear the term “GinLinG” I’ll remember this post.

  12. cpearce wrote on June 16th, 2011 at 15:02:

    WTF guys!?! I didn’t even mention “Linux” in my post! Any more comments in response to the “Linux vs GNU/Linux” debate will be deleted.

  13. Ian wrote on February 11th, 2012 at 18:39:

    It would be great to see this buffering for the audio tag too. Maybe it’s there by now. I’m using chrome with mp3 audio, and it doesn’t seem to skip downloading parts it doesn’t need. It would be good if it did byte range requests for the parts that have been seeked to. I will have to get some audio oggs to try out in Firefox.

    Great work Chris, keep it up.

  14. hajir wrote on March 26th, 2012 at 00:32:

    this for all to tell me

Comments are closed for this article.