Saturday, June 02, 2007

HTML audio and video

HTML 5 will introduce new <audio> and <video> elements, for including these objects on a web page in a simple, standard way. Just as Netscape originally became successful due in part to the new <img> element, you can expect browser makers to quickly implement and take advantage of sound and video.

Currently, sound and video is only available using the general purpose <object> element and various non-standard techniques for each plug-in (QuickTime, Silverlight, Flash, etc).

The new elements have several benefits:

  • accessible - to search crawlers, the visually impaired, etc
  • standard API - consistent DOM, javascript, and HTML elements & attributes
  • standard user interface - for play, pause, etc
  • integrated with the web page - part of the DOM, controllable by javascript for play, pause, volume, etcclear scope - just for video and audio, not for e.g. vector graphics

Possible uses of them include:

  • Web page control of play, pause, fast forward, etc
  • Web training videos with multiple choice tests on completion
  • Video SVG filters (e.g. guassian blurs)
  • Synchronized subtitles and sign language

Revealingly, both Flash and Silverlight don't neatly fit into this picture. They don't only enable video - they also handle vector graphics and html-like text. I suppose you could use the <video> element for Flash videos, and the <object> element for Flash graphics and text. But ideally you'd instead use html for text, and an element like <svg> or <vml> for vector graphics, in order to maintain the benefits above.

Once you've got normal html, <video>, <audio>, and <svg>, is every type of multimedia covered? No - there's still a need for interactive gaming user interfaces and 3D, for a start. But you're much further, and there's always the <object> element for missing pieces.

No comments: