Skip to content

Commit 6ef6738

Browse files
authored
Fix MSS bug when trying to derive a normalized key id (Dash-Industry-Forum#4679)
1 parent 1ff70a1 commit 6ef6738

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/dash/DashAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ function DashAdapter() {
10911091
function _getNormalizedKeyIds(contentProtection) {
10921092
const normalizedKeyIds = new Set();
10931093
contentProtection.forEach((contentProtectionElement) => {
1094-
if (contentProtectionElement.cencDefaultKid) {
1094+
if (contentProtectionElement.cencDefaultKid && typeof contentProtectionElement.cencDefaultKid === 'string') {
10951095
normalizedKeyIds.add(contentProtectionElement.cencDefaultKid.replace(/-/g, '').toLowerCase());
10961096
}
10971097
})

src/streaming/protection/models/DefaultProtectionModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ function DefaultProtectionModel(config) {
456456
const token = { // Implements SessionToken
457457
session: session,
458458
keyId: keySystemMetadata.keyId,
459-
normalizedKeyId: keySystemMetadata && keySystemMetadata.keyId ? keySystemMetadata.keyId.replace(/-/g, '').toLowerCase() : '',
459+
normalizedKeyId: keySystemMetadata && keySystemMetadata.keyId && typeof keySystemMetadata.keyId === 'string' ? keySystemMetadata.keyId.replace(/-/g, '').toLowerCase() : '',
460460
initData: keySystemMetadata.initData,
461461
sessionId: keySystemMetadata.sessionId,
462462
sessionType: keySystemMetadata.sessionType,

src/streaming/protection/models/ProtectionModel_01b.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function ProtectionModel_01b(config) {
222222
const newSession = { // Implements SessionToken
223223
sessionId: null,
224224
keyId: ksInfo.keyId,
225-
normalizedKeyId: ksInfo.keyId.replace(/-/g, '').toLowerCase(),
225+
normalizedKeyId: ksInfo && ksInfo.keyId && typeof ksInfo.keyId === 'string' ? ksInfo.keyId.replace(/-/g, '').toLowerCase() : '',
226226
initData: ksInfo.initData,
227227
hasTriggeredKeyStatusMapUpdate: false,
228228

src/streaming/protection/models/ProtectionModel_3Feb2014.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ function ProtectionModel_3Feb2014(config) {
336336
// Implements SessionToken
337337
session: keySession,
338338
keyId: ksInfo.keyId,
339-
normalizedKeyId: ksInfo.keyId.replace(/-/g, '').toLowerCase(),
339+
normalizedKeyId: ksInfo && ksInfo.keyId && typeof ksInfo.keyId === 'string' ? ksInfo.keyId.replace(/-/g, '').toLowerCase() : '',
340340
initData: ksInfo.initData,
341341
hasTriggeredKeyStatusMapUpdate: false,
342342

0 commit comments

Comments
 (0)