Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Deal with OOB key ids #212

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
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
17 changes: 10 additions & 7 deletions app/js/mss/MssParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Mss.dependencies.MssParser = function() {
// Check if codec is supported
if (SUPPORTED_CODECS.indexOf(fourCCValue.toUpperCase()) === -1) {
// Do not send warning
//this.errHandler.sendWarning(MediaPlayer.dependencies.ErrorHandler.prototype.MEDIA_ERR_CODEC_UNSUPPORTED, "Codec/FourCC not supported", {codec: fourCCValue});
this.errHandler.sendWarning(MediaPlayer.dependencies.ErrorHandler.prototype.MEDIA_ERR_CODEC_UNSUPPORTED, "Codec/FourCC not supported", {codec: fourCCValue});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This not related with this PR. BTW we should remove this warning. We already put a warning in the console.

this.debug.warn("[MssParser] Codec not supported: " + fourCCValue);
return null;
}
Expand Down Expand Up @@ -386,13 +386,16 @@ Mss.dependencies.MssParser = function() {

// Parse <WRMHeader> to get KID field value
xmlReader = (new DOMParser()).parseFromString(wrmHeader, "application/xml");
KID = xmlReader.querySelector("KID").textContent;
var kidNode = xmlReader.querySelector("KID");
if (kidNode) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which use case you do not have KID in the ProtectionHeader?

KID = kidNode.textContent;

// Get KID (base64 decoded) as byte array
KID = BASE64.decodeArray(KID);
// Get KID (base64 decoded) as byte array
KID = BASE64.decodeArray(KID);

// Convert UUID from little-endian to big-endian
convertUuidEndianness(KID);
// Convert UUID from little-endian to big-endian
convertUuidEndianness(KID);
}

return KID;
},
Expand Down Expand Up @@ -717,4 +720,4 @@ Mss.dependencies.MssParser = function() {

Mss.dependencies.MssParser.prototype = {
constructor: Mss.dependencies.MssParser
};
};