Bug 18928 - Update examples to use addEventListener instead of onkeyadded, onkeymessage, and onkeyerror
authorAdrian Bateman <adrianba@microsoft.com>
Fri, 03 May 2013 08:50:35 -0700
changeset 110 29422cdbc179
parent 109 f00bca89a115
child 111 8bf3e9ae4112
Bug 18928 - Update examples to use addEventListener instead of onkeyadded, onkeymessage, and onkeyerror
encrypted-media/encrypted-media.html
encrypted-media/encrypted-media.xml
--- a/encrypted-media/encrypted-media.html	Fri May 03 08:44:26 2013 -0700
+++ b/encrypted-media/encrypted-media.html	Fri May 03 08:50:35 2013 -0700
@@ -1007,7 +1007,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<a href="#dom-keymessage">keymessage</a>="handleMessage(event)";
+    keySession.addEventListener("<a href="#dom-keymessage">keymessage</a>",handleMessage,false);
   }
 
   function handleMessage(event) {
@@ -1047,7 +1047,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<a href="#dom-keymessage">keymessage</a>="handleMessage(event)";
+    keySession.addEventListener("<a href="#dom-keymessage">keymessage</a>",handleMessage,false);
   }
 
   function handleMessage(event) {
@@ -1088,7 +1088,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<a href="#dom-keymessage">keymessage</a>="licenseRequestReady(event)";
+    keySession.addEventListener("<a href="#dom-keymessage">keymessage</a>",licenseRequestReady,false);
   }
 
   function licenseRequestReady(event) {
@@ -1153,7 +1153,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<a href="#dom-keymessage">keymessage</a>="licenseRequestReady(event)";
+    keySession.addEventListener("<a href="#dom-keymessage">keymessage</a>",licenseRequestReady,false);
   }
   
   function licenseRequestReady(event) {
@@ -1233,9 +1233,9 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<a href="#dom-keymessage">keymessage</a>="handleKeyMessage(event)";
-    keySession.on<a href="#dom-keyadded">keyadded</a>="handleKeyComplete(event)";
-    keySession.on<a href="#dom-keyerror">keyerror</a>="handleKeyError(event)";
+    keySession.addEventListener("<a href="#dom-keymessage">keymessage</a>",handleKeyMessage,false);
+    keySession.addEventListener("<a href="#dom-keyadded">keyadded</a>",handleKeyComplete,false);
+    keySession.addEventListener("<a href="#dom-keyerror">keyerror</a>",handleKeyError,false);
   }
 &lt;/script&gt;
 
--- a/encrypted-media/encrypted-media.xml	Fri May 03 08:44:26 2013 -0700
+++ b/encrypted-media/encrypted-media.xml	Fri May 03 08:50:35 2013 -0700
@@ -957,7 +957,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<precoderef>keymessage</precoderef>="handleMessage(event)";
+    keySession.addEventListener("<precoderef>keymessage</precoderef>",handleMessage,false);
   }
 
   function handleMessage(event) {
@@ -997,7 +997,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<precoderef>keymessage</precoderef>="handleMessage(event)";
+    keySession.addEventListener("<precoderef>keymessage</precoderef>",handleMessage,false);
   }
 
   function handleMessage(event) {
@@ -1038,7 +1038,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<precoderef>keymessage</precoderef>="licenseRequestReady(event)";
+    keySession.addEventListener("<precoderef>keymessage</precoderef>",licenseRequestReady,false);
   }
 
   function licenseRequestReady(event) {
@@ -1103,7 +1103,7 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<precoderef>keymessage</precoderef>="licenseRequestReady(event)";
+    keySession.addEventListener("<precoderef>keymessage</precoderef>",licenseRequestReady,false);
   }
   
   function licenseRequestReady(event) {
@@ -1183,9 +1183,9 @@
     if (!keySession)
       throw "Could not create key session";
 
-    keySession.on<precoderef>keymessage</precoderef>="handleKeyMessage(event)";
-    keySession.on<precoderef>keyadded</precoderef>="handleKeyComplete(event)";
-    keySession.on<precoderef>keyerror</precoderef>="handleKeyError(event)";
+    keySession.addEventListener("<precoderef>keymessage</precoderef>",handleKeyMessage,false);
+    keySession.addEventListener("<precoderef>keyadded</precoderef>",handleKeyComplete,false);
+    keySession.addEventListener("<precoderef>keyerror</precoderef>",handleKeyError,false);
   }
 &lt;/script&gt;