Chromium Code Reviews| Index: chrome/test/data/media/eme_player_js/test_app.js |
| diff --git a/chrome/test/data/media/eme_player_js/test_app.js b/chrome/test/data/media/eme_player_js/test_app.js |
| index cacf3cc91a3a3e38787beae23014e954f6b94a83..83e01edb24c73e7a0df326a0c568de4fd92904d7 100644 |
| --- a/chrome/test/data/media/eme_player_js/test_app.js |
| +++ b/chrome/test/data/media/eme_player_js/test_app.js |
| @@ -8,11 +8,12 @@ var TestApp = new function() { |
| this.video_ = null; |
| } |
| -TestApp.play = function() { |
| +TestApp.loadPlayer = function() { |
| if (this.video_) { |
| Utils.timeLog('Delete old video tag.'); |
| - this.video_.src = ''; |
| + this.video_.pause(); |
| this.video_.remove(); |
| + delete(this.video_); |
| } |
| this.video_ = document.createElement('video'); |
| @@ -29,34 +30,43 @@ TestApp.play = function() { |
| } |
| Utils.timeLog('Using ' + videoPlayer.constructor.name); |
| var videoSpan = document.getElementById(VIDEO_ELEMENT_ID); |
| - videoSpan.appendChild(this.video_); |
| + if (videoSpan) |
| + videoSpan.appendChild(this.video_); |
| + else |
| + document.body.appendChild(this.video_); |
| videoPlayer.init(this.video_); |
| - FPSObserver.observe(this.video_); |
| + if (TestConfig.runFPS) |
| + FPSObserver.observe(this.video_); |
| + |
| this.video_.play(); |
| + return this.video_; |
| }; |
| TestApp.getPlayer = function() { |
| - var keySystem = TestConfig.keySystem; |
| - var usePrefixedEME = TestConfig.usePrefixedEME; |
| - |
| // Update keySystem if using prefixed Clear Key since it is not available in |
|
jrummell
2014/05/29 21:45:05
s/available in/available/
shadi
2014/05/31 00:31:37
Done.
|
| - // as a separate key system to choose from. |
| - if (keySystem == CLEARKEY && usePrefixedEME) |
| + // as a separate key system to choose from; however it can be set in query. |
| + var usePrefixedEME = TestConfig.usePrefixedEME; |
| + if (TestConfig.keySystem == CLEARKEY && usePrefixedEME) |
| TestConfig.keySystem = PREFIXED_CLEARKEY; |
| + var keySystem = TestConfig.keySystem; |
| switch (keySystem) { |
| case WIDEVINE_KEYSYSTEM: |
| if (usePrefixedEME) |
| return new PrefixedWidevinePlayer(); |
| return new WidevinePlayer(); |
| + case PREFIXED_CLEARKEY: |
| + return new PrefixedClearKeyPlayer(); |
| case EXTERNAL_CLEARKEY: |
| case CLEARKEY: |
| if (usePrefixedEME) |
| return new PrefixedClearKeyPlayer(); |
| return new ClearKeyPlayer(); |
| default: |
| - Utils.timeLog(keySystem + ' is not a supported system yet.'); |
| - return null; |
| + Utils.timeLog(keySystem + ' is not a known key system'); |
| + if (usePrefixedEME) |
| + return new PrefixedClearKeyPlayer(); |
|
jrummell
2014/05/29 21:45:05
Should you be setting TestConfig.keySystem here, o
shadi
2014/05/31 00:31:37
Yes, I added these to support key systems as "org.
|
| + return new ClearKeyPlayer(); |
| } |
| }; |