Bug 19009 - A MediaKeys should belong to a single HTMLMediaElement
authorAdrian Bateman <adrianba@microsoft.com>
Tue, 02 Jul 2013 07:32:53 -0700
changeset 134 f4d8dc9bdacc
parent 133 1032b19ff6e9
child 135 7fba91203de5
Bug 19009 - A MediaKeys should belong to a single HTMLMediaElement
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
encrypted-media/spec-html.xsl
--- a/encrypted-media/encrypted-media.html	Tue Jun 25 07:46:12 2013 -0700
+++ b/encrypted-media/encrypted-media.html	Tue Jul 02 07:32:53 2013 -0700
@@ -57,7 +57,7 @@
     <div class="head">
       <p><a href="http://www.w3.org/"><img src="https://www.w3.org/Icons/w3c_home" alt="W3C" width="72" height="48"></a></p>
       <h1>Encrypted Media Extensions</h1>
-      <h2 id="draft-date">W3C Editor's Draft 4 June 2013</h2>
+      <h2 id="draft-date">W3C Editor's Draft 2 July 2013</h2>
       <dl>
         <dt>This Version:</dt>
         <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html">http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html</a></dd>
@@ -307,11 +307,14 @@
     
     <ol>
       <li>
-<p>If loading has not started, throw an <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code>.</p>
+<p>If loading has not started, throw an <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these steps.</p>
       <p class="non-normative">In general, applications should wait for an event named <code><a href="#dom-needkey">needkey</a></code> or <code><a href="http://www.w3.org/TR/html5/embedded-content-0.html#event-media-loadstart">loadstart</a></code> (per the <a href="http://www.w3.org/TR/html5/embedded-content-0.html#concept-media-load-resource">resource fetch algorithm</a>) before calling this method.</p>
       </li>
+      <li><p>If the <code><a href="#dom-mediakeys">MediaKeys</a></code> object is already in use and the user agent is unable to re-use it with this element, throw a <code><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-quota_exceeded_err">QUOTA_EXCEEDED_ERR</a></code> exception and abort these steps.</p></li>
       <li>Set the <code><a href="#dom-keys">keys</a></code> attribute of the media element to <var>mediaKeys</var>.</li>
     </ol>
+    
+    <p class="non-normative">Note: In some implementations, <code><a href="#dom-mediakeysession">MediaKeySession</a></code> objects created by <code><a href="#dom-createsession">createSession()</a></code> may not fire any events until the <code><a href="#dom-mediakeys">MediaKeys</a></code> object is associated with a media element with <code><a href="#dom-setmediakeys">setMediaKeys()</a></code>.</p>
 
     <p>The <dfn id="dom-onneedkey"><code>onneedkey</code></dfn> event handler for the <code><a href="#dom-needkey">needkey</a></code> event must be supported by all HTMLMediaElements as both a content attribute and an IDL attribute.</p>
 
--- a/encrypted-media/encrypted-media.xml	Tue Jun 25 07:46:12 2013 -0700
+++ b/encrypted-media/encrypted-media.xml	Tue Jul 02 07:32:53 2013 -0700
@@ -56,7 +56,7 @@
     <div class="head">
       <p><a href="http://www.w3.org/"><img src="https://www.w3.org/Icons/w3c_home" alt="W3C" width="72" height="48" /></a></p>
       <h1>Encrypted Media Extensions</h1>
-      <h2 id="draft-date">W3C Editor's Draft 4 June 2013</h2>
+      <h2 id="draft-date">W3C Editor's Draft 2 July 2013</h2>
       <dl>
         <dt>This Version:</dt>
         <dd><a href="http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html">http://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html</a></dd>
@@ -302,11 +302,14 @@
     <p>The <methoddfn name="setMediaKeys">setMediaKeys</methoddfn> method provides the <coderef>MediaKeys</coderef> to use. When calling this method, the media element must run the following steps:</p>
     
     <ol>
-      <li><p>If loading has not started, throw an <invalid-state-err/>.</p>
+      <li><p>If loading has not started, throw an <invalid-state-err/> exception and abort these steps.</p>
       <p class="non-normative">In general, applications should wait for an event named <coderef>needkey</coderef> or <videoref name="event-media-loadstart">loadstart</videoref> (per the <resource-fetch-algorithm/>) before calling this method.</p>
       </li>
+      <li><p>If the <coderef>MediaKeys</coderef> object is already in use and the user agent is unable to re-use it with this element, throw a <quota-exceeded-err/> exception and abort these steps.</p></li>
       <li>Set the <coderef>keys</coderef> attribute of the media element to <var>mediaKeys</var>.</li>
     </ol>
+    
+    <p class="non-normative">Note: In some implementations, <coderef>MediaKeySession</coderef> objects created by <methodref>createSession</methodref> may not fire any events until the <coderef>MediaKeys</coderef> object is associated with a media element with <methodref>setMediaKeys</methodref>.</p>
 
     <p>The <codedfn>onneedkey</codedfn> event handler for the <coderef>needkey</coderef> event must be supported by all HTMLMediaElements as both a content attribute and an IDL attribute.</p>
 
--- a/encrypted-media/spec-html.xsl	Tue Jun 25 07:46:12 2013 -0700
+++ b/encrypted-media/spec-html.xsl	Tue Jul 02 07:32:53 2013 -0700
@@ -96,6 +96,10 @@
     <code><a><xsl:attribute name="href">http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-type_mismatch_err</xsl:attribute>TYPE_MISMATCH_ERR</a></code>
   </xsl:template>
 
+  <xsl:template match="//quota-exceeded-err">
+    <code><a><xsl:attribute name="href">http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-quota_exceeded_err</xsl:attribute>QUOTA_EXCEEDED_ERR</a></code>
+  </xsl:template>
+
   <xsl:template match="//readystate">
     <code title="dom-media-readyState"><a><xsl:attribute name="href">http://www.w3.org/TR/html5/embedded-content-0.html#dom-media-readystate</xsl:attribute>readyState</a></code>
   </xsl:template>