HTML and CSS Reference
In-Depth Information
Media Considerations
An interesting concern about “open” media formats is whether or not they really are open.
As the HTML5 specification emerges, fissures are already forming in terms of how these
elements are implemented, what codecs will be supported by what browser vendors, and
whether HTML5 will require a particular codec to be supported by all HTML5-compliant
browsers. Valid concerns about so-called “submarine” patents surfacing and torpedoing the
open media effort are real and hotly debated.
Unfortunately, given this media codec chaos, at the time of this edition's writing, getting
an example to work in all browsers can be quite a chore and Flash and/or QuickTime support
must be added to address older browsers. Simply put, for all its possibilities, so far HTML5
media is a messy solution at best. The following adds in a fallback within the previous video
example for Flash:
<video width="640" height="360" controls poster="loading.png">
<source src="" type="video/mp4">
<source src="" type="video/ogg">
<object data="html_5.swf" type="application/x-shockwave-flash"
width="640" height="360" id="player">
<param name="movie" value="html_5.swf"/>
<strong> Error: No video support at all </strong>
Given the example, I think it isn't much of a stretch to imagine a <source> tag being set to
a Flash type eventually; making the direction this is going even more confusing.
So while the potential benefits of open media formats can be debated endlessly, there is
also the pragmatic concern of how long it will take before HTML5's open media movement
becomes viable. Getting to the stable media playback world provided by Flash took many
years, and it seems unlikely that HTML5 solutions will move much faster.
N OTE The current state of the HTML5 specification before press suggests that no codec is official.
While the neutrality is welcome, the reality that implementations vary considerably still continues.
Client-Side Graphics with <canvas>
The canvas element is used to render simple graphics such as line art, graphs, and other custom
graphical elements on the client side. Initially introduced in the summer of 2004 by Apple in its
Safari browser, the canvas element is now supported in many browsers, including Firefox 1.5+,
Opera 9+, and Safari 2+, and as such is included in the HTML5 specification. While Internet
Explorer does not directly support the tag as of yet, there are JavaScript libraries 3 that emulate
<canvas> syntax using Microsoft's Vector Markup Language (VML).
From a markup point of view, there is little that you can do with a <canvas> tag. You
simply put the element in the page, name it with an id attribute, and define its dimensions
with height and width attributes:
3 Circa late 2009, the most popular IE <canvas> emulation library is explorercanvas, available at http://
Search WWH ::

Custom Search