Oct 242008

Yesterday I added this new article: Using audio and video in Firefox.  This provides additional examples, but more importantly demonstrates how to manipulate media content through the DOM.  Even more important than that, it shows how to watch for events that are triggered while the media loads and plays, so you can keep informed of the progress of the performance of the content.

This should be really helpful for folks that want to take advantage of these new capabilities.  I invite feedback, as always!

 Posted by at 3:13 PM

  3 Responses to “More audio and video docs”

  1. Looking good! I noticed that there is an autoplay “attribute” in the example but it has no value so its not valid XML, right? For people who are writing XHTML what should they be using? autoplay=”true”, maybe?

    I realize HTML5 doesn’t have to be written as XML, but it might be nice to encourage people that way anyway, just to ensure they don’t have problems.

  2. The reason the samples were written the way they are is because no matter what value you specify for autoplay, providing an autoplay option at all means the value is considered to be “true”. Actually specifying “true” in the sample would confuse people into assuming that specifying “false” would mean “false,” when in actuality it means “true”.

  3. Thanks for the reply. I looked up the WHATWG docs and it sounds like it does matter what you set as the value:

    “If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace.”

    Based on this, one must use either:

    autoplay=”” OR autoplay=”autoplay”

    Otherwise the video wouldn’t autoplay.

This site uses Akismet to reduce spam. Learn how your comment data is processed.