| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../encrypted-media/encrypted-media-utils.js"></script> |
| 4 </head> |
| 5 <body> |
| 6 <script> |
| 7 var initDataType; |
| 8 var initData; |
| 9 var mediaKeySession; |
| 10 |
| 11 window.onmessage = function(e) { |
| 12 if (e.data.comm == 'init') { |
| 13 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimpleCo
nfiguration()).then(function(access) { |
| 14 initDataType = access.getConfiguration().initDataTypes[0
]; |
| 15 initData = getInitData(initDataType); |
| 16 return access.createMediaKeys(); |
| 17 }).then(function(mediaKeys) { |
| 18 mediaKeySession = mediaKeys.createSession(); |
| 19 return mediaKeySession.generateRequest(initDataType, initData); |
| 20 }).then(function() { |
| 21 window.parent.postMessage({comm: 'init-completed'}, '*'); |
| 22 }); |
| 23 } else if (e.data.comm == 'close') { |
| 24 window.parent.postMessage({comm: 'close-received'}, '*'); |
| 25 mediaKeySession.close().catch(function(error) { |
| 26 window.parent.postMessage({result: 'error'}, '*'); |
| 27 }); |
| 28 } |
| 29 }; |
| 30 </script>' |
| 31 </body> |
| 32 </html> |
| OLD | NEW |