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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 EXTERNAL_CLEARKEY: | 147 case EXTERNAL_CLEARKEY: |
148 case CLEARKEY: | 148 case CLEARKEY: |
149 return ClearKeyPlayer; | 149 return ClearKeyPlayer; |
150 case FILE_IO_TEST_KEYSYSTEM: | 150 case FILE_IO_TEST_KEYSYSTEM: |
151 return FileIOTestPlayer; | 151 case OUTPUT_PROTECTION_TEST_KEYSYSTEM: |
| 152 return UnitTestPlayer; |
152 default: | 153 default: |
153 Utils.timeLog(keySystem + ' is not a known key system'); | 154 Utils.timeLog(keySystem + ' is not a known key system'); |
154 return ClearKeyPlayer; | 155 return ClearKeyPlayer; |
155 } | 156 } |
156 } | 157 } |
157 var Player = getPlayerType(testConfig.keySystem); | 158 var Player = getPlayerType(testConfig.keySystem); |
158 return new Player(video, testConfig); | 159 return new Player(video, testConfig); |
159 }; | 160 }; |
OLD | NEW |