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 EME working draft API. | 6 // and EME working draft API. |
7 function WidevinePlayer() { | 7 function WidevinePlayer() { |
8 } | 8 } |
9 | 9 |
10 WidevinePlayer.prototype.init = function(video) { | 10 WidevinePlayer.prototype.init = function(video) { |
11 InitEMEPlayer(this, video); | 11 InitEMEPlayer(this, video); |
12 }; | 12 }; |
13 | 13 |
14 WidevinePlayer.prototype.onMessage = function(message) { | 14 WidevinePlayer.prototype.onMessage = function(message) { |
15 Utils.timeLog('MediaKeySession onMessage', message); | 15 Utils.timeLog('MediaKeySession onMessage', message); |
16 var mediaKeySession = message.target; | 16 var mediaKeySession = message.target; |
17 | |
18 function onSuccess(response) { | 17 function onSuccess(response) { |
19 var key = new Uint8Array(response); | 18 var key = new Uint8Array(response); |
20 Utils.timeLog('Update media key session with license response.', key); | 19 Utils.timeLog('Update media key session with license response.', key); |
21 mediaKeySession.update(key); | 20 mediaKeySession.update(key); |
22 } | 21 } |
23 Utils.sendRequest('POST', 'arraybuffer', message.message, | 22 Utils.sendRequest('POST', 'arraybuffer', message.message, |
24 TestConfig.licenseServer, onSuccess); | 23 TestConfig.licenseServerURL, onSuccess, |
| 24 TestConfig.forceInvalidResponse); |
25 }; | 25 }; |
OLD | NEW |