1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file contains global constant variables used by the application.
7 // Heart beat message header.
8 var HEART_BEAT_HEADER = 'HEARTBEAT';
10 // Default key used to encrypt many media files used in browser tests.
11 var KEY = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
12 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
14 var DEFAULT_LICENSE_SERVER = document.location.origin + '/license_server';
16 var DEFAULT_MEDIA_FILE = 'http://shadi.kir/alcatraz/Chrome_44-enc_av.webm';
18 // Key ID used for init data.
19 var KEY_ID = '0123456789012345';
21 // Unique strings to identify test result expectations.
22 var KEY_ERROR = 'KEY_ERROR';
23 var FILE_IO_TEST_RESULT_HEADER = 'FILEIOTESTRESULT';
24 var FILE_IO_TEST_SUCCESS = 'FILE_IO_TEST_SUCCESS';
25 var PREFIXED_API_LOAD_SESSION_HEADER = 'LOAD_SESSION|';
26 var NOTSUPPORTEDERROR = 'NOTSUPPORTEDERROR';
28 // Available EME key systems to use.
29 var PREFIXED_CLEARKEY = 'webkit-org.w3.clearkey';
30 var CLEARKEY = 'org.w3.clearkey';
31 var EXTERNAL_CLEARKEY = 'org.chromium.externalclearkey';
32 var WIDEVINE_KEYSYSTEM = 'com.widevine.alpha';
33 var FILE_IO_TEST_KEYSYSTEM = 'org.chromium.externalclearkey.fileiotest';
34 var EME_PREFIXED_VERSION = 'Prefixed EME (v 0.1b)';
35 var EME_UNPREFIXED_VERSION = 'Unprefixed EME (Working draft)';
37 // Key system name:value map to show on the document page.
39 'Widevine': WIDEVINE_KEYSYSTEM,
41 'External Clearkey': EXTERNAL_CLEARKEY
44 // General WebM and MP4 name:content_type map to show on the document page.
46 'WebM - Audio Video': 'video/webm; codecs="vorbis, vp8"',
47 'WebM - Video Only': 'video/webm; codecs="vp8"',
48 'WebM - Audio Only': 'video/webm; codecs="vorbis"',
49 'MP4 - Video Only': 'video/mp4; codecs="avc1.4D4041"',
50 'MP4 - Audio Only': 'audio/mp4; codecs="mp4a.40.2"'
53 // Update the EME versions list by checking runtime support by the browser.
54 var EME_VERSIONS_OPTIONS = {};
55 EME_VERSIONS_OPTIONS[EME_UNPREFIXED_VERSION] = EME_UNPREFIXED_VERSION;
56 EME_VERSIONS_OPTIONS[EME_PREFIXED_VERSION] = EME_PREFIXED_VERSION;
58 var EME_DISABLED_OPTIONS = [];
59 if (!document.createElement('video').webkitAddKey)
60 EME_DISABLED_OPTIONS.push(EME_PREFIXED_VERSION);
61 if (!document.createElement('video').setMediaKeys)
62 EME_DISABLED_OPTIONS.push(EME_UNPREFIXED_VERSION);
64 // Global document elements ID's.
65 var VIDEO_ELEMENT_ID = 'video';
66 var MEDIA_FILE_ELEMENT_ID = 'mediaFile';
67 var LICENSE_SERVER_ELEMENT_ID = 'licenseServer';
68 var KEYSYSTEM_ELEMENT_ID = 'keySystemList';
69 var MEDIA_TYPE_ELEMENT_ID = 'mediaTypeList';
70 var USE_MSE_ELEMENT_ID = 'useMSE';
71 var USE_PREFIXED_EME_ID = 'usePrefixedEME';
73 // These variables get updated every second, so better to have global pointers.
74 var decodedFPSElement = document.getElementById('decodedFPS');
75 var droppedFPSElement = document.getElementById('droppedFPS');
76 var droppedFramesElement = document.getElementById('droppedFrames');
77 var docLogs = document.getElementById('logs');