blob: 65c120ff61ae9fd58305460b7ec4a1de17301b16 [file] [log] [blame]
<!DOCTYPE html>
<html lang='en-US'>
<title>EME playback test application</title>
<body style='font-family:"Lucida Console", Monaco, monospace; font-size:14px'>
<i>Clearkey works only with content encrypted using bear key.</i><br><br>
<tr title='URL param mediaFile=...'>
<td><label for='mediaFile'>Encrypted video URL:</label></td>
<td><input id='mediaFile' type='text' size='64'></td>
<tr title='URL param licenseServerURL=...'>
<td><label for='licenseServer'>License sever URL:</label></td>
<td><input id='licenseServer' type='text' size='64'></td>
<tr title='URL param keySystem=...'>
<td><label for='keySystemList'>Key system:</label></td>
<td><select id='keySystemList'></select></td>
<tr title='URL param mediaType=...'>
<td><label for='mediaTypeList'>Media type:</label></td>
<td><select id='mediaTypeList'></select></td>
<tr title='URL param usePrefixedEME=1|0'>
<td><label for='usePrefixedEME'>EME API version:</label></td>
<td><select id='usePrefixedEME'></select></td>
<tr title='URL param useMSE=1|0'>
<td><label for='useMSE'>Load media by:</label></td>
<select id='useMSE'>
<option value='true' selected='selected'>MSE</option>
<option value='false'>src</option>
<button onclick='Play();'>Play</button>
Decoded fps: <span id='decodedFPS'></span>
Dropped fps: <span id='droppedFPS'></span>
Total dropped frames: <span id='droppedFrames'></span>
<td valign='top'><span id='video'></span></td>
<td valign='top'>
<label for='logs' onclick="toggleDisplay('logs');"><i>Click to toggle logs visibility (newest at top).</i><br></label>
<div id='logs' style='overflow: auto; height: 480px; width: 480px; white-space: nowrap; display: none'></div>
<script src='eme_player_js/app_loader.js' type='text/javascript'></script>
<script type='text/javascript'>
var testConfig = new TestConfig();
// Update document with test configuration values.
var emeApp = new EMEApp(testConfig);
function onTimeUpdate(e) {
var video =;
if (video.currentTime < 1)
// For loadSession() tests, addKey() will not be called after
// loadSession() (the key is loaded internally). Do not check keyadded
// and heartbeat for these tests.
if (!testConfig.sessionToLoad) {
// keyadded may be fired around the start of playback; check for it
// after a delay to avoid timing issues.
if (testConfig.usePrefixedEME && !video.receivedKeyAdded)
Utils.failTest('Key added event not received.');
if (testConfig.keySystem == EXTERNAL_CLEARKEY &&
Utils.failTest('Heartbeat keymessage event not received.');
video.removeEventListener('ended', Utils.failTest);
Utils.installTitleEventHandler(video, 'ended');
video.removeEventListener('timeupdate', onTimeUpdate);
function Play() {
// Update test configuration with UI elements values.
var video = emeApp.createPlayer().video;
// Ended should not fire before onTimeUpdate.
video.addEventListener('ended', Utils.failTest);
video.addEventListener('timeupdate', onTimeUpdate);;
function toggleDisplay(id) {
var element = document.getElementById(id);
if (!element)
if (['display'] != 'none')['display'] = 'none';
else['display'] = '';