HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2332Add navigator.canPlayType() to introspect video and audio types.2008-10-15 00:57
@@ -17802,20 +17802,23 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {
 
   <p><span title="media element">Media elements</span> use two <span
   title="task queue">task queues</span>, the <dfn>media element event
   task source</dfn> for asynchronous events and callbacks, and the
   <dfn>media element new resource task source</dfn> for handling
   implicit loads. Unless otherwise specified, the <span>task
   source</span> for all the tasks <span title="queue a
   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>
 
   <p>All <span title="media element">media elements</span> have an
   associated error status, which records the last error the element
   encountered since the <code title="dom-media-load">load()</code>
   method was last invoked. The <dfn
   title="dom-media-error"><code>error</code></dfn> attribute, on
   getting, must return the <code>MediaError</code> object created for
@@ -37924,24 +37927,28 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   readonly attribute DOMString <span title="dom-navigator-appCodeName">appCodeName</span>;-->
   readonly attribute DOMString <span title="dom-navigator-appName">appName</span>;
   readonly attribute DOMString <span title="dom-navigator-appVersion">appVersion</span>;
   readonly attribute DOMString <span title="dom-navigator-platform">platform</span>;
   readonly attribute DOMString <span title="dom-navigator-userAgent">userAgent</span>;
 
   // system state
   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 - ->
    <dd><p>Must return either null or a language code representing the language the browser uses in its interface.</p></dd>
    <dt><dfn title="dom-navigator-userLanguage"><code>userLanguage</code></dfn></dt> <!- - Opera and IE only - ->
    <dt><dfn title="dom-navigator-language"><code>language</code></dfn></dt> <!- - Opera, Safari, and Mozilla only - ->
    <dd><p>Must return either null or a language code representing the user's preferred language.</p></dd>
    -->
 
 
@@ -38328,20 +38335,33 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
   "http://kittens.example.org/?show=x-meow%3AS2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
 
   <p>The <code
   title="dom-navigator-registerContentHandler">registerContentHandler()</code>
   method would work equivalently, but for unknown MIME types instead
   of unknown protocols.</p>
 
 
 
 
+  <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 &#x2212;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>
 
   <p><em>This section is non-normative.</em></p>
 
   <p class="XXX">...</p>
 
 
   <h4 id="appcache">Application caches</h4>

|