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 // Widevine player responsible for playing media using Widevine key system | 5 // Widevine player responsible for playing media using Widevine key system |
6 // and prefixed EME API. | 6 // and prefixed EME API. |
7 function PrefixedWidevinePlayer() { | 7 function PrefixedWidevinePlayer() { |
8 } | 8 } |
9 | 9 |
10 PrefixedWidevinePlayer.prototype.init = function(video) { | 10 PrefixedWidevinePlayer.prototype.init = function(video) { |
11 InitPrefixedEMEPlayer(this, video); | 11 InitPrefixedEMEPlayer(this, video); |
12 }; | 12 }; |
13 | 13 |
14 PrefixedWidevinePlayer.prototype.onWebkitKeyMessage = function(message) { | 14 PrefixedWidevinePlayer.prototype.onWebkitKeyMessage = function(message) { |
15 function onSuccess(response) { | 15 function onSuccess(response) { |
16 Utils.timeLog('Got license response', key); | |
17 var key = new Uint8Array(response); | 16 var key = new Uint8Array(response); |
18 Utils.timeLog('Adding key to sessionID: ' + message.sessionId); | 17 Utils.timeLog('Adding key to sessionID: ' + message.sessionId, key); |
19 message.target.webkitAddKey(TestConfig.keySystem, key, new Uint8Array(1), | 18 message.target.webkitAddKey(TestConfig.keySystem, key, new Uint8Array(1), |
20 message.sessionId); | 19 message.sessionId); |
21 } | 20 } |
22 Utils.sendRequest('POST', 'arraybuffer', message.message, | 21 Utils.sendRequest('POST', 'arraybuffer', message.message, |
23 TestConfig.licenseServer, onSuccess); | 22 TestConfig.licenseServerURL, onSuccess, |
| 23 TestConfig.forceInvalidResponse); |
24 }; | 24 }; |
OLD | NEW |