<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML5 Doctor &#187; audio</title>
	<atom:link href="http://html5doctor.com/tag/audio/feed/" rel="self" type="application/rss+xml" />
	<link>http://html5doctor.com</link>
	<description>helping you implement HTML5 today</description>
	<lastBuildDate>Tue, 27 Jul 2010 14:36:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Your Questions Answered #6</title>
		<link>http://html5doctor.com/your-questions-answered-6/</link>
		<comments>http://html5doctor.com/your-questions-answered-6/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 14:30:59 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[h1]]></category>
		<category><![CDATA[hcard]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1578</guid>
		<description><![CDATA[We're back with another round of patient questions about <abbr>HTML</abbr>5. In this article, we'll discuss using multiple <code>&#60;h1&#62;</code>s, audio codecs, microformats, post bylines, and the <code>&#60;time&#62;</code> element.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://html5doctor.com/wp-content/uploads/2009/07/html5doctor-treatment.gif" alt="Doctor treating a patient illustration" class="alignright size-full wp-image-424" /> We&#8217;re back with another round of patient questions about <abbr>HTML</abbr>5. In this article, we&#8217;ll discuss using multiple <code>&lt;h1&gt;</code>s, audio codecs, microformats, post bylines, and the <code>&lt;time&gt;</code> element.</p>
<h2>Using multiple <code>&lt;h1&gt;</code>s</h2>
<p>Bnonn asked:</p>
<blockquote><p>I&#8217;m unsure of how <code>h1</code> is supposed to be used now that pages can be divided into sections and articles. In (X)HTML4, a page was basically a page, and so you only had one <code>h1</code> element: the top level heading for the page. I&#8217;m not even sure if that was a requirement of HTML4, or if it was just a de facto standard, but it made sense.</p>
<p>Now, however, there are any number of possible sections and articles per page; each of which may contain any number of heading elements (and one of those might be inside a <code>header</code> element). Given that <code>h1</code> is a top-level heading, it seems as if each section and/or article should have one, in addition to the page-level <code>h1</code>. However, this contradicts what I know of accepted usage, so I&#8217;m confused about the way in which I should be marking up headings in HTML5. It doesn&#8217;t seem right to start headings in a <code>section</code>, for instance, with <code>h2</code>, because then&#8230;where&#8217;s the top-level heading for that element? But it doesn&#8217;t seem right to start them with <code>h1</code>, because that element in current web usage has more &#8220;power&#8221; than warrants its use there.</p>
<p>There is also SEO to wonder about. Even if using multiple <code>h1</code> elements is right, I wouldn&#8217;t want to be penalized for it by Google. So what&#8217;s the story with that?</p>
<p>Any help is much appreciated.</p>
<p>Regards,</p>
<p>Bnonn</p>
</blockquote>
<p>Basically, you can use multiple <code>&lt;h1&gt;</code>s in order to shape the document outline. So an <code>&lt;h1&gt;</code> within a <code>&lt;section&gt;</code> will be treated like an <code>&lt;h2&gt;</code> (if it is a nested <code>&lt;section&gt;</code>). If that <code>&lt;section&gt;</code> (and only that <code>&lt;section&gt;</code>) is aggregated elsewhere on the web, however, it will fit seamlessly into that external document&#8217;s outline. This means that your original <code>&lt;h1&gt;</code> could be treated as an <code>&lt;h1&gt;</code>, <code>&lt;h2&gt;</code>, <code>&lt;h3&gt;</code>, or <code>&lt;h4&gt;</code> as appropriate.</p>
<p>I hope that makes sense! Bruce&#8217;s article on <a href="http://html5doctor.com/the-section-element">the section element</a> touches on this, and we also hope to talk more about document outlines in the future.</p>
<p>Cheers,</p>
<p>Rich</p>
<p>P.S. Multiple <code>&lt;h1&gt;</code>s in <abbr>HTML</abbr>4 are perfectly legal, but seldom used.</p>
<h2>Audio Codecs</h2>
<p>Adam asked:</p>
<blockquote><p>Hello,</p>
<p>I&#8217;ve got a query about the issues regarding what codecs to use for the audio tag. I don&#8217;t quite get why Firefox won&#8217;t support mp3. Surely the browser calls on the codecs present on the operating system, not within the browser, so how are the licensing issues a problem to the browsers if they are simply leaving what is already present (and in theory already licensed)?</p>
<p>I fully admit that I am no lawyer. It just seems very odd the line of argument Mozilla has taken.</p>
<p>Adam Wilcox</p>
</blockquote>
<p>I&#8217;m not sure why they&#8217;ve taken that stance, but I know that Mozilla only plans to support Ogg and Apple are keen to push MP3 and MP4, so we&#8217;re at stalemate. Because of this, discussion of specific codecs has been removed from the spec altogether.</p>
<p>Although not related to audio, see this article I wrote about <a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/">YouTube and Vimeo supporting <abbr>HTML5</abbr> video</a>. It explains a little about codecs.</p>
<p>Sorry I can&#8217;t be of more help.</p>
<p>Rich</p>
<p><small>Since writing this reply there has been a lot more talk over codecs for both video and audio since Microsoft announced they would be supporting H.264 in <abbr>IE</abbr>9. We&#8217;ll cover this in more detail soon.</small></p>
<h2>hCards</h2>
<p>Ken asked:</p>
<blockquote><p>How does html 5 deal with hCards and microformats in general? Specifically, can you have more than one hCard per page? As I understand it currently, having more than one is problematic. I&#8217;m asking now because of the treatment &#8220;footer&#8221; and &#8220;aside&#8221; has gotten, i.e. they are context sensitive to their &#8220;article&#8221; or &#8220;section&#8221; unless top-level, then applied to the page. Also, the use of scoped on style tags: hCards should be updated in a like manner for html 5.</p>
<p>Thanks for hearing me out. I don&#8217;t know if this is the appropriate place for this question, but as html 5 is much more useful, I thought maybe a post is in order <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Also, &#8220;article&#8221;&#8217;s impact on the hAtom microformat makes for an interesting article, don&#8217;t ya think?</p>
</blockquote>
<p>We touched upon microformats in our articles on the <a href="http://html5doctor.com/the-address-element/"><code>&lt;address&gt;</code></a> and <a href="http://html5doctor.com/the-time-element/"><code>&lt;time&gt;</code></a> elements, but we&#8217;ll try to cover more soon (possibly in an article on the <code>&lt;article&gt;</code> element).</p>
<p>I haven&#8217;t heard that having more than one hCard is problematic. I&#8217;ve certainly never had any issues doing that. If you check out the source code on the homepage of HTML5Doctor, you&#8217;ll see we&#8217;ve used multiple hCards — one for each author&#8217;s name associated with a post.</p>
<p>Hope that helps a little.</p>
<p>Cheers,</p>
<p>Rich</p>
<h2>Article bylines</h2>
<p>Eric asked:</p>
<blockquote><p>I tweeted to you guys a few days ago (@ericdfields), wondering what you recommend for bylines for blog posts. Bylines, borrowing a newspaper term, would be the &#8216;Posted by SoandSo on Nov 1, 2010&#8242; copy you find under the article of your typical blog post.</p>
<p>To me, they seem like something of an &#8216;aside&#8217; for the header of the document.</p>
<p>I don&#8217;t know if its perfectly valid, but here&#8217;s the <a href="http://theeem.com/html5/test.html">test case I whipped up</a>.</p>
<p>Thanks in advance for any insight!</p>
</blockquote>
<p>In my opinion, they&#8217;re header or footer information, so I do:</p>
<pre><code>&lt;header&gt;
  &lt;hgroup&gt;
    &lt;h1&gt;Foo&lt;/h1&gt;
    &lt;h2&gt;Bar&lt;/h2&gt;
  &lt;/hgroup&gt;
  &lt;p&gt;Posted by Bruce on &lt;time datetime="2009-11-01"&gt;1st November&lt;/time>&lt;/p&gt;
&lt;/header&gt;</code></pre>
<p>Thanks, Bruce</p>
<h2>How to use <code>&lt;time&gt;</code> with a date in astrology</h2>
<blockquote><p>Dear HTML5Doctors,</p>
<p>I was confused in how to using the <code>time</code> tag with the Astrology date. For example if I have a chunk of content like this:</p>
<p>ARIES: 13 Apr &#8211; 14 May</p>
<p>how can I use attribute &#8220;datetime&#8221; to explain the format of that date?</p>
<pre><code>&lt;p&gt;ARIES: &lt;time title="start" datetime="???"&gt;13 Apr&lt;/time&gt; - &lt;time title="end" datetime="???"&gt;14 May&lt;/time&gt;&lt;/p&gt;</code></pre>
<p>The year of birth is not fixed, please advice me some solutions about this.</p>
<p>Thank you,</p>
<p>radiz</p>
</blockquote>
<p>Hi Radiz,</p>
<p>The time element is for one specific day, not a range or &#8220;imprecise&#8221; date. So you can&#8217;t use it for &#8220;13 April.&#8221; You need to use it for a specific &#8220;13 April&#8221; and give a year. For more, see our article on <a href="http://html5doctor.com/the-time-element/">the <code>&lt;time&gt;</code> element</a>.</p>
<p>Thanks, Bruce</p>
<h2>Got a question for us?</h2>
<p>That wraps up this round of questions! If you&#8217;ve got a query about the <abbr>HTML</abbr>5 spec or how to implement it, you can <a href="http://html5doctor.com/ask-the-doctor/">get in touch</a> with us and we&#8217;ll do our best to help.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/your-questions-answered-7/" rel="bookmark" class="crp_title">Your Questions Answered #7</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</a></li>
<li><a href="http://html5doctor.com/your-questions-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%20%236%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;bodytext=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;notes=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Your%20Questions%20Answered%20%236&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;t=Your%20Questions%20Answered%20%236" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;annotation=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Your%20Questions%20Answered%20%236&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;t=Your%20Questions%20Answered%20%236" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;h=Your%20Questions%20Answered%20%236" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%2F&amp;t=Your%20Questions%20Answered%20%236&amp;s=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/your-questions-answered-6/" rel="bookmark">Your Questions Answered #6</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 8, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Why designers should care about HTML5</title>
		<link>http://html5doctor.com/why-designers-should-care-about-html5/</link>
		<comments>http://html5doctor.com/why-designers-should-care-about-html5/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 13:01:06 +0000</pubDate>
		<dc:creator>Cennydd Bowles</dc:creator>
				<category><![CDATA[Comment]]></category>
		<category><![CDATA[JavaScript APIs]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=973</guid>
		<description><![CDATA[After a while on the fringes of our collective consciousness, HTML5 is finally getting the attention it deserves. The development community (as typified by the SuperFriends) has come together to debate practical elements of the spec, argue over the inclusion of controversial elements, and assess the timeframe over which we can unleash HTML5 in the wild.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>After a while on the fringes of our collective consciousness, <abbr title="Hypertext Markup Language 5">HTML5</abbr> is finally getting the attention it deserves. The development community (as typified by the <a href="http://www.zeldman.com/superfriends/">SuperFriends</a>) has come together to debate practical elements of the spec, argue over the inclusion of controversial elements, and assess the timeframe over which we can unleash <abbr>HTML</abbr>5 in the wild.</p>
<p>However those of us more accustomed to the world of Post-Its, sketches, and .psds – the designers – haven’t been so vocal. Perhaps we&#8217;ve been distracted by the bright lights of <a href="http://www.css3.info/">CSS3</a> and those surface thrills we’ve longed for. (Rounded corners! Gradients! Transparency!) Or, alternatively, we&#8217;ve been in the thrall of <code>@font-face</code> and looking forward to the coming age of passable web typography.</p>
<p>Understandable. But it’s time designers got excited about <abbr>HTML</abbr>5 too.</p>
<p>Partly, it’s just good practice. Whatever your flavour of design &ndash; visual, web, interaction, user experience &ndash; knowing the native technology makes you better at your job. Just as composers should understand the capabilities of the orchestra&#8217;s instruments, designers need to understand the language of the web.</p>
<p>But there’s more to <abbr>HTML</abbr>5 than simply keeping our skills sharp. It could make a big difference to the way we design for the web.</p>
<h2>Semantic elements</h2>
<p>Information architects (and, by extension, user experience designers) should be excited by the new <abbr>HTML</abbr>5 elements – <code>&lt;nav&gt;</code>, <code>&lt;header&gt;</code>, <code>&lt;aside&gt;</code> and so on. While they won’t immediately revolutionise today’s web, they’re an investment for the future. Doing useful stuff with information is the central theme of <abbr title="information architecture">IA</abbr>, and therefore its practitioners should be at the forefront of the new experiences that machine-readable semantics will offer. <abbr>HTML</abbr>5 allows us to mark text up in a more meaningful way than a sea of <code>&lt;div&gt;</code>s, meaning we’ll soon see applications appearing at a sub-page level. We’ve started to scratch the surface – think about the <a href="https://addons.mozilla.org/en-US/firefox/addon/4106">Operator toolbar</a> or customisable UIs à la <a href="http://www.google.com/ig">iGoogle</a> – but we’ll need detailed design thinking to work out how to bring the benefits of semantic richness to the end user.</p>
<h2>APIs and other extensions</h2>
<p>While it’s clear that <a href="http://www.quirksmode.org/blog/archives/2009/09/the_html5_drag.html">some of the <abbr>HTML</abbr>5 APIs are far from perfect</a> right now, when they&#8217;re refined they will offer us intriguing new opportunities and challenges.</p>
<p>Designers of location-based services should of course find the <a href="http://dev.w3.org/geo/api/spec-source.html">geolocation API</a> invaluable. The <a href="http://blog.whatwg.org/the-road-to-html-5-contenteditable">contentEditable attribute</a> gives us further power to make the web truly read/write without resorting to JavaScript and custom interfaces. New input types (eg <code>type=&quot;search&quot;</code>) can provide extra visual cues about input function, although of course this depends on the solutions chosen by the browser manufacturers.</p>
<p>Until now, it’s been easy to consider our domain as bounded by the viewport and the web server. But <abbr>HTML</abbr>5 is another step toward seamlessness: the merging of desktop, offline and online. For instance, the <a href="/native-drag-and-drop/">drag and drop API</a> could see the line between online and desktop experience blur further. Local storage could allow for a web-like experience in areas of poor connectivity. This convergence is clearly a good thing, but we must also design how to expose those hidden seams at the user’s request. Users should stay in control of how their locations are published and what data is synchronised to their machine.</p>
<h2>&lt;video&gt;, &lt;audio&gt;, &lt;canvas&gt;</h2>
<p>There is of course something of a reported schism between the standards world and the Flash world. Some see the advent of these new media elements (particularly <code>&lt;canvas&gt;</code>) as heralding the death of Adobe’s poster child.</p>
<p>I don&#8217;t think this is either likely or desirable. Neither technology is perfect. Flash is, of course, proprietary and thus subject to the whims of a third party that stands between browser and user. <code>&lt;canvas&gt;</code> has <a href="http://esw.w3.org/topic/HTML/AddedElementCanvas">known accessibility problems</a>. But the two can live in harmony, if we play to their respective strengths. Some current Flash applications might be better suited to <code>&lt;canvas&gt;</code>, particularly those based around dynamic visualisation: graphs, animations, infographics. Some applications will benefit from the powerful capabilities of Flash: games, heavily interactive widgets.</p>
<p>This aside, there’s clearly a user experience benefit in not having to rely on an external plugin to play rich media elements, and it will be interesting to see the uptake of the <code>&lt;video&gt;</code> and <code>&lt;audio&gt;</code> elements. Although it will initially be down to browser makers to define the interface elements involved, we will need to figure out how to integrate them into everyday web experiences. The good news is that they can be styled in the same way as any other <abbr>HTML</abbr> element. If your visual aesthetic relies on slanted images with box shadows, it&#8217;s trivial to apply this to video too.</p>
<p>That said, we can&#8217;t ignore the elephant in the room: <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-June/020620.html">the thorny codec issue</a>. I&#8217;m sure we&#8217;d all agree that the sooner it&#8217;s resolved, the better.</p>
<h2>What can designers do?</h2>
<p>Only the most patient and detail-oriented designer will relish the idea of reading the spec in full and arguing the finer points on the <a href="http://www.whatwg.org/mailing-list">WHATWG list</a>. That’s just not the way designers roll.</p>
<p>But as a community it’s important that we start talking about <abbr>HTML</abbr>5. If you&#8217;re new to <abbr>HTML</abbr>, now&#8217;s a great time to learn. The <a href="/article-archive/">articles on this site</a> and <a href="http://www.alistapart.com/articles/previewofhtml5/">A preview of HTML5</a> give useful guidance on the differences between <abbr>HTML</abbr>5 and its predecessors. Above all, designers should get chatting with their developer friends: there can’t be many left who no longer have an opinion on this technology. How do they see their practices changing? What can we do today to prepare our sites for the advent of HTML5? How can we build on its strong points to make the web a better place?</p>
<p>We don&#8217;t yet know what we&#8217;ll accomplish with <abbr>HTML</abbr>5, but then it&#8217;s not often that the vocabulary of the web changes this deeply. However, one thing is clear: if we prepare now, we have a great chance to bring innovation to our users&#8217; online lives.</p>
<p class="disclaimer">This article was jointly published on <a href="http://www.cennydd.co.uk/">Ineffable</a>, Cennydd&#8217;s personal website.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/reviewing-html5-for-web-designers/" rel="bookmark" class="crp_title">Reviewing HTML5 for Web Designers</a></li>
<li><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li>
<li><a href="http://html5doctor.com/native-audio-in-the-browser/" rel="bookmark" class="crp_title">Native Audio in the browser</a></li>
<li><a href="http://html5doctor.com/draw-attention-with-mark/" rel="bookmark" class="crp_title">Draw attention with mark</a></li>
<li><a href="http://html5doctor.com/web-directions-atmedia-2010/" rel="bookmark" class="crp_title">HTML5 Doctor at Web Directions @media</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Why%20designers%20should%20care%20about%20HTML5%20-%20http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;title=Why%20designers%20should%20care%20about%20HTML5&amp;bodytext=After%20a%20while%20on%20the%20fringes%20of%20our%20collective%20consciousness%2C%20HTML5%20is%20finally%20getting%20the%20attention%20it%20deserves.%20The%20development%20community%20%28as%20typified%20by%20the%20SuperFriends%29%20has%20come%20together%20to%20debate%20practical%20elements%20of%20the%20spec%2C%20argue%20over%20the%20inclusion%20of%20controversial%20elements%2C%20and%20assess%20the%20timeframe%20over%20which%20we%20can%20unleash%20HTML5%20in%20the%20wild." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;title=Why%20designers%20should%20care%20about%20HTML5" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;title=Why%20designers%20should%20care%20about%20HTML5&amp;notes=After%20a%20while%20on%20the%20fringes%20of%20our%20collective%20consciousness%2C%20HTML5%20is%20finally%20getting%20the%20attention%20it%20deserves.%20The%20development%20community%20%28as%20typified%20by%20the%20SuperFriends%29%20has%20come%20together%20to%20debate%20practical%20elements%20of%20the%20spec%2C%20argue%20over%20the%20inclusion%20of%20controversial%20elements%2C%20and%20assess%20the%20timeframe%20over%20which%20we%20can%20unleash%20HTML5%20in%20the%20wild." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;title=Why%20designers%20should%20care%20about%20HTML5" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Why%20designers%20should%20care%20about%20HTML5&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;t=Why%20designers%20should%20care%20about%20HTML5" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;title=Why%20designers%20should%20care%20about%20HTML5&amp;annotation=After%20a%20while%20on%20the%20fringes%20of%20our%20collective%20consciousness%2C%20HTML5%20is%20finally%20getting%20the%20attention%20it%20deserves.%20The%20development%20community%20%28as%20typified%20by%20the%20SuperFriends%29%20has%20come%20together%20to%20debate%20practical%20elements%20of%20the%20spec%2C%20argue%20over%20the%20inclusion%20of%20controversial%20elements%2C%20and%20assess%20the%20timeframe%20over%20which%20we%20can%20unleash%20HTML5%20in%20the%20wild." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Why%20designers%20should%20care%20about%20HTML5&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;t=Why%20designers%20should%20care%20about%20HTML5" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;title=Why%20designers%20should%20care%20about%20HTML5&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=After%20a%20while%20on%20the%20fringes%20of%20our%20collective%20consciousness%2C%20HTML5%20is%20finally%20getting%20the%20attention%20it%20deserves.%20The%20development%20community%20%28as%20typified%20by%20the%20SuperFriends%29%20has%20come%20together%20to%20debate%20practical%20elements%20of%20the%20spec%2C%20argue%20over%20the%20inclusion%20of%20controversial%20elements%2C%20and%20assess%20the%20timeframe%20over%20which%20we%20can%20unleash%20HTML5%20in%20the%20wild." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;h=Why%20designers%20should%20care%20about%20HTML5" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fwhy-designers-should-care-about-html5%2F&amp;t=Why%20designers%20should%20care%20about%20HTML5&amp;s=After%20a%20while%20on%20the%20fringes%20of%20our%20collective%20consciousness%2C%20HTML5%20is%20finally%20getting%20the%20attention%20it%20deserves.%20The%20development%20community%20%28as%20typified%20by%20the%20SuperFriends%29%20has%20come%20together%20to%20debate%20practical%20elements%20of%20the%20spec%2C%20argue%20over%20the%20inclusion%20of%20controversial%20elements%2C%20and%20assess%20the%20timeframe%20over%20which%20we%20can%20unleash%20HTML5%20in%20the%20wild." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/why-designers-should-care-about-html5/" rel="bookmark">Why designers should care about HTML5</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on October 14, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/why-designers-should-care-about-html5/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Native Audio in the browser</title>
		<link>http://html5doctor.com/native-audio-in-the-browser/</link>
		<comments>http://html5doctor.com/native-audio-in-the-browser/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:00:29 +0000</pubDate>
		<dc:creator>Mark Boas</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=497</guid>
		<description><![CDATA[Until very recently the ability to play any type of audio within a browser involved using Adobe Flash or other browser plugins. Although Adobe's Flash player is without doubt the most ubiquitous of these, most developers and designers would agree it is better not to rely on a plugin at all. Now thanks to HTML 5 and the browsers that implement its audio tag we can play audio natively within the browser.]]></description>
			<content:encoded><![CDATA[<p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
            <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F">
                <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
            </a>
        </div>Until recently, the ability to play any type of audio within a browser involved using Adobe Flash or other browser plugins. Although Adobe&#8217;s Flash player is unquestionably the most ubiquitous of these, most developers and designers would agree that it&#8217;s better not to rely on a plugin at all.</p>

<h2>Enter <abbr>HTML</abbr> 5 <code>&lt;audio&gt;</code></h2>

<p>One of the most exciting and long-awaited features in <abbr>HTML</abbr> 5 the <code>&lt;audio&gt;</code> element, enabling native audio playback within the browser. We can take advantage of this for browsers that support it &mdash; such as Safari 4, Firefox 3.5 and Chrome 3 &mdash; while falling back on Flash or other plugins for other browsers.</p>

<h3>According to spec</h3>

<p>Currently, the <abbr>HTML</abbr> 5 spec defines five attributes for the <code>&lt;audio&gt;</code> element:</p>

<ol>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-src"><code>src</code></a> &mdash; a valid <abbr>URL</abbr> specifying the content source</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-autobuffer"><code>autobuffer</code></a> &mdash; a boolean specifying whether the file is to be buffered in advance</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-autoplay"><code>autoplay</code></a> &mdash; a boolean specifying whether the file should play as soon as it can</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-loop"><code>loop</code></a> &mdash; a boolean specifying whether the file should be repeatedly played.</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-controls"><code>controls</code></a> &mdash; a boolean specifying whether the browser should display its default media controls</li>
</ol>

<p>Note that these are the same attributes defined for the <code>&lt;video&gt;</code> element.</p>

<h3>Examples</h3>

<p>Let&#8217;s take a couple of these attributes and create a simple example that will play an audio file:</p>

<pre><code>&lt;audio src="elvis.ogg" controls autobuffer&gt;&lt;/audio&gt;
</code></pre>

<p>(This example will work for Firefox 3.5 and Chrome 3. You&#8217;ll need to replace the Ogg file with an MP3 to get it working in Safari 4.)</p>

<p>Of course, the spec is not finalised, and there isn&#8217;t yet a consensus on which codecs to support. This table details the codecs supported by today&#8217;s browsers:</p>

<table>
  <caption>Codec support in modern browsers</caption>
  <thead>
    <tr>
      <th>Browser</th>
      <th>Ogg Vorbis</th>
      <th>MP3</th>
      <th>WAV</th>
    </tr>
  </thead>
  <tbody>
    <td>FireFox 3.5</td>
      <td>✓</td>
      <td></td>
      <td>✓</td>
    </tr>
    <tr>
      <td>Safari 4</td>
      <td></td>
      <td>✓</td>
      <td>✓</td>
    </tr>
    <tr>
      <td>Chrome 3 (beta)</td>
      <td>✓</td>
      <td>✓</td>
      <td></td>
    </tr>
    <tr>
      <td>Opera 10 (beta)</td>
      <td></td>
      <td></td>
      <td>✓</td>
    </tr>
  </tbody>
</table>

<p>To create our own controls, we can use the <abbr>API</abbr> methods defined by the spec:</p>

<ul>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-play"><code>play()</code></a> &mdash; plays the audio</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-pause"><code>pause()</code></a> &mdash; pauses the audio</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-navigator-canplaytype"><code>canPlayType()</code></a> &mdash; interrogates the browser to establish whether the given mime type can be played</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-buffered"><code>buffered()</code></a> &mdash; attribute that specifies the start and end time of the buffered part of the file</li>
</ul>

<p>Note that Opera 10 does not support the <code>&lt;audio&gt;</code> <abbr>HTML</abbr> element, but it does support the <code>Audio()</code> <abbr>API</abbr> in a basic and unique manner: from the above list, it only supports the <code>play()</code> method. </p></p>

<p>Safari 4, Firefox 3.5, and Chrome 3 beta support both <code>&lt;audio&gt;</code> and <code>Audio()</code>. Internet Explorer 8 has no native audio support whatsoever.</p>

<h2>Use the Source</h2>

<p>The best way to coerce browsers into playing audio (or video, for that matter) is to use the <code>&lt;source&gt;</code> element. The browser will try to load the first audio source, and if it fails or isn&#8217;t supported, it will move on to the next audio source. In addition, we can embed a Flash player if all else fails:</p></p>

<pre><code>&lt;audio controls autobuffer&gt;
  &lt;source src="elvis.ogg" /&gt;
  &lt;source src="elvis.mp3" /&gt;
  &lt;!-- now include flash fall back --&gt;
&lt;/audio&gt;
</code></pre>

<p>One caveat, though: you need to be careful about the order of the <code>&lt;source&gt;</code> elements. Because of a bug in Firefox, if you list the MP3 first (which Firefox doesn&#8217;t support), it will silently fail and refuse to render that particular <code>&lt;audio&gt;</code> element. The trick is to list the Ogg Vorbis file first and the other formats after. Webkit (Safari and Chrome) handle unsupported formats just fine.</p>

<p>Opera is another kettle of fish altogether, which we&#8217;ll need to solve using JavaScript.</p>

<h2>Cross-Browser Implementation</h2>

<p>When we created <a href="http://happyworm.com/jquery/jplayer">jPlayer</a>, an audio player plugin for jQuery, we were attempting to address some of the limitations of the current crop of Flash-based audio players. Many relied on Flash to implement the player&#8217;s graphical interface, effectively isolating the player from the rest of the web design process.</p>

<p>The original jPlayer relied on Flash to play the actual audio while allowing the look and feel to be styled via <abbr>HTML</abbr> and <abbr>CSS</abbr>. With growing support for <abbr>HTML</abbr> 5 in modern browsers, we were inspired to break our Flash dependency and use native audio when it was supported.</p>

<p>The most significant issue is the cross-browser implementation, where lack of a common supported audio format among browsers causes complications. If developers want to take full advantage of all browsers that support <abbr>HTML</abbr> 5 audio, they&#8217;ll need to create both MP3 and Ogg (and in Opera&#8217;s case, WAV) versions of the audio file they want to stream!</p>

<p>Our job was made more difficult by the lack of available information:</p>

<ul>
<li><a href="https://developer.mozilla.org/en/nsIDOMHTMLMediaElement">Firefox 3.5</a> &mdash; quite a detailed document</li>
<li><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/WebKitDOMRef/HTMLMediaElement_idl/Classes/HTMLMediaElement/index.html#//apple_ref/js/cl/HTMLMediaElement">Safari 4</a> &mdash; technically complete, but lacks explanations and examples</li>
<li><a href="http://www.opera.com/docs/specs/presto22/#html">Opera 10</a> &mdash; only a short note</li>
<li><a href="http://code.google.com/p/doctype/wiki/AudioElement">Chrome 3</a> &mdash; a wiki</li>
</ul>

<p>Since the <abbr>HTML</abbr> 5 standard is still a work in progress, several aspects of the <code>&lt;audio&gt;</code> element vary from browser to browser. For example, there seems to be no way to determine the load progress of an audio file. Although Safari 4 can determine how much of an audio file has downloaded, Firefox 3.5 does not yet implement the <a href="https://developer.mozilla.org/en/nsIDOMHTMLMediaElement"><code>buffered</code></a> DOM attribute. (It is, however, included as part of the Firefox&#8217;s documentation, so we presume it will be implemented.)</p>

<p>Firefox 3.5 does appear to enable &#8220;seeking&#8221; of the file, allowing you to start the download from any point in the media. Other browsers, such as Safari 4, grab the file from the beginning and only allow seeking within the part already downloaded (or wait until the particular part being seeked to has been downloaded).</p>

<p>Although these inconsistencies aren&#8217;t showstoppers, in order to compete effectively with plugin-based solutions, we believe any <abbr>HTML</abbr> 5 audio implementation should be consistent across all browsers and match current implementations feature for feature.</p>

<h3>JavaScript solutions</h3>

<p>If we intend to take advantage of each browser&#8217;s audio capabilities, we need to create different solutions for different browsers. We could use browser sniffing, but considering the rapidly changing landscape, it&#8217;s better to check what capabilities a particular browser supports and adapt accordingly.</p>

<p>To demonstrate this &#8220;feature sniffing&#8221;, we&#8217;ve created a rough and ready <a href="http://www.happyworm.com/jquery/jplayer/HTML5.Audio.Support"><abbr>HTML</abbr> 5 audio checker</a>.</p>

<p>Using JavaScript, you can check for audio tag support:</p>

<pre><code>// returns a boolean
var audioTagSupport = !!(document.createElement('audio').canPlayType);
</code></pre>

<p>or check for the <code>Audio()</code> object:</p>

<pre><code>try {
  // The 'src' parameter is mandatory in Opera 10, so have used an empty string "".
  // Otherwise, an exception is thrown.
  myAudioObj = new Audio(""); 

  audioObjSupport = !!(myAudioObj.canPlayType);
  basicAudioSupport = !!(!audioObjSupport ? myAudioObj.play : false);
} catch (e) {
  audioObjSupport = false;
  basicAudioSupport = false;
}
</code></pre>

<p>or check file type compatibility:</p>

<pre><code>// Need to check the canPlayType first or an exception
// will be thrown for those browsers that don't support it
if (myAudio.canPlayType) {

  // Currently canPlayType(type) returns: "no", "maybe" or "probably"
  canPlayOgg = ("no" != myAudio.canPlayType("audio/ogg")) &amp;#038;&amp; ("" != myAudio.canPlayType("audio/ogg"));
  canPlayMp3 = ("no" != myAudio.canPlayType("audio/mpeg")) &amp;#038;&amp; ("" != myAudio.canPlayType("audio/mpeg"));
}
</code></pre>

<p>Note that to change the <code>src</code> attribute of an audio object or element, you&#8217;ll need to recreate the object or element with the new value for its <code>src</code> attribute.</p>

<p>So, to create a solution that takes full advantage of <abbr>HTML</abbr> 5 audio, you&#8217;ll typically need to:</p>

<ol>
<li>check for HTML 5 audio support, and if not present, fall back on Flash,</li>
<li>check the level of HTML 5 audio support and adapt your code accordingly for each browser, and</li>
<li>check what file types are supported and link to appropriate formats of the files.</li>
</ol>

<h2>The Road Ahead</h2>

<p>Although <abbr>HTML</abbr> 5 audio is a relatively immature part of the standard, if recent trends continue and users upgrade to the latest versions of Safari and Firefox, browser support will likely rise above the 25% mark in the very near future. This is a significant chunk of the browser market that will no longer need to rely on Adobe&#8217;s Flash, Microsoft&#8217;s Silverlight, or any other browser plugin for audio support.</p>

<p>And when you consider that mobile and other lower-spec devices &mdash; like Apple&#8217;s iPod and iPhone (Safari), Nintendo&#8217;s Wii (Opera), and Google Android-powered devices (Chrome) &mdash; are choosing to support <abbr>HTML</abbr> 5 audio rather than Flash, you begin to paint a picture of how important native audio support will soon become.</p>

<h2>Further reading:</h2>

<ul>
<li><a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-June/020620.html">&#91;whatwg&#93; Codecs for <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code></a></li>
<li><a href="http://my.opera.com/community/forums/topic.dml?id=274889&#038;t=1247218254&#038;page=1#comment2974635">Opera 10 work around for Audio</a></li>
<li><a href="http://stackoverflow.com/questions/1007223/which-browsers-support-the-html-5-audio-tag-on-windows-today/1009015#1009015">Which browsers support <abbr>HTML</abbr> 5 <code>&lt;audio&gt;</code> on Windows today?</a></li>
</ul>

<p><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li><li><a href="http://html5doctor.com/the-video-element/" rel="bookmark" class="crp_title">The video element</a></li><li><a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/" rel="bookmark" class="crp_title">YouTube and Vimeo support HTML5 Video</a></li><li><a href="http://html5doctor.com/your-questions-answered-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</a></li><li><a href="http://html5doctor.com/legend-not-such-a-legend-anymore/" rel="bookmark" class="crp_title">Legend not such a legend anymore</a></li></ul></div></p>

<p>Share and Save:</p>

<pre><code>&lt;a rel="nofollow"  href="http://twitter.com/home?status=Native%20Audio%20in%20the%20browser%20-%20http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Twitter"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;bodytext=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="Digg"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;amp;m=submit&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Sphinn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser" title="Reddit"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;notes=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="del.icio.us"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser" title="StumbleUpon"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Technorati"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.netvibes.com/share?title=Native%20Audio%20in%20the%20browser&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Netvibes"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;t=Native%20Audio%20in%20the%20browser" title="Facebook"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;annotation=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="Google Bookmarks"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.friendfeed.com/share?title=Native%20Audio%20in%20the%20browser&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="FriendFeed"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;t=Native%20Audio%20in%20the%20browser" title="HackerNews"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;amp;summary=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="LinkedIn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;h=Native%20Audio%20in%20the%20browser" title="NewsVine"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;amp;u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;t=Native%20Audio%20in%20the%20browser&amp;amp;s=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="Tumblr"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /&gt;&lt;/a&gt;
</code></pre>

<p>&lt;br/>&lt;br/></p>
<p><a href="http://html5doctor.com/native-audio-in-the-browser/" rel="bookmark">Native Audio in the browser</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 29, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/native-audio-in-the-browser/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
	</channel>
</rss>
