Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chrome/test/data/media/eme_player_js/clearkey_player.js

Issue 308553002: Integrate browser tests with new EME player. (Closed) Base URL: http://git.chromium.org/chromium/src.git@eme_player
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // ClearKeyPlayer responsible for playing media using Clear Key key system and 5 // ClearKeyPlayer responsible for playing media using Clear Key key system and
6 // the unprefixed version of EME. 6 // the unprefixed version of EME.
7 function ClearKeyPlayer() { 7 function ClearKeyPlayer() {
8 } 8 }
9 9
10 ClearKeyPlayer.prototype.init = function(video) { 10 ClearKeyPlayer.prototype.init = function(video) {
11 InitEMEPlayer(this, video); 11 InitEMEPlayer(this, video);
12 }; 12 };
13 13
14 ClearKeyPlayer.prototype.onMessage = function(message) { 14 ClearKeyPlayer.prototype.onMessage = function(message) {
15 if (Utils.isHeartBeatMessage(message.message)) {
16 Utils.timeLog('MediaKeySession onMessage - heart beat', message);
17 return;
18 }
19 Utils.timeLog('MediaKeySession onMessage', message); 15 Utils.timeLog('MediaKeySession onMessage', message);
20 var initData = message.message; 16 var initData = Utils.getInitDataFromMessage(message, TestConfig.mediaType);
21 // If content uses mp4, then message.message is pssh data. Instead of parsing 17 var key = Utils.getDefaultKey(TestConfig.forceInvalidResponse);
22 // that data we hard code the initData. 18 var jwkSet = Utils.createJWKData(initData, key);
23 if (TestConfig.mediaType.indexOf('mp4') != -1)
24 // Temporary hack for Clear Key in v0.1.
25 initData = Utils.convertToUint8Array(KEY_ID);
26 var jwkSet = Utils.createJWKData(initData, KEY);
27 message.target.update(jwkSet); 19 message.target.update(jwkSet);
28 }; 20 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698