Bug 20337 - Make MediaKeys attachment a method instead of an attribute
authorAdrian Bateman <adrianba@microsoft.com>
Tue, 08 Jan 2013 07:58:36 -0800
changeset 58 bf8f17de0a92
parent 57 ad438a9c7b42
child 59 ac33b782ee55
Bug 20337 - Make MediaKeys attachment a method instead of an attribute
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Fri Jan 04 11:02:23 2013 -0800
+++ b/encrypted-media/encrypted-media.html	Tue Jan 08 07:58:36 2013 -0800
@@ -20,7 +20,7 @@
     <div class="head">
       <p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" width="72" height="48"></a></p>
       <h1>Encrypted Media Extensions</h1>
-      <h2>W3C Editor's Draft 17 December 2012</h2>
+      <h2>W3C Editor's Draft 8 January 2013</h2>
       <h2><font color="red">Work in progress. For the latest stable revision, see <a href="http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html">v0.1b</a>.</font></h2>
       <dl>
   <dt>Latest published version:</dt>
@@ -237,7 +237,8 @@
   DOMString <a href="#dom-canplaytype">canPlayType</a>(DOMString type, DOMstring? <a href="#key-system">keySystem</a>);
 
   // Encrypted Media
-  attribute <a href="#dom-mediakeys">MediaKeys</a> <a href="#dom-keys">keys</a>;
+  readonly attribute <a href="#dom-mediakeys">MediaKeys</a> <a href="#dom-keys">keys</a>;
+  void <a href="#dom-setmediakeys">setMediaKeys</a>(<a href="#dom-mediakeys">MediaKeys</a> mediaKeys);
   
   attribute <a href="http://dev.w3.org/html5/spec/webappapis.html#eventhandler">EventHandler</a> <a href="#dom-onneedkey">onneedkey</a>;
 };
@@ -305,14 +306,15 @@
       <li><p>Return "maybe" or "probably" as appropriate per the existing specification of <code><a href="http://dev.w3.org/html5/spec/video.html#dom-navigator-canplaytype">canPlayType()</a></code>.</p></li>
     </ol>
 
-    <p>The <dfn id="dom-keys"><code>keys</code></dfn> attribute is a <code><a href="#dom-mediakeys">MediaKeys</a></code> to be used when decrypting encrypted <a href="http://dev.w3.org/html5/spec/video.html#media-data">media data</a> for this <a href="#media-element">media element</a>.</p>
-    <p>When setting this attribute, the media element must run the following steps:</p>
+    <p>The <dfn id="dom-keys"><code>keys</code></dfn> attribute is the <code><a href="#dom-mediakeys">MediaKeys</a></code> being used when decrypting encrypted <a href="http://dev.w3.org/html5/spec/video.html#media-data">media data</a> for this <a href="#media-element">media element</a>.</p>
+    <p>The <dfn id="dom-setmediakeys"><code>setMediaKeys</code></dfn> method provides the <code><a href="#dom-mediakeys">MediaKeys</a></code> 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 <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 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://dev.w3.org/html5/spec/video.html#event-media-loadstart">loadstart</a></code> (per the <a href="http://dev.w3.org/html5/spec/video.html#concept-media-load-resource">resource fetch algorithm</a>) before calling this method.</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>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	Fri Jan 04 11:02:23 2013 -0800
+++ b/encrypted-media/encrypted-media.xml	Tue Jan 08 07:58:36 2013 -0800
@@ -19,7 +19,7 @@
     <div class="head">
       <p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" width="72" height="48" /></a></p>
       <h1>Encrypted Media Extensions</h1>
-      <h2>W3C Editor's Draft 17 December 2012</h2>
+      <h2>W3C Editor's Draft 8 January 2013</h2>
       <h2><font color="red">Work in progress. For the latest stable revision, see <a href="http://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html">v0.1b</a>.</font></h2>
       <dl>
   <dt>Latest published version:</dt>
@@ -233,7 +233,8 @@
   DOMString <premethodref>canPlayType</premethodref>(DOMString type, DOMstring? <a href="#key-system">keySystem</a>);
 
   // Encrypted Media
-  attribute <precoderef>MediaKeys</precoderef> <precoderef>keys</precoderef>;
+  readonly attribute <precoderef>MediaKeys</precoderef> <precoderef>keys</precoderef>;
+  void <premethodref>setMediaKeys</premethodref>(<precoderef>MediaKeys</precoderef> mediaKeys);
   
   attribute <EventHandler/> <precoderef>onneedkey</precoderef>;
 };
@@ -299,13 +300,14 @@
       <li><p>Return "maybe" or "probably" as appropriate per the existing specification of <videoref name="dom-navigator-canplaytype">canPlayType()</videoref>.</p></li>
     </ol>
 
-    <p>The <codedfn>keys</codedfn> attribute is a <coderef>MediaKeys</coderef> to be used when decrypting encrypted <videoanchor name="media-data">media data</videoanchor> for this <a href="#media-element">media element</a>.</p>
-    <p>When setting this attribute, the media element must run the following steps:</p>
+    <p>The <codedfn>keys</codedfn> attribute is the <coderef>MediaKeys</coderef> being used when decrypting encrypted <videoanchor name="media-data">media data</videoanchor> for this <a href="#media-element">media element</a>.</p>
+    <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>
       <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>Set the <coderef>keys</coderef> attribute of the media element to <var>mediaKeys</var>.</li>
     </ol>
 
     <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>