Skip to content

Commit

Permalink
fix(HLSe): slice keys properly on IE11 (#506)
Browse files Browse the repository at this point in the history
IE11 doesn't support slice on TypedArrays, instead, do it manually if
the TypedArray doesn't have slice.
  • Loading branch information
gkatsev committed May 13, 2019
1 parent 57a38e9 commit 681cd6f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/media-segment-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,13 @@ const decryptSegment = (decrypter, segment, doneFn) => {

decrypter.addEventListener('message', decryptionHandler);

const keyBytes = segment.key.bytes.slice();
let keyBytes;

if (segment.key.bytes.slice) {
keyBytes = segment.key.bytes.slice();
} else {
keyBytes = new Uint32Array(Array.prototype.slice.call(segment.key.bytes));
}

// this is an encrypted segment
// incrementally decrypt the segment
Expand Down

0 comments on commit 681cd6f

Please sign in to comment.