Skip to content

Commit 3a7f9a4

Browse files
committed
added comments and better logging for CertUrl related logic
1 parent 5aacb03 commit 3a7f9a4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/dash/vo/ContentProtection.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ class ContentProtection extends DescriptorType {
4747
this.pssh = null;
4848
this.pro = null;
4949
this.laUrl = null;
50-
this.certUrls = []; // Array of certificate URL descriptors: [{url: string, certType: string|null}]
50+
// Array of certificate URL descriptors: [{url: string, certType: string|null}]
51+
// dash.js treats certType as an opaque label used only for optional preference ordering (see Settings: preferredCertType)
52+
// and for deduplication. No semantic validation or key-system specific mapping is performed.
53+
this.certUrls = [];
5154
}
5255

5356
init(data) {
@@ -113,6 +116,7 @@ class ContentProtection extends DescriptorType {
113116
} else {
114117
certType = null;
115118
}
119+
// We intentionally do not enforce any allowed vocabulary; unknown values are accepted as-is.
116120
return url ? { url, certType } : null;
117121
}
118122
return null;

src/streaming/protection/controllers/ProtectionController.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ function ProtectionController(config) {
342342
if (applied) {
343343
cacheEntry.applied = true;
344344
cacheEntry.inProgress = false;
345-
logger.info('DRM: Server certificate applied successfully from ' + cacheEntry.urlUsed + ' for ' + ksString + '.');
345+
const appliedCandidate = candidates[index];
346+
const appliedTypeSuffix = appliedCandidate && appliedCandidate.certType ? (' certType=' + appliedCandidate.certType) : '';
347+
logger.info('DRM: Server certificate applied successfully from ' + cacheEntry.urlUsed + appliedTypeSuffix + ' for ' + ksString + '.');
346348
} else {
347349
throw new Error('CDM rejected certificate');
348350
}

0 commit comments

Comments
 (0)