OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains global constant variables used by the application. | 5 // This file contains global constant variables used by the application. |
6 | 6 |
7 // Heart beat message header. | 7 // Heart beat message header. |
8 var HEART_BEAT_HEADER = 'HEARTBEAT'; | 8 var HEART_BEAT_HEADER = 'HEARTBEAT'; |
9 | 9 |
10 // Default key used to encrypt many media files used in browser tests. | 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, | 11 var KEY = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b, |
12 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]); | 12 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]); |
13 | 13 |
14 var DEFAULT_LICENSE_SERVER = document.location.origin + '/license_server'; | 14 var DEFAULT_LICENSE_SERVER = document.location.origin + '/license_server'; |
15 | 15 |
16 var DEFAULT_MEDIA_FILE = 'http://shadi.kir/alcatraz/Chrome_44-enc_av.webm'; | 16 var DEFAULT_MEDIA_FILE = 'http://shadi.kir/alcatraz/Chrome_44-enc_av.webm'; |
17 | 17 |
18 // Key ID used for init data. | 18 // Key ID used for init data. |
19 var KEY_ID = '0123456789012345'; | 19 var KEY_ID = '0123456789012345'; |
20 | 20 |
21 // Unique strings to identify test result expectations. | |
22 var KEY_ERROR = 'KEY_ERROR'; | |
23 | |
21 // Available EME key systems to use. | 24 // Available EME key systems to use. |
22 var PREFIXED_CLEARKEY = 'webkit-org.w3.clearkey'; | 25 var PREFIXED_CLEARKEY = 'webkit-org.w3.clearkey'; |
23 var CLEARKEY = 'org.w3.clearkey'; | 26 var CLEARKEY = 'org.w3.clearkey'; |
24 var EXTERNAL_CLEARKEY = 'org.chromium.externalclearkey'; | 27 var EXTERNAL_CLEARKEY = 'org.chromium.externalclearkey'; |
25 var WIDEVINE_KEYSYSTEM = 'com.widevine.alpha'; | 28 var WIDEVINE_KEYSYSTEM = 'com.widevine.alpha'; |
26 | 29 |
27 // Key system name:value map to show on the document page. | 30 // Key system name:value map to show on the document page. |
28 var KEY_SYSTEMS = { | 31 var KEY_SYSTEMS = { |
29 'Widevine': WIDEVINE_KEYSYSTEM, | 32 'Widevine': WIDEVINE_KEYSYSTEM, |
30 'Clearkey': CLEARKEY, | 33 'Clearkey': CLEARKEY, |
31 'External Clearkey': EXTERNAL_CLEARKEY | 34 'External Clearkey': EXTERNAL_CLEARKEY |
32 }; | 35 }; |
33 | 36 |
34 // General WebM and MP4 name:content_type map to show on the document page. | 37 // General WebM and MP4 name:content_type map to show on the document page. |
35 var MEDIA_TYPES = { | 38 var MEDIA_TYPES = { |
36 'WebM - Audio Video': 'video/webm; codecs="vorbis, vp8"', | 39 'WebM - Audio Video': 'video/webm; codecs="vorbis, vp8"', |
37 'WebM - Video Only': 'video/webm; codecs="vp8"', | 40 'WebM - Video Only': 'video/webm; codecs="vp8"', |
38 'WebM - Audio Only': 'video/webm; codecs="vorbis"', | 41 'WebM - Audio Only': 'video/webm; codecs="vorbis"', |
39 'MP4 - Video Only': 'video/mp4; codecs="avc1.4D4041"', | 42 'MP4 - Video Only': 'video/mp4; codecs="avc1.4D4041"', |
40 'MP4 - Audio Only': 'audio/mp4; codecs="mp4a.40.2"' | 43 'MP4 - Audio Only': 'audio/mp4; codecs="mp4a.40.2"' |
41 }; | 44 }; |
42 | 45 |
43 // Update the EME versions list by checking runtime support by the browser. | 46 // Update the EME versions list by checking runtime support by the browser. |
44 var EME_VERSIONS_OPTIONS = {}; | 47 var EME_VERSIONS_OPTIONS = {}; |
45 var video = document.createElement('video'); | 48 var video = document.createElement('video'); |
46 if (video.webkitAddKey) | 49 if (video.webkitAddKey) |
47 EME_VERSIONS_OPTIONS['Prefixed EME (v 0.1b)'] = 'true'; | 50 EME_VERSIONS_OPTIONS['Prefixed EME (v 0.1b)'] = 'true'; |
48 if (video.setMediaKeys) | 51 if (video.setMediaKeys) |
49 EME_VERSIONS_OPTIONS['Unprefixed EME (Working draft)'] = 'false'; | 52 EME_VERSIONS_OPTIONS['Unprefixed EME (Working draft)'] = 'false'; |
jrummell
2014/05/29 21:45:05
If there is only unprefixed EME available, wouldn'
shadi
2014/05/31 00:31:37
The true|false is for usePrefixedEME value. If the
| |
53 video = null; | |
jrummell
2014/05/29 21:45:05
It appears that the use of video here is just a lo
shadi
2014/05/31 00:31:37
Done.
| |
50 | 54 |
51 // Global document elements ID's. | 55 // Global document elements ID's. |
52 var VIDEO_ELEMENT_ID = 'video'; | 56 var VIDEO_ELEMENT_ID = 'video'; |
53 var MEDIA_FILE_ELEMENT_ID = 'mediaFile'; | 57 var MEDIA_FILE_ELEMENT_ID = 'mediaFile'; |
54 var LICENSE_SERVER_ELEMENT_ID = 'licenseServer'; | 58 var LICENSE_SERVER_ELEMENT_ID = 'licenseServer'; |
55 var KEYSYSTEM_ELEMENT_ID = 'keySystemList'; | 59 var KEYSYSTEM_ELEMENT_ID = 'keySystemList'; |
56 var MEDIA_TYPE_ELEMENT_ID = 'mediaTypeList'; | 60 var MEDIA_TYPE_ELEMENT_ID = 'mediaTypeList'; |
57 var USE_SRC_ELEMENT_ID = 'useSRC'; | 61 var USE_SRC_ELEMENT_ID = 'useSRC'; |
58 var USE_PREFIXED_EME_ID = 'usePrefixedEME'; | 62 var USE_PREFIXED_EME_ID = 'usePrefixedEME'; |
59 | 63 |
60 // These variables get updated every second, so better to have global pointers. | 64 // These variables get updated every second, so better to have global pointers. |
61 var decodedFPSElement = document.getElementById('decodedFPS'); | 65 var decodedFPSElement = document.getElementById('decodedFPS'); |
62 var droppedFPSElement = document.getElementById('droppedFPS'); | 66 var droppedFPSElement = document.getElementById('droppedFPS'); |
63 var droppedFramesElement = document.getElementById('droppedFrames'); | 67 var droppedFramesElement = document.getElementById('droppedFrames'); |
64 var docLogs = document.getElementById('logs'); | 68 var docLogs = document.getElementById('logs'); |
OLD | NEW |