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 // The PlayerUtils provides utility functions to binding common media events | 5 // The PlayerUtils provides utility functions to binding common media events |
6 // to specific player functions. It also provides functions to load media source | 6 // to specific player functions. It also provides functions to load media source |
7 // base on test configurations. | 7 // base on test configurations. |
8 var PlayerUtils = new function() { | 8 var PlayerUtils = new function() { |
9 } | 9 } |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return player; | 137 return player; |
138 }); | 138 }); |
139 }; | 139 }; |
140 | 140 |
141 // Return the appropriate player based on test configuration. | 141 // Return the appropriate player based on test configuration. |
142 PlayerUtils.createPlayer = function(video, testConfig) { | 142 PlayerUtils.createPlayer = function(video, testConfig) { |
143 function getPlayerType(keySystem) { | 143 function getPlayerType(keySystem) { |
144 switch (keySystem) { | 144 switch (keySystem) { |
145 case WIDEVINE_KEYSYSTEM: | 145 case WIDEVINE_KEYSYSTEM: |
146 return WidevinePlayer; | 146 return WidevinePlayer; |
| 147 case CLEARKEY: |
147 case EXTERNAL_CLEARKEY: | 148 case EXTERNAL_CLEARKEY: |
148 case CLEARKEY: | 149 case EXTERNAL_CLEARKEY_RENEWAL: |
149 return ClearKeyPlayer; | 150 return ClearKeyPlayer; |
150 case FILE_IO_TEST_KEYSYSTEM: | 151 case FILE_IO_TEST_KEYSYSTEM: |
151 case OUTPUT_PROTECTION_TEST_KEYSYSTEM: | 152 case OUTPUT_PROTECTION_TEST_KEYSYSTEM: |
152 return UnitTestPlayer; | 153 return UnitTestPlayer; |
153 default: | 154 default: |
154 Utils.timeLog(keySystem + ' is not a known key system'); | 155 Utils.timeLog(keySystem + ' is not a known key system'); |
155 return ClearKeyPlayer; | 156 return ClearKeyPlayer; |
156 } | 157 } |
157 } | 158 } |
158 var Player = getPlayerType(testConfig.keySystem); | 159 var Player = getPlayerType(testConfig.keySystem); |
159 return new Player(video, testConfig); | 160 return new Player(video, testConfig); |
160 }; | 161 }; |
OLD | NEW |