OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html lang='en-US'> | 2 <html lang='en-US'> |
3 <head> | 3 <head> |
4 <title>EME playback test application</title> | 4 <title>EME playback test application</title> |
5 </head> | 5 </head> |
6 <body style='font-family:"Lucida Console", Monaco, monospace; font-size:14px'> | 6 <body style='font-family:"Lucida Console", Monaco, monospace; font-size:14px'> |
7 <i>Clearkey works only with content encrypted using bear key.</i><br><br> | 7 <i>Clearkey works only with content encrypted using bear key.</i><br><br> |
8 <table> | 8 <table> |
9 <tr> | 9 <tr title='URL param mediaFile=...'> |
10 <td><label for='mediaFile'>Encrypted video URL:</label></td> | 10 <td><label for='mediaFile'>Encrypted video URL:</label></td> |
11 <td><input id='mediaFile' type='text' size='64'></td> | 11 <td><input id='mediaFile' type='text' size='64'></td> |
12 </tr> | 12 </tr> |
13 <tr> | 13 <tr title='URL param licenseServerURL=...'> |
14 <td><label for='licenseServer'>License sever URL:</label></td> | 14 <td><label for='licenseServer'>License sever URL:</label></td> |
15 <td><input id='licenseServer' type='text' size='64'></td> | 15 <td><input id='licenseServer' type='text' size='64'></td> |
16 </tr> | 16 </tr> |
17 <tr> | 17 <tr title='URL param keySystem=...'> |
18 <td><label for='keySystemList'>Key system:</label></td> | 18 <td><label for='keySystemList'>Key system:</label></td> |
19 <td><select id='keySystemList'></select></td> | 19 <td><select id='keySystemList'></select></td> |
20 </tr> | 20 </tr> |
21 <tr> | 21 <tr title='URL param mediaType=...'> |
22 <td><label for='mediaTypeList'>Media type:</label></td> | 22 <td><label for='mediaTypeList'>Media type:</label></td> |
23 <td><select id='mediaTypeList'></select></td> | 23 <td><select id='mediaTypeList'></select></td> |
24 </tr> | 24 </tr> |
25 <tr> | 25 <tr title='URL param usePrefixedEME=1|0'> |
26 <td><label for='usePrefixedEME'>EME API version:</label></td> | 26 <td><label for='usePrefixedEME'>EME API version:</label></td> |
27 <td><select id='usePrefixedEME'></select> | 27 <td><select id='usePrefixedEME'></select> |
28 </td> | 28 </td> |
29 </tr> | 29 </tr> |
30 <tr> | 30 <tr title='URL param useSRC=1|0'> |
31 <td><label for='useSRC'>Load media by:</label></td> | 31 <td><label for='useSRC'>Load media by:</label></td> |
32 <td> | 32 <td> |
33 <select id='useSRC'> | 33 <select id='useSRC'> |
34 <option value='false' selected='selected'>MSE</option> | 34 <option value='false' selected='selected'>MSE</option> |
35 <option value='true'>src</option> | 35 <option value='true'>src</option> |
36 </select> | 36 </select> |
37 </td> | 37 </td> |
38 </tr> | 38 </tr> |
39 </table> | 39 </table> |
40 <br> | 40 <br> |
(...skipping 12 matching lines...) Expand all Loading... | |
53 <label for='logs' onclick="toggleDisplay('logs');"><i>Click to toggle lo gs visibility (newest at top).</i><br></label> | 53 <label for='logs' onclick="toggleDisplay('logs');"><i>Click to toggle lo gs visibility (newest at top).</i><br></label> |
54 <div id='logs' style='overflow: auto; height: 480px; width: 480px; white -space: nowrap; display: none'></div> | 54 <div id='logs' style='overflow: auto; height: 480px; width: 480px; white -space: nowrap; display: none'></div> |
55 </td> | 55 </td> |
56 </tr> | 56 </tr> |
57 </table> | 57 </table> |
58 <div></div> | 58 <div></div> |
59 </body> | 59 </body> |
60 <script src='eme_player_js/app_loader.js' type='text/javascript'></script> | 60 <script src='eme_player_js/app_loader.js' type='text/javascript'></script> |
61 <script type='text/javascript'> | 61 <script type='text/javascript'> |
62 TestConfig.updateDocument(); | 62 TestConfig.updateDocument(); |
63 function Play () { | 63 // Global video element used to access default video element from browser |
ddorwin
2014/05/30 17:42:56
Where/how does the browser do this?
If this is for
shadi
2014/05/31 00:31:37
The browser test checks for video.receivedKeyMessa
| |
64 // tests. It is set in Play() function on document load. | |
65 var video = null; | |
jrummell
2014/05/29 21:45:05
Why have a global var 'video'? onTimeUpdate() crea
shadi
2014/05/31 00:31:37
It was for the browser test code. As commented abo
| |
66 | |
67 function onTimeUpdate(e) { | |
68 var video = e.target; | |
ddorwin
2014/05/30 17:42:56
Better to avoid shadowing the global. Is there a s
shadi
2014/05/31 00:31:37
No need for global anymore. The style guide sugges
| |
69 if (video.currentTime < 1) | |
70 return; | |
71 // For loadSession() tests, addKey() will not be called after | |
72 // loadSession() (the key is loaded internally). Do not check keyadded | |
73 // and heartbeat for these tests. | |
74 if (!TestConfig.sessionToLoad) { | |
75 // keyadded may be fired around the start of playback; check for it | |
76 // after a delay to avoid timing issues. | |
77 if (TestConfig.usePrefixedEME && !video.receivedKeyAdded) | |
78 Utils.failTest('Key added event not received.'); | |
79 if (TestConfig.keySystem == EXTERNAL_CLEARKEY && | |
80 !video.receivedHeartbeat) | |
81 Utils.failTest('Heartbeat keymessage event not received.'); | |
82 } | |
83 video.removeEventListener('ended', Utils.failTest); | |
84 Utils.installTitleEventHandler(video, 'ended'); | |
85 video.removeEventListener('timeupdate', onTimeUpdate); | |
86 } | |
87 | |
88 function Play() { | |
64 TestConfig.init(); | 89 TestConfig.init(); |
65 TestApp.play(); | 90 video = TestApp.loadPlayer(); |
66 }; | 91 Utils.resetTitleChange(); |
92 // Ended should not fire before onTimeUpdate. | |
93 video.addEventListener('ended', Utils.failTest); | |
94 video.addEventListener('timeupdate', onTimeUpdate); | |
95 video.play(); | |
96 } | |
67 | 97 |
68 function toggleDisplay(id) { | 98 function toggleDisplay(id) { |
69 var element = document.getElementById(id); | 99 var element = document.getElementById(id); |
70 if (!element) | 100 if (!element) |
71 return; | 101 return; |
72 if (element.style['display'] != 'none') | 102 if (element.style['display'] != 'none') |
73 element.style['display'] = 'none'; | 103 element.style['display'] = 'none'; |
74 else | 104 else |
75 element.style['display'] = ''; | 105 element.style['display'] = ''; |
76 } | 106 } |
77 Play(); | 107 Play(); |
78 </script> | 108 </script> |
79 </html> | 109 </html> |
OLD | NEW |