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 // EMEApp is responsible for starting playback on the eme_player.html page. | 5 // EMEApp is responsible for starting playback on the eme_player.html page. |
6 // It selects the suitable player based on key system and other test options. | 6 // It selects the suitable player based on key system and other test options. |
7 function EMEApp(testConfig) { | 7 function EMEApp(testConfig) { |
8 this.video_ = null; | 8 this.video_ = null; |
9 this.testConfig_ = testConfig; | 9 this.testConfig_ = testConfig; |
10 this.updateDocument(testConfig); | 10 this.updateDocument(testConfig); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 Utils.timeLog('Media player created.'); | 48 Utils.timeLog('Media player created.'); |
49 return videoPlayer; | 49 return videoPlayer; |
50 }); | 50 }); |
51 }; | 51 }; |
52 | 52 |
53 EMEApp.prototype.updateDocument = function(testConfig) { | 53 EMEApp.prototype.updateDocument = function(testConfig) { |
54 // Update document lists with test configuration values. | 54 // Update document lists with test configuration values. |
55 Utils.addOptions(KEYSYSTEM_ELEMENT_ID, KEY_SYSTEMS); | 55 Utils.addOptions(KEYSYSTEM_ELEMENT_ID, KEY_SYSTEMS); |
56 Utils.addOptions(MEDIA_TYPE_ELEMENT_ID, MEDIA_TYPES); | 56 Utils.addOptions(MEDIA_TYPE_ELEMENT_ID, MEDIA_TYPES); |
57 Utils.addOptions(USE_PREFIXED_EME_ID, EME_VERSIONS_OPTIONS, | |
58 EME_DISABLED_OPTIONS); | |
59 document.getElementById(MEDIA_FILE_ELEMENT_ID).value = | 57 document.getElementById(MEDIA_FILE_ELEMENT_ID).value = |
60 testConfig.mediaFile || DEFAULT_MEDIA_FILE; | 58 testConfig.mediaFile || DEFAULT_MEDIA_FILE; |
61 document.getElementById(LICENSE_SERVER_ELEMENT_ID).value = | 59 document.getElementById(LICENSE_SERVER_ELEMENT_ID).value = |
62 testConfig.licenseServerURL || DEFAULT_LICENSE_SERVER; | 60 testConfig.licenseServerURL || DEFAULT_LICENSE_SERVER; |
63 if (testConfig.keySystem) | 61 if (testConfig.keySystem) |
64 Utils.ensureOptionInList(KEYSYSTEM_ELEMENT_ID, testConfig.keySystem); | 62 Utils.ensureOptionInList(KEYSYSTEM_ELEMENT_ID, testConfig.keySystem); |
65 if (testConfig.mediaType) | 63 if (testConfig.mediaType) |
66 Utils.ensureOptionInList(MEDIA_TYPE_ELEMENT_ID, testConfig.mediaType); | 64 Utils.ensureOptionInList(MEDIA_TYPE_ELEMENT_ID, testConfig.mediaType); |
67 document.getElementById(USE_MSE_ELEMENT_ID).value = testConfig.useMSE; | 65 document.getElementById(USE_MSE_ELEMENT_ID).value = testConfig.useMSE; |
68 if (testConfig.usePrefixedEME) | |
69 document.getElementById(USE_PREFIXED_EME_ID).value = EME_PREFIXED_VERSION; | |
70 }; | 66 }; |
71 | 67 |
72 EMEApp.prototype.updateTestConfig = function() { | 68 EMEApp.prototype.updateTestConfig = function() { |
73 // Reload test configuration from document. | 69 // Reload test configuration from document. |
74 this.testConfig_.mediaFile = | 70 this.testConfig_.mediaFile = |
75 document.getElementById(MEDIA_FILE_ELEMENT_ID).value; | 71 document.getElementById(MEDIA_FILE_ELEMENT_ID).value; |
76 this.testConfig_.keySystem = | 72 this.testConfig_.keySystem = |
77 document.getElementById(KEYSYSTEM_ELEMENT_ID).value; | 73 document.getElementById(KEYSYSTEM_ELEMENT_ID).value; |
78 this.testConfig_.mediaType = | 74 this.testConfig_.mediaType = |
79 document.getElementById(MEDIA_TYPE_ELEMENT_ID).value; | 75 document.getElementById(MEDIA_TYPE_ELEMENT_ID).value; |
80 this.testConfig_.useMSE = | 76 this.testConfig_.useMSE = |
81 document.getElementById(USE_MSE_ELEMENT_ID).value == 'true'; | 77 document.getElementById(USE_MSE_ELEMENT_ID).value == 'true'; |
82 this.testConfig_.usePrefixedEME = ( | |
83 document.getElementById(USE_PREFIXED_EME_ID).value == | |
84 EME_PREFIXED_VERSION); | |
85 this.testConfig_.licenseServerURL = | 78 this.testConfig_.licenseServerURL = |
86 document.getElementById(LICENSE_SERVER_ELEMENT_ID).value; | 79 document.getElementById(LICENSE_SERVER_ELEMENT_ID).value; |
87 }; | 80 }; |
OLD | NEW |