Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/js/streaming/protection/ProtectionModel_01b.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ MediaPlayer.models.ProtectionModel_01b = function () {
// versions of the same events
createEventHandler = function() {
var self = this;
var keyRequestSent = false;
return {
handleEvent: function(event) {
var sessionToken = null;
Expand All @@ -77,6 +78,13 @@ MediaPlayer.models.ProtectionModel_01b = function () {
var initData = ArrayBuffer.isView(event.initData) ? event.initData.buffer : event.initData;
self.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_NEED_KEY,
new MediaPlayer.vo.protection.NeedKey(initData, "cenc"));
// FIXME: this one is the obvious shortcut - should we delegate this to controller?
if (!keyRequestSent) {
videoElement[api.generateKeyRequest]
(self.keySystem.systemString, new Uint8Array(initData));
keyRequestSent = true;
}

break;

case api.keyerror:
Expand Down