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 title='URL param mediaFile=...'> | 9 <tr> |
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 title='URL param licenseServerURL=...'> | 13 <tr> |
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 title='URL param keySystem=...'> | 17 <tr> |
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 title='URL param mediaType=...'> | 21 <tr> |
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 title='URL param usePrefixedEME=1|0'> | 25 <tr> |
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></td> | 27 <td><select id='usePrefixedEME'></select> |
| 28 </td> |
28 </tr> | 29 </tr> |
29 <tr title='URL param useSRC=1|0'> | 30 <tr> |
30 <td><label for='useSRC'>Load media by:</label></td> | 31 <td><label for='useSRC'>Load media by:</label></td> |
31 <td> | 32 <td> |
32 <select id='useSRC'> | 33 <select id='useSRC'> |
33 <option value='false' selected='selected'>MSE</option> | 34 <option value='false' selected='selected'>MSE</option> |
34 <option value='true'>src</option> | 35 <option value='true'>src</option> |
35 </select> | 36 </select> |
36 </td> | 37 </td> |
37 </tr> | 38 </tr> |
38 </table> | 39 </table> |
39 <br> | 40 <br> |
(...skipping 12 matching lines...) Expand all Loading... |
52 <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> |
53 <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> |
54 </td> | 55 </td> |
55 </tr> | 56 </tr> |
56 </table> | 57 </table> |
57 <div></div> | 58 <div></div> |
58 </body> | 59 </body> |
59 <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> |
60 <script type='text/javascript'> | 61 <script type='text/javascript'> |
61 TestConfig.updateDocument(); | 62 TestConfig.updateDocument(); |
62 | 63 function Play () { |
63 function onTimeUpdate(e) { | |
64 var video = e.target; | |
65 if (video.currentTime < 1) | |
66 return; | |
67 // For loadSession() tests, addKey() will not be called after | |
68 // loadSession() (the key is loaded internally). Do not check keyadded | |
69 // and heartbeat for these tests. | |
70 if (!TestConfig.sessionToLoad) { | |
71 // keyadded may be fired around the start of playback; check for it | |
72 // after a delay to avoid timing issues. | |
73 if (TestConfig.usePrefixedEME && !video.receivedKeyAdded) | |
74 Utils.failTest('Key added event not received.'); | |
75 if (TestConfig.keySystem == EXTERNAL_CLEARKEY && | |
76 !video.receivedHeartbeat) | |
77 Utils.failTest('Heartbeat keymessage event not received.'); | |
78 } | |
79 video.removeEventListener('ended', Utils.failTest); | |
80 Utils.installTitleEventHandler(video, 'ended'); | |
81 video.removeEventListener('timeupdate', onTimeUpdate); | |
82 } | |
83 | |
84 function Play() { | |
85 TestConfig.init(); | 64 TestConfig.init(); |
86 var video = TestApp.loadPlayer(); | 65 TestApp.play(); |
87 Utils.resetTitleChange(); | 66 }; |
88 // Ended should not fire before onTimeUpdate. | |
89 video.addEventListener('ended', Utils.failTest); | |
90 video.addEventListener('timeupdate', onTimeUpdate); | |
91 video.play(); | |
92 } | |
93 | 67 |
94 function toggleDisplay(id) { | 68 function toggleDisplay(id) { |
95 var element = document.getElementById(id); | 69 var element = document.getElementById(id); |
96 if (!element) | 70 if (!element) |
97 return; | 71 return; |
98 if (element.style['display'] != 'none') | 72 if (element.style['display'] != 'none') |
99 element.style['display'] = 'none'; | 73 element.style['display'] = 'none'; |
100 else | 74 else |
101 element.style['display'] = ''; | 75 element.style['display'] = ''; |
102 } | 76 } |
103 Play(); | 77 Play(); |
104 </script> | 78 </script> |
105 </html> | 79 </html> |
OLD | NEW |