Skip to content

Commit dc94fe4

Browse files
authored
Add a settings flag to ignore the keystatusmap (Dash-Industry-Forum#4629)
1 parent f747060 commit dc94fe4

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ declare namespace dashjs {
10791079
keepProtectionMediaKeys?: boolean,
10801080
ignoreEmeEncryptedEvent?: boolean,
10811081
detectPlayreadyMessageFormat?: boolean,
1082+
ignoreKeyStatuses?: boolean,
10821083
},
10831084
buffer?: {
10841085
enableSeekDecorrelationFix?: boolean,

src/core/Settings.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ import Events from './events/Events.js';
102102
* keepProtectionMediaKeys: false,
103103
* ignoreEmeEncryptedEvent: false,
104104
* detectPlayreadyMessageFormat: true,
105+
* ignoreKeyStatuses: false
105106
* },
106107
* buffer: {
107108
* enableSeekDecorrelationFix: false,
@@ -673,6 +674,9 @@ import Events from './events/Events.js';
673674
*
674675
* @property {boolean} [detectPlayreadyMessageFormat=true]
675676
* If set to true the player will use the raw unwrapped message from the Playready CDM
677+
*
678+
* @property {boolean} [ignoreKeyStatusest=false]
679+
* If set to true the player will ignore the status of a key and try to play the corresponding track regardless whether the key is usable or not.
676680
*/
677681

678682
/**
@@ -885,7 +889,7 @@ import Events from './events/Events.js';
885889
* If not specified this value defaults to ['segment'].
886890
* @property {number} [version=1]
887891
* The version of the CMCD to use.
888-
*
892+
*
889893
* If not specified this value defaults to 1.
890894
*/
891895

@@ -1109,6 +1113,7 @@ function Settings() {
11091113
keepProtectionMediaKeys: false,
11101114
ignoreEmeEncryptedEvent: false,
11111115
detectPlayreadyMessageFormat: true,
1116+
ignoreKeyStatuses: false
11121117
},
11131118
buffer: {
11141119
enableSeekDecorrelationFix: false,

src/streaming/protection/controllers/ProtectionController.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,9 @@ function ProtectionController(config) {
11381138
}
11391139

11401140
const keyIdInHex = Utils.bufferSourceToHex(keyStatus.keyId).slice(0, 32);
1141-
keyStatusMap.set(keyIdInHex, keyStatus.status);
1141+
if (keyIdInHex && keyIdInHex !== '') {
1142+
keyStatusMap.set(keyIdInHex, keyStatus.status);
1143+
}
11421144
})
11431145
eventBus.trigger(events.KEY_STATUSES_MAP_UPDATED, { keyStatusMap });
11441146
} catch (e) {
@@ -1159,7 +1161,7 @@ function ProtectionController(config) {
11591161

11601162
function areKeyIdsUsable(normalizedKeyIds) {
11611163
try {
1162-
if (!normalizedKeyIds || normalizedKeyIds.size === 0 || !keyStatusMap || keyStatusMap.size === 0) {
1164+
if (!normalizedKeyIds || normalizedKeyIds.size === 0 || !keyStatusMap || keyStatusMap.size === 0 || settings.get().streaming.protection.ignoreKeyStatuses) {
11631165
return true;
11641166
}
11651167

0 commit comments

Comments
 (0)