Short URL: http://html5.org/r/2332
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2332 | Add navigator.canPlayType() to introspect video and audio types. | 2008-10-15 00:57 |
Index: source
===================================================================
--- source (revision 2331)
+++ source (revision 2332)
@@ -17809,6 +17809,9 @@
task">queued</span> in this section and its subsections is the
<span>media element event task source</span>.</p>
+ <p>The <code title="dom-navigator-canPlayType">canPlayType()</code>
+ method can be used to probe the user agent to determine what types
+ are supported.</p>
<h5>Error codes</h5>
@@ -37931,10 +37934,14 @@
readonly attribute boolean <span title="dom-navigator-onLine">onLine</span>;
void <span title="dom-navigator-registerProtocolHandler">registerProtocolHandler</span>(in DOMString protocol, in DOMString url, in DOMString title);
void <span title="dom-navigator-registerContentHandler">registerContentHandler</span>(in DOMString mimeType, in DOMString url, in DOMString title);
+
+ // abilities<!--
+ XXX cookieEnabled geolocator javaEnabled mozIsLocallyAvailable plugins preference
+ readonly attribute <span>MimeTypeArray</span> <span title="dom-navigator-mimeTypes">mimeTypes</span>;-->
+ short <span title="dom-navigator-canPlayType">canPlayType</span>(in DOMString type);
};</pre>
<!-- XXX also, see window.external.AddSearchProvider() and similar DOM APIs from IE -->
- <!-- XXX also, see: cookieEnabled geolocator javaEnabled mimeTypes mozIsLocallyAvailable plugins preference -->
<!-- XXX also, could expose languages:
<dt><dfn title="dom-navigator-browserLanguage"><code>browserLanguage</code></dfn></dt> <!- - Opera and IE only - ->
@@ -38335,6 +38342,19 @@
+ <h4>Client abilities</h4>
+
+ <p>The <dfn title="dom-navigator-canPlayType"><code>canPlayType(<var
+ title="">type</var>)</code></dfn> method must return 1 if <var
+ title="">type</var> is a MIME type that the user agent is confident
+ represents a <span>media resource</span> that it can render if used
+ in a <code>audio</code> or <code>video</code> element, 0 if it
+ cannot determine whether it could do so, and −1 if it is
+ confident that it would not be able to render resources of that
+ type.</p>
+
+
+
<h3 id="offline">Offline Web applications</h3>
<h4>Introduction</h4>