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
3 // found in the LICENSE file.
5 // Widevine player responsible for playing media using Widevine key system
6 // and EME working draft API.
7 function WidevinePlayer() {
10 WidevinePlayer.prototype.init = function(video) {
11 InitEMEPlayer(this, video);
14 WidevinePlayer.prototype.onMessage = function(message) {
15 Utils.timeLog('MediaKeySession onMessage', message);
16 var mediaKeySession = message.target;
18 function onSuccess(response) {
19 var key = new Uint8Array(response);
20 Utils.timeLog('Update media key session with license response.', key);
21 mediaKeySession.update(key);
23 Utils.sendRequest('POST', 'arraybuffer', message.message,
24 TestConfig.licenseServer, onSuccess);