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 title='URL param mediaFile=...'> |
10 <td><label for='mediaFile'>Encrypted video URL:</label></td> | 10 <td><label for='mediaFile'>Encrypted video URL:</label></td> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 testConfig.loadQueryParams(); | 62 testConfig.loadQueryParams(); |
63 // Update document with test configuration values. | 63 // Update document with test configuration values. |
64 var emeApp = new EMEApp(testConfig); | 64 var emeApp = new EMEApp(testConfig); |
65 | 65 |
66 function onTimeUpdate(e) { | 66 function onTimeUpdate(e) { |
67 var video = e.target; | 67 var video = e.target; |
68 if (video.currentTime < 1) | 68 if (video.currentTime < 1) |
69 return; | 69 return; |
70 // For loadSession() tests, addKey() will not be called after | 70 // For loadSession() tests, addKey() will not be called after |
71 // loadSession() (the key is loaded internally). Do not check keyadded | 71 // loadSession() (the key is loaded internally). Do not check keyadded |
72 // and heartbeat for these tests. | 72 // and renewal message for these tests. |
73 if (!testConfig.sessionToLoad) { | 73 if (!testConfig.sessionToLoad) { |
74 // keyadded may be fired around the start of playback; check for it | 74 // keyadded may be fired around the start of playback; check for it |
75 // after a delay to avoid timing issues. | 75 // after a delay to avoid timing issues. |
76 if (testConfig.usePrefixedEME && !video.receivedKeyAdded) | 76 if (testConfig.usePrefixedEME && !video.receivedKeyAdded) |
77 Utils.failTest('Key added event not received.'); | 77 Utils.failTest('Key added event not received.'); |
78 if (testConfig.keySystem == EXTERNAL_CLEARKEY && | 78 if (testConfig.keySystem == EXTERNAL_CLEARKEY && |
79 !video.receivedHeartbeat) | 79 !video.receivedRenewalMessage) |
80 Utils.failTest('Heartbeat keymessage event not received.'); | 80 Utils.failTest('license-renewal message not received.'); |
81 } | 81 } |
82 video.removeEventListener('ended', Utils.failTest); | 82 video.removeEventListener('ended', Utils.failTest); |
83 Utils.installTitleEventHandler(video, 'ended'); | 83 Utils.installTitleEventHandler(video, 'ended'); |
84 video.removeEventListener('timeupdate', onTimeUpdate); | 84 video.removeEventListener('timeupdate', onTimeUpdate); |
85 } | 85 } |
86 | 86 |
87 function Play(video) { | 87 function Play(video) { |
88 Utils.resetTitleChange(); | 88 Utils.resetTitleChange(); |
89 // Ended should not fire before onTimeUpdate. | 89 // Ended should not fire before onTimeUpdate. |
90 video.addEventListener('ended', Utils.failTest); | 90 video.addEventListener('ended', Utils.failTest); |
91 video.addEventListener('timeupdate', onTimeUpdate); | 91 video.addEventListener('timeupdate', onTimeUpdate); |
92 video.play(); | 92 video.play(); |
93 } | 93 } |
94 | 94 |
95 function toggleDisplay(id) { | 95 function toggleDisplay(id) { |
96 var element = document.getElementById(id); | 96 var element = document.getElementById(id); |
97 if (!element) | 97 if (!element) |
98 return; | 98 return; |
99 if (element.style['display'] != 'none') | 99 if (element.style['display'] != 'none') |
100 element.style['display'] = 'none'; | 100 element.style['display'] = 'none'; |
101 else | 101 else |
102 element.style['display'] = ''; | 102 element.style['display'] = ''; |
103 } | 103 } |
104 | 104 |
105 emeApp.createPlayer() | 105 emeApp.createPlayer() |
106 .then(function(player) { Play(player.video); }) | 106 .then(function(player) { Play(player.video); }) |
107 .catch(function(error) { Utils.failTest('Unable to play video.'); }); | 107 .catch(function(error) { Utils.failTest('Unable to play video.'); }); |
108 </script> | 108 </script> |
109 </html> | 109 </html> |
OLD | NEW |