Skip to content

Commit

Permalink
Fix some issues with IE11 EME polyfill.
Browse files Browse the repository at this point in the history
- We can get a 'msneedkey' event with no init data.
- Use the correct message type name.

Issue #1689

Change-Id: Ic0e54fe8331d4700971d78095b77831de2d9580b
  • Loading branch information
TheModMaker committed Nov 30, 2018
1 parent 8805b56 commit 3db435e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/polyfill/patchedmediakeys_ms.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,9 @@ shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.
*/
shaka.polyfill.PatchedMediaKeysMs.onMsNeedKey_ = function(event) {
shaka.log.debug('PatchedMediaKeysMs.onMsNeedKey_', event);
if (!event.initData) {
return;
}

// Alias
const PatchedMediaKeysMs = shaka.polyfill.PatchedMediaKeysMs;
Expand Down Expand Up @@ -612,7 +615,7 @@ shaka.polyfill.PatchedMediaKeysMs.MediaKeySession.prototype.
let isNew = this.keyStatuses.getStatus() == undefined;

let event2 = new shaka.util.FakeEvent('message', {
messageType: isNew ? 'licenserequest' : 'licenserenewal',
messageType: isNew ? 'license-request' : 'license-renewal',
message: event.message.buffer,
});

Expand Down

0 comments on commit 3db435e

Please sign in to comment.