EMBED in OBJECT, and both in VIDEO

Mozilla staffer Chris Double has one of the best blogposts I’ve yet seen on using the currently-proposed VIDEO tag in a realworld environment. It’s more realistic than other markup I’ve seen in that it goes beyond a single-browser audience. I would have commented there, but he requires either Google notification, or OpenID (which has been funky for me), so I’ll make a larger blogpost about it instead.

One of the most interesting aspects is that he’s addressing the age-old nesting of OBJECT and EMBED tags by [drumroll] wrapping a VIDEO tag around them both… VIDEO tag on the outside, then an OBJECT tag, then on the inside an EMBED tag. It makes sense, considering how HTML4 blessed Microsoft’s later OBJECT while dysfunctionally deprecating Netscape’s original EMBED, but to see three nested tags just for one media element, I got a kick out of that, and you might too.

The real reason I wanted to comment was on Chris’s line about transport controls: “These fallback options don’t allow creating your own controls with JavaScript and using the nice HTML5 media API.” There’s hope… Flash, of course, has been providing the world’s computers with customizable UI elements for a very long time, no browser variance to worry about.

But you can still do it in JavaScript, if you prefer… the varied protocols for plugin/browser intercommunication have all been quickly supported by Flash, and it’s quite possible to have JavaScript control a Flash video. For practical work you’d also need to include the Microsoft protocols for browser/ActiveX intercommunication, to reach the majority of people on the web, but it’s doable.

(I know that other people have driven video from JavaScript before, but I’m not sure how to search it up… if you happen to know of existing libraries they might use, could you drop a note in comments here please?)

The unspoken question in all this, of course, is “Why?” Making two formats of a video is something that very few people would find worthwhile to do. But as an intellectual exercise it’s certainly novel… VIDEO enclosing OBJECT enclosing EMBED, the tagging inspires a certain perverse fascination. Check it out!

2 Responses to EMBED in OBJECT, and both in VIDEO

  1. Erki Esken says:

    John, for controlling Flash video from JavaScript, Adobe itself provides a nice library at http://labs.adobe.com/wiki/index.php/Flash-Ajax_Video_Component
    Now it’s just a matter of time when someone will make it HTML5 video API compatible.
    [jd sez: Great, thanks for being my backup brain, Erki! 🙂 ]

  2. “Making two formats of a video is something that very few people would find worthwhile to do.”
    This is true. But it is a necessary evil when the conditions require it. Just as all video once had to be available in Windows Media, QuickTime, and possibly RealVideo formats, now it must be available in Flash and the Xiph codecs (Vorbis and Theora) until royalty-free codecs are widely adopted.
    The reason we must do the two formats thing again is that we didn’t solve it right the first time. Instead of finding royalty-free codecs (which may have required further development to make them deployment-ready) and pushing them to all computers, web developers chose to use Flash, which had a large user base at the time that was further increased through this decision. Web developers didn’t want to solve the codec distribution problem and they figured Adobe had done it for them, at least as far as they cared.
    But Adobe only partly solved the problem because all of the video codecs they provided were (and still are) mired in patents. This means that any Flash player is necessarily non-redistributable, which makes it unacceptable for inclusion into a wide variety of projects, including the One Laptop per Child project (see their Restricted formats page), the permissively-licensed BSDs, and many GNU/Linux distributions.
    It will take time for everyone to load royalty-free codecs on their computers (see The codec dilemma, particularly the “Business motives” section, for details). But once they do, web developers can provide video content in a single format, confident that everyone can view it.
    Because of Adobe’s large installed user base of Flash players, they could be very helpful in distributing royalty-free codecs to end users. Adobe should add Theora (and possibly Dirac) support to the Flash player to speed the transition to royalty-free codecs and, ultimately, a single standard for video on the web.
    [jd sez: Hi Denver, I agree that it would be desirable to achieve universal consumer support for a patent-unencumbered codec — would give content producers another choice, would make it less expensive for new toolmakers too. Flash Player is still on a four-megabyte diet last I heard, though. Hard to say.]