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'
onload="start()"> | 6 <body style='font-family:"Lucida Console", Monaco, monospace; font-size:14px'
onload="start()"> |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 setInterval(function () { | 67 setInterval(function () { |
68 Utils.timeLog('heartbeat #' + ++heartbeatCount); | 68 Utils.timeLog('heartbeat #' + ++heartbeatCount); |
69 }, 1000); | 69 }, 1000); |
70 } | 70 } |
71 | 71 |
72 function onTimeUpdate(e) { | 72 function onTimeUpdate(e) { |
73 var video = e.target; | 73 var video = e.target; |
74 Utils.timeLog('timeupdate @ ' + video.currentTime); | 74 Utils.timeLog('timeupdate @ ' + video.currentTime); |
75 if (video.currentTime < 1) | 75 if (video.currentTime < 1) |
76 return; | 76 return; |
77 // For loadSession() tests, addKey() will not be called after | 77 |
78 // loadSession() (the key is loaded internally). Do not check keyadded | 78 // Renewal message may be fired around the start of playback; check for it |
79 // and renewal message for these tests. | 79 // after a delay to avoid timing issues. |
80 if (!testConfig.sessionToLoad) { | 80 if (testConfig.keySystem == EXTERNAL_CLEARKEY_RENEWAL && |
81 // keyadded may be fired around the start of playback; check for it | 81 !video.receivedRenewalMessage) { |
82 // after a delay to avoid timing issues. | 82 Utils.failTest('license-renewal message not received.'); |
83 if (testConfig.keySystem == EXTERNAL_CLEARKEY && | |
84 !video.receivedRenewalMessage) | |
85 Utils.failTest('license-renewal message not received.'); | |
86 } | 83 } |
| 84 |
87 Utils.timeLog('waiting for video to end.'); | 85 Utils.timeLog('waiting for video to end.'); |
88 video.removeEventListener('ended', Utils.failTest); | 86 video.removeEventListener('ended', Utils.failTest); |
89 Utils.installTitleEventHandler(video, 'ended'); | 87 Utils.installTitleEventHandler(video, 'ended'); |
90 video.removeEventListener('timeupdate', onTimeUpdate); | 88 video.removeEventListener('timeupdate', onTimeUpdate); |
91 } | 89 } |
92 | 90 |
93 function onFirstPlayEnded(e) { | 91 function onFirstPlayEnded(e) { |
94 Utils.timeLog('First play ended.'); | 92 Utils.timeLog('First play ended.'); |
95 var video = e.target; | 93 var video = e.target; |
96 video.removeEventListener('ended', onFirstPlayEnded); | 94 video.removeEventListener('ended', onFirstPlayEnded); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 .then(function(p) { | 149 .then(function(p) { |
152 player = p; | 150 player = p; |
153 play(player.video, testConfig.playTwice); | 151 play(player.video, testConfig.playTwice); |
154 }).catch(function(error) { | 152 }).catch(function(error) { |
155 Utils.timeLog(error); | 153 Utils.timeLog(error); |
156 Utils.failTest('Unable to play video.'); | 154 Utils.failTest('Unable to play video.'); |
157 }); | 155 }); |
158 } | 156 } |
159 </script> | 157 </script> |
160 </html> | 158 </html> |
OLD | NEW |