W3C home > Mailing lists > Public > public-html-commits@w3.org > February 2010

html5/spec-author-view Overview.html,1.653,1.654 spec.html,1.658,1.659 video.html,1.568,1.569

From: Michael Smith via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 10 Feb 2010 02:37:02 +0000
To: public-html-commits@w3.org
Message-Id: <E1Nf2Rq-0001Tf-Et@lionel-hutz.w3.org>
Update of /sources/public/html5/spec-author-view
In directory hutz:/tmp/cvs-serv5659

Modified Files:
	Overview.html spec.html video.html 
Log Message:
Add an example of forcing fallback from <source>. (whatwg r4685)

[updated by splitter]


Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec-author-view/Overview.html,v
retrieving revision 1.653
retrieving revision 1.654
diff -u -d -r1.653 -r1.654
--- Overview.html	10 Feb 2010 02:17:01 -0000	1.653
+++ Overview.html	10 Feb 2010 02:36:59 -0000	1.654
@@ -302,7 +302,7 @@
    </dl><p>This specification is available in the following formats: 
     <a href="spec.html">single page HTML</a>,
     <a href="Overview.html">multipage HTML</a>.
-This is revision 1.3738.
+This is revision 1.3739.
    </p> 
    <p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
    &#169; 2009 <a href="http://www.w3.org/"><abbr title="World Wide

Index: video.html
===================================================================
RCS file: /sources/public/html5/spec-author-view/video.html,v
retrieving revision 1.568
retrieving revision 1.569
diff -u -d -r1.568 -r1.569
--- video.html	6 Feb 2010 10:57:04 -0000	1.568
+++ video.html	10 Feb 2010 02:37:00 -0000	1.569
@@ -580,7 +580,29 @@
   <a href="#media-resource">media resource</a> is useful to the user before fetching
   it. Its value must be a <a href="common-microsyntaxes.html#valid-media-query">valid media query</a>.</p><p id="source-default-media">The default, if the <code title="attr-srouce-media">media</code> attribute is omitted, is
   "<code title="">all</code>", meaning that by default the <a href="#media-resource">media
-  resource</a> is suitable for all media.</p><h4 id="media-elements"><span class="secno">4.8.9 </span>Media elements</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><p><dfn id="media-element" title="media element">Media elements</dfn> implement the
+  resource</a> is suitable for all media.</p><div class="example">
+
+   <p>If the author isn't sure if the user agents will all be able to
+   render the media resources provided, the author can listen to the
+   <code title="event-error">error</code> event on the last
+   <code><a href="#the-source-element">source</a></code> element and trigger fallback behaviour:</p>
+
+   <pre>&lt;video controls autoplay&gt;
+ &lt;source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'&gt;
+ &lt;source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
+         onerror="fallback(parentNode)"&gt;
+ ...
+&lt;/video&gt;
+&lt;script&gt;
+ function fallback(video) {
+   // replace &lt;video&gt; with its contents
+   while (video.hasChildNodes())
+     video.parentNode.insertBefore(video.firstChild, video);
+   video.parentNode.removeChild(video);
+ }
+&lt;/script&gt;</pre>
+
+  </div><h4 id="media-elements"><span class="secno">4.8.9 </span>Media elements</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><p><dfn id="media-element" title="media element">Media elements</dfn> implement the
   following interface:</p><pre class="idl">interface <dfn id="htmlmediaelement">HTMLMediaElement</dfn> : <a href="elements.html#htmlelement">HTMLElement</a> {
 
   // error state

Index: spec.html
===================================================================
RCS file: /sources/public/html5/spec-author-view/spec.html,v
retrieving revision 1.658
retrieving revision 1.659
diff -u -d -r1.658 -r1.659
--- spec.html	10 Feb 2010 02:17:01 -0000	1.658
+++ spec.html	10 Feb 2010 02:36:59 -0000	1.659
@@ -300,7 +300,7 @@
    </dl><p>This specification is available in the following formats: 
     <a href=spec.html>single page HTML</a>,
     <a href=Overview.html>multipage HTML</a>.
-This is revision 1.3738.
+This is revision 1.3739.
    </p> 
    <p class=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a>
    © 2009 <a href=http://www.w3.org/><abbr title="World Wide
@@ -10501,7 +10501,29 @@
   <a href=#media-resource>media resource</a> is useful to the user before fetching
   it. Its value must be a <a href=#valid-media-query>valid media query</a>.</p><p id=source-default-media>The default, if the <code title=attr-srouce-media>media</code> attribute is omitted, is
   "<code title="">all</code>", meaning that by default the <a href=#media-resource>media
-  resource</a> is suitable for all media.</p><h4 id=media-elements><span class=secno>4.8.9 </span>Media elements</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><p><dfn id=media-element title="media element">Media elements</dfn> implement the
+  resource</a> is suitable for all media.</p><div class=example>
+
+   <p>If the author isn't sure if the user agents will all be able to
+   render the media resources provided, the author can listen to the
+   <code title=event-error>error</code> event on the last
+   <code><a href=#the-source-element>source</a></code> element and trigger fallback behaviour:</p>
+
+   <pre>&lt;video controls autoplay&gt;
+ &lt;source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'&gt;
+ &lt;source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
+         onerror="fallback(parentNode)"&gt;
+ ...
+&lt;/video&gt;
+&lt;script&gt;
+ function fallback(video) {
+   // replace &lt;video&gt; with its contents
+   while (video.hasChildNodes())
+     video.parentNode.insertBefore(video.firstChild, video);
+   video.parentNode.removeChild(video);
+ }
+&lt;/script&gt;</pre>
+
+  </div><h4 id=media-elements><span class=secno>4.8.9 </span>Media elements</h4><p class="XXX annotation"><b>Status: </b><i>Last call for comments</i></p><p><dfn id=media-element title="media element">Media elements</dfn> implement the
   following interface:</p><pre class=idl>interface <dfn id=htmlmediaelement>HTMLMediaElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
 
   // error state
Received on Wednesday, 10 February 2010 02:37:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 February 2010 02:37:04 GMT