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></td> |
28 </td> | |
29 </tr> | 28 </tr> |
30 <tr> | 29 <tr title='URL param useSRC=1|0'> |
31 <td><label for='useSRC'>Load media by:</label></td> | 30 <td><label for='useSRC'>Load media by:</label></td> |
32 <td> | 31 <td> |
33 <select id='useSRC'> | 32 <select id='useSRC'> |
34 <option value='false' selected='selected'>MSE</option> | 33 <option value='false' selected='selected'>MSE</option> |
35 <option value='true'>src</option> | 34 <option value='true'>src</option> |
36 </select> | 35 </select> |
37 </td> | 36 </td> |
38 </tr> | 37 </tr> |
39 </table> | 38 </table> |
40 <br> | 39 <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> | 52 <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> | 53 <div id='logs' style='overflow: auto; height: 480px; width: 480px; white
-space: nowrap; display: none'></div> |
55 </td> | 54 </td> |
56 </tr> | 55 </tr> |
57 </table> | 56 </table> |
58 <div></div> | 57 <div></div> |
59 </body> | 58 </body> |
60 <script src='eme_player_js/app_loader.js' type='text/javascript'></script> | 59 <script src='eme_player_js/app_loader.js' type='text/javascript'></script> |
61 <script type='text/javascript'> | 60 <script type='text/javascript'> |
62 TestConfig.updateDocument(); | 61 TestConfig.updateDocument(); |
63 function Play () { | 62 |
| 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() { |
64 TestConfig.init(); | 85 TestConfig.init(); |
65 TestApp.play(); | 86 var video = TestApp.loadPlayer(); |
66 }; | 87 Utils.resetTitleChange(); |
| 88 // Ended should not fire before onTimeUpdate. |
| 89 video.addEventListener('ended', Utils.failTest); |
| 90 video.addEventListener('timeupdate', onTimeUpdate); |
| 91 video.play(); |
| 92 } |
67 | 93 |
68 function toggleDisplay(id) { | 94 function toggleDisplay(id) { |
69 var element = document.getElementById(id); | 95 var element = document.getElementById(id); |
70 if (!element) | 96 if (!element) |
71 return; | 97 return; |
72 if (element.style['display'] != 'none') | 98 if (element.style['display'] != 'none') |
73 element.style['display'] = 'none'; | 99 element.style['display'] = 'none'; |
74 else | 100 else |
75 element.style['display'] = ''; | 101 element.style['display'] = ''; |
76 } | 102 } |
77 Play(); | 103 Play(); |
78 </script> | 104 </script> |
79 </html> | 105 </html> |
OLD | NEW |