rx-player 4.3.1-dev.2025041002 → 4.4.0-dev.2025041400
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -5
- package/VERSION +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/commonjs/errors/encrypted_media_error.d.ts +17 -2
- package/dist/commonjs/errors/encrypted_media_error.d.ts.map +1 -1
- package/dist/commonjs/errors/encrypted_media_error.js +5 -3
- package/dist/commonjs/main_thread/api/public_api.js +2 -2
- package/dist/commonjs/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/content_decryptor.js +7 -3
- package/dist/commonjs/main_thread/decrypt/find_key_system.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/find_key_system.js +5 -1
- package/dist/commonjs/main_thread/decrypt/get_media_keys.js +5 -1
- package/dist/commonjs/main_thread/decrypt/session_events_listener.d.ts +4 -3
- package/dist/commonjs/main_thread/decrypt/session_events_listener.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/session_events_listener.js +37 -12
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.d.ts +9 -3
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/set_server_certificate.js +19 -5
- package/dist/commonjs/main_thread/decrypt/utils/check_key_statuses.d.ts +4 -3
- package/dist/commonjs/main_thread/decrypt/utils/check_key_statuses.d.ts.map +1 -1
- package/dist/commonjs/main_thread/decrypt/utils/check_key_statuses.js +24 -7
- package/dist/commonjs/main_thread/decrypt/utils/media_keys_attacher.js +5 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +13 -10
- package/dist/commonjs/main_thread/init/utils/initialize_content_decryption.d.ts.map +1 -1
- package/dist/commonjs/main_thread/init/utils/initialize_content_decryption.js +5 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
- package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
- package/dist/es2017/errors/encrypted_media_error.d.ts +17 -2
- package/dist/es2017/errors/encrypted_media_error.d.ts.map +1 -1
- package/dist/es2017/errors/encrypted_media_error.js +5 -3
- package/dist/es2017/main_thread/api/public_api.js +2 -2
- package/dist/es2017/main_thread/decrypt/content_decryptor.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/content_decryptor.js +7 -3
- package/dist/es2017/main_thread/decrypt/find_key_system.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/find_key_system.js +5 -1
- package/dist/es2017/main_thread/decrypt/get_media_keys.js +5 -1
- package/dist/es2017/main_thread/decrypt/session_events_listener.d.ts +4 -3
- package/dist/es2017/main_thread/decrypt/session_events_listener.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/session_events_listener.js +35 -12
- package/dist/es2017/main_thread/decrypt/set_server_certificate.d.ts +9 -3
- package/dist/es2017/main_thread/decrypt/set_server_certificate.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/set_server_certificate.js +19 -5
- package/dist/es2017/main_thread/decrypt/utils/check_key_statuses.d.ts +4 -3
- package/dist/es2017/main_thread/decrypt/utils/check_key_statuses.d.ts.map +1 -1
- package/dist/es2017/main_thread/decrypt/utils/check_key_statuses.js +24 -7
- package/dist/es2017/main_thread/decrypt/utils/media_keys_attacher.js +5 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +13 -10
- package/dist/es2017/main_thread/init/utils/initialize_content_decryption.d.ts.map +1 -1
- package/dist/es2017/main_thread/init/utils/initialize_content_decryption.js +5 -1
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.js +120 -35
- package/dist/rx-player.min.js +3 -3
- package/dist/worker.js +1 -1
- package/package.json +1 -1
- package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
- package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
- package/src/errors/__tests__/encrypted_media_error.test.ts +16 -3
- package/src/errors/__tests__/is_known_error.test.ts +9 -1
- package/src/errors/encrypted_media_error.ts +41 -9
- package/src/main_thread/api/public_api.ts +2 -2
- package/src/main_thread/decrypt/content_decryptor.ts +11 -2
- package/src/main_thread/decrypt/find_key_system.ts +5 -0
- package/src/main_thread/decrypt/get_media_keys.ts +5 -1
- package/src/main_thread/decrypt/session_events_listener.ts +49 -10
- package/src/main_thread/decrypt/set_server_certificate.ts +27 -3
- package/src/main_thread/decrypt/utils/check_key_statuses.ts +31 -8
- package/src/main_thread/decrypt/utils/media_keys_attacher.ts +5 -0
- package/src/main_thread/init/multi_thread_content_initializer.ts +13 -8
- package/src/main_thread/init/utils/initialize_content_decryption.ts +5 -1
- package/.vscode/settings.json +0 -1
|
@@ -25,7 +25,9 @@ export default class EncryptedMediaError extends Error {
|
|
|
25
25
|
readonly name: "EncryptedMediaError";
|
|
26
26
|
readonly type: "ENCRYPTED_MEDIA_ERROR";
|
|
27
27
|
readonly code: IEncryptedMediaErrorCode;
|
|
28
|
-
readonly keyStatuses
|
|
28
|
+
readonly keyStatuses: IEncryptedMediaErrorKeyStatusObject[] | undefined;
|
|
29
|
+
readonly keySystemConfiguration: MediaKeySystemConfiguration | undefined;
|
|
30
|
+
readonly keySystem: string | undefined;
|
|
29
31
|
fatal: boolean;
|
|
30
32
|
private _originalMessage;
|
|
31
33
|
/**
|
|
@@ -34,8 +36,19 @@ export default class EncryptedMediaError extends Error {
|
|
|
34
36
|
*/
|
|
35
37
|
constructor(code: "KEY_STATUS_CHANGE_ERROR", reason: string, supplementaryInfos: {
|
|
36
38
|
keyStatuses: IEncryptedMediaErrorKeyStatusObject[];
|
|
39
|
+
keySystemConfiguration: MediaKeySystemConfiguration;
|
|
40
|
+
keySystem: string;
|
|
41
|
+
});
|
|
42
|
+
constructor(code: Omit<IEncryptedMediaErrorCode, "KEY_STATUS_CHANGE_ERROR" | "INCOMPATIBLE_KEYSYSTEMS" | "INVALID_KEY_SYSTEM" | "MEDIA_IS_ENCRYPTED_ERROR">, reason: string, supplementaryInfos: {
|
|
43
|
+
keyStatuses: undefined;
|
|
44
|
+
keySystemConfiguration: MediaKeySystemConfiguration;
|
|
45
|
+
keySystem: string;
|
|
46
|
+
});
|
|
47
|
+
constructor(code: "INCOMPATIBLE_KEYSYSTEMS" | "INVALID_KEY_SYSTEM" | "MEDIA_IS_ENCRYPTED_ERROR", reason: string, supplementaryInfos: {
|
|
48
|
+
keyStatuses: undefined;
|
|
49
|
+
keySystemConfiguration: undefined;
|
|
50
|
+
keySystem: undefined;
|
|
37
51
|
});
|
|
38
|
-
constructor(code: Omit<IEncryptedMediaErrorCode, "KEY_STATUS_CHANGE_ERROR">, reason: string);
|
|
39
52
|
/**
|
|
40
53
|
* If that error has to be communicated through another thread, this method
|
|
41
54
|
* allows to obtain its main defining properties in an Object so the Error can
|
|
@@ -52,5 +65,7 @@ export interface ISerializedEncryptedMediaError {
|
|
|
52
65
|
keyStatus: MediaKeyStatus;
|
|
53
66
|
keyId: ArrayBuffer;
|
|
54
67
|
}> | undefined;
|
|
68
|
+
keySystemConfiguration: MediaKeySystemConfiguration | undefined;
|
|
69
|
+
keySystem: string | undefined;
|
|
55
70
|
}
|
|
56
71
|
//# sourceMappingURL=encrypted_media_error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encrypted_media_error.d.ts","sourceRoot":"","sources":["../../../src/errors/encrypted_media_error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAI9D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,KAAK;IACpD,SAAgB,IAAI,EAAE,qBAAqB,CAAC;IAC5C,SAAgB,IAAI,EAAE,uBAAuB,CAAC;IAC9C,SAAgB,IAAI,EAAE,wBAAwB,CAAC;IAC/C,SAAgB,WAAW,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"encrypted_media_error.d.ts","sourceRoot":"","sources":["../../../src/errors/encrypted_media_error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAI9D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,KAAK;IACpD,SAAgB,IAAI,EAAE,qBAAqB,CAAC;IAC5C,SAAgB,IAAI,EAAE,uBAAuB,CAAC;IAC9C,SAAgB,IAAI,EAAE,wBAAwB,CAAC;IAC/C,SAAgB,WAAW,EAAE,mCAAmC,EAAE,GAAG,SAAS,CAAC;IAC/E,SAAgB,sBAAsB,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAChF,SAAgB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;OAGG;gBAED,IAAI,EAAE,yBAAyB,EAC/B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE;QAClB,WAAW,EAAE,mCAAmC,EAAE,CAAC;QACnD,sBAAsB,EAAE,2BAA2B,CAAC;QACpD,SAAS,EAAE,MAAM,CAAC;KACnB;gBAGD,IAAI,EAAE,IAAI,CACR,wBAAwB,EACtB,yBAAyB,GACzB,yBAAyB,GACzB,oBAAoB,GACpB,0BAA0B,CAC7B,EACD,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE;QAClB,WAAW,EAAE,SAAS,CAAC;QACvB,sBAAsB,EAAE,2BAA2B,CAAC;QACpD,SAAS,EAAE,MAAM,CAAC;KACnB;gBAGD,IAAI,EAAE,yBAAyB,GAAG,oBAAoB,GAAG,0BAA0B,EACnF,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE;QAClB,WAAW,EAAE,SAAS,CAAC;QACvB,sBAAsB,EAAE,SAAS,CAAC;QAClC,SAAS,EAAE,SAAS,CAAC;KACtB;IA2BH;;;;;OAKG;IACI,SAAS,IAAI,8BAA8B;CAUnD;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,wBAAwB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EACP,KAAK,CAAC;QACJ,SAAS,EAAE,cAAc,CAAC;QAC1B,KAAK,EAAE,WAAW,CAAC;KACpB,CAAC,GACF,SAAS,CAAC;IACd,sBAAsB,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAChE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B"}
|
|
@@ -31,9 +31,9 @@ export default class EncryptedMediaError extends Error {
|
|
|
31
31
|
this.code = code;
|
|
32
32
|
this._originalMessage = reason;
|
|
33
33
|
this.fatal = false;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
this.keyStatuses = supplementaryInfos.keyStatuses;
|
|
35
|
+
this.keySystemConfiguration = supplementaryInfos.keySystemConfiguration;
|
|
36
|
+
this.keySystem = supplementaryInfos.keySystem;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* If that error has to be communicated through another thread, this method
|
|
@@ -47,6 +47,8 @@ export default class EncryptedMediaError extends Error {
|
|
|
47
47
|
code: this.code,
|
|
48
48
|
reason: this._originalMessage,
|
|
49
49
|
keyStatuses: this.keyStatuses,
|
|
50
|
+
keySystemConfiguration: this.keySystemConfiguration,
|
|
51
|
+
keySystem: this.keySystem,
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -144,7 +144,7 @@ class Player extends EventEmitter {
|
|
|
144
144
|
// Workaround to support Firefox autoplay on FF 42.
|
|
145
145
|
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
|
|
146
146
|
videoElement.preload = "auto";
|
|
147
|
-
this.version = /* PLAYER_VERSION */ "4.
|
|
147
|
+
this.version = /* PLAYER_VERSION */ "4.4.0-dev.2025041400";
|
|
148
148
|
this.log = log;
|
|
149
149
|
this.state = "STOPPED";
|
|
150
150
|
this.videoElement = videoElement;
|
|
@@ -2549,5 +2549,5 @@ class Player extends EventEmitter {
|
|
|
2549
2549
|
* Use of a WeakSet ensure the object is garbage collected if it's not used anymore.
|
|
2550
2550
|
*/
|
|
2551
2551
|
Player._priv_currentlyUsedVideoElements = new WeakSet();
|
|
2552
|
-
Player.version = /* PLAYER_VERSION */ "4.
|
|
2552
|
+
Player.version = /* PLAYER_VERSION */ "4.4.0-dev.2025041400";
|
|
2553
2553
|
export default Player;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_decryptor.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/content_decryptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,0CAA0C,CAAC;AAMlD,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,oBAAoB,CAAC;AAIzE,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAcrD,OAAO,KAAK,EACV,eAAe,EAEf,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAA8B,qBAAqB,EAAE,MAA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gB,CAC9B,cAAc,EAAE,UAAU,EAAE,EAC5B,YAAY,EAAE,UAAU,EAAE,GACzB,UAAU,EAAE,CAId;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,UAAU,EAAE,GACtB,UAAU,EAAE,CAUd;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,kBAAkB,EAAE,wBAAwB,EAC5C,SAAS,EAAE,UAAU,EAAE,GACtB,UAAU,EAAE,CAcd"}
|
|
@@ -190,7 +190,7 @@ export default class ContentDecryptor extends EventEmitter {
|
|
|
190
190
|
this._stateData.isMediaKeysAttached = 2 /* MediaKeyAttachmentStatus.Attached */;
|
|
191
191
|
const { serverCertificate } = options;
|
|
192
192
|
if (!isNullOrUndefined(serverCertificate)) {
|
|
193
|
-
const resSsc = await setServerCertificate(mediaKeys, serverCertificate);
|
|
193
|
+
const resSsc = await setServerCertificate(mediaKeys, serverCertificate, mediaKeySystemAccess);
|
|
194
194
|
if (resSsc.type === "error") {
|
|
195
195
|
this.trigger("warning", resSsc.value);
|
|
196
196
|
}
|
|
@@ -404,7 +404,7 @@ export default class ContentDecryptor extends EventEmitter {
|
|
|
404
404
|
* persisted or not.
|
|
405
405
|
*/
|
|
406
406
|
let isSessionPersisted = false;
|
|
407
|
-
SessionEventsListener(mediaKeySession, options, mediaKeySystemAccess
|
|
407
|
+
SessionEventsListener(mediaKeySession, options, mediaKeySystemAccess, {
|
|
408
408
|
onKeyUpdate: (value) => {
|
|
409
409
|
const linkedKeys = getKeyIdsLinkedToSession(initializationData, sessionInfo.record, options.singleLicensePer, sessionInfo.source === "created-session" /* MediaKeySessionLoadingType.Created */, value.whitelistedKeyIds, value.blacklistedKeyIds);
|
|
410
410
|
sessionInfo.record.associateKeyIds(linkedKeys.whitelisted);
|
|
@@ -498,7 +498,11 @@ export default class ContentDecryptor extends EventEmitter {
|
|
|
498
498
|
}
|
|
499
499
|
return Promise.resolve();
|
|
500
500
|
}
|
|
501
|
-
throw new EncryptedMediaError("KEY_GENERATE_REQUEST_ERROR", error instanceof Error ? error.toString() : "Unknown error"
|
|
501
|
+
throw new EncryptedMediaError("KEY_GENERATE_REQUEST_ERROR", error instanceof Error ? error.toString() : "Unknown error", {
|
|
502
|
+
keyStatuses: undefined,
|
|
503
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
504
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
505
|
+
});
|
|
502
506
|
}
|
|
503
507
|
}
|
|
504
508
|
return Promise.resolve();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find_key_system.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/find_key_system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACtB,MAAM,0CAA0C,CAAC;AAWlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAKrE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,0BAA0B;IACzC,qEAAqE;IACrE,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C;;;OAGG;IACH,kBAAkB,EAAE,2BAA2B,CAAC;IAChD;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAC1B,oFAAoF;IACpF,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,+BAA+B,CAAC;IACtC,KAAK,EAAE,0BAA0B,CAAC;CACnC;AAED,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,gCAAgC,CAAC;IACvC,KAAK,EAAE,0BAA0B,CAAC;CACnC;AAED,MAAM,MAAM,+BAA+B,GACvC,+BAA+B,GAC/B,gCAAgC,CAAC;AA4QrC;;;;;;;GAOG;AACH,wBAAgB,wCAAwC,CACtD,oBAAoB,EAAE,2BAA2B,EACjD,gBAAgB,EAAE,2BAA2B,GAC5C,iBAAiB,CA2CnB;AACD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,YAAY,EAAE,aAAa,EAC3B,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,+BAA+B,CAAC,
|
|
1
|
+
{"version":3,"file":"find_key_system.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/find_key_system.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACtB,MAAM,0CAA0C,CAAC;AAWlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAKrE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,0BAA0B;IACzC,qEAAqE;IACrE,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C;;;OAGG;IACH,kBAAkB,EAAE,2BAA2B,CAAC;IAChD;;;OAGG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAC1B,oFAAoF;IACpF,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,+BAA+B,CAAC;IACtC,KAAK,EAAE,0BAA0B,CAAC;CACnC;AAED,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,gCAAgC,CAAC;IACvC,KAAK,EAAE,0BAA0B,CAAC;CACnC;AAED,MAAM,MAAM,+BAA+B,GACvC,+BAA+B,GAC/B,gCAAgC,CAAC;AA4QrC;;;;;;;GAOG;AACH,wBAAgB,wCAAwC,CACtD,oBAAoB,EAAE,2BAA2B,EACjD,gBAAgB,EAAE,2BAA2B,GAC5C,iBAAiB,CA2CnB;AACD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,YAAY,EAAE,aAAa,EAC3B,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,+BAA+B,CAAC,CA6H1C;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,uBAAuB,EAAE,2BAA2B,EAAE,gGAsBvD"}
|
|
@@ -333,7 +333,11 @@ export default function getMediaKeySystemAccess(mediaElement, keySystemsConfigs,
|
|
|
333
333
|
if (index >= keySystemsType.length) {
|
|
334
334
|
throw new EncryptedMediaError("INCOMPATIBLE_KEYSYSTEMS", "No key system compatible with your wanted " +
|
|
335
335
|
"configuration has been found in the current " +
|
|
336
|
-
"browser."
|
|
336
|
+
"browser.", {
|
|
337
|
+
keyStatuses: undefined,
|
|
338
|
+
keySystemConfiguration: undefined,
|
|
339
|
+
keySystem: undefined,
|
|
340
|
+
});
|
|
337
341
|
}
|
|
338
342
|
if (isNullOrUndefined(eme.requestMediaKeySystemAccess)) {
|
|
339
343
|
throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");
|
|
@@ -104,6 +104,10 @@ async function createMediaKeys(mediaKeySystemAccess) {
|
|
|
104
104
|
}
|
|
105
105
|
catch (error) {
|
|
106
106
|
const message = error instanceof Error ? error.message : "Unknown error when creating MediaKeys.";
|
|
107
|
-
throw new EncryptedMediaError("CREATE_MEDIA_KEYS_ERROR", message
|
|
107
|
+
throw new EncryptedMediaError("CREATE_MEDIA_KEYS_ERROR", message, {
|
|
108
|
+
keyStatuses: undefined,
|
|
109
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
110
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
111
|
+
});
|
|
108
112
|
}
|
|
109
113
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IMediaKeySession } from "../../compat/browser_compatibility_types";
|
|
16
|
+
import type { IMediaKeySession, IMediaKeySystemAccess } from "../../compat/browser_compatibility_types";
|
|
17
17
|
import type { IKeySystemOption, IPlayerError } from "../../public_types";
|
|
18
18
|
import { CancellationSignal } from "../../utils/task_canceller";
|
|
19
19
|
/**
|
|
@@ -21,11 +21,12 @@ import { CancellationSignal } from "../../utils/task_canceller";
|
|
|
21
21
|
* depending on the configuration given.
|
|
22
22
|
* @param {MediaKeySession} session - The MediaKeySession concerned.
|
|
23
23
|
* @param {Object} keySystemOptions - The key system options.
|
|
24
|
-
* @param {
|
|
24
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
25
|
+
* `MediaKeySystemAccess` that produced the linked `MediaKeys` instance.
|
|
25
26
|
* @param {Object} callbacks
|
|
26
27
|
* @param {Object} cancelSignal
|
|
27
28
|
*/
|
|
28
|
-
export default function SessionEventsListener(session: IMediaKeySession, keySystemOptions: IKeySystemOption,
|
|
29
|
+
export default function SessionEventsListener(session: IMediaKeySession, keySystemOptions: IKeySystemOption, mediaKeySystemAccess: IMediaKeySystemAccess, callbacks: ISessionEventListenerCallbacks, cancelSignal: CancellationSignal): void;
|
|
29
30
|
export interface ISessionEventListenerCallbacks {
|
|
30
31
|
/**
|
|
31
32
|
* Some key ids related to the current MediaKeySession have updated their
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_events_listener.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/session_events_listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"session_events_listener.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/session_events_listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,0CAA0C,CAAC;AAQlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKzE,OAAsB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG/E;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,OAAO,EAAE,gBAAgB,EACzB,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,qBAAqB,EAC3C,SAAS,EAAE,8BAA8B,EACzC,YAAY,EAAE,kBAAkB,GAC/B,IAAI,CA8MN;AAED,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,WAAW,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IAEvC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,uBAAuB,KAAK,IAAI,CAAC;CAC3D;AAyED,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;OAaG;IACH,iBAAiB,EAAE,UAAU,EAAE,CAAC;IAUhC,iBAAiB,EAAE,UAAU,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IACzC,YAAY,EAAE,YAAY,CAAC;gBACtB,YAAY,EAAE,YAAY;CAMvC;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,OAAO,EAAE,MAAM;CAM5B"}
|
|
@@ -26,11 +26,12 @@ import checkKeyStatuses from "./utils/check_key_statuses";
|
|
|
26
26
|
* depending on the configuration given.
|
|
27
27
|
* @param {MediaKeySession} session - The MediaKeySession concerned.
|
|
28
28
|
* @param {Object} keySystemOptions - The key system options.
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
30
|
+
* `MediaKeySystemAccess` that produced the linked `MediaKeys` instance.
|
|
30
31
|
* @param {Object} callbacks
|
|
31
32
|
* @param {Object} cancelSignal
|
|
32
33
|
*/
|
|
33
|
-
export default function SessionEventsListener(session, keySystemOptions,
|
|
34
|
+
export default function SessionEventsListener(session, keySystemOptions, mediaKeySystemAccess, callbacks, cancelSignal) {
|
|
34
35
|
log.info("DRM: Binding session events", session.sessionId);
|
|
35
36
|
const { getLicenseConfig = {} } = keySystemOptions;
|
|
36
37
|
/** Allows to manually cancel everything the `SessionEventsListener` is doing. */
|
|
@@ -50,7 +51,11 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
|
|
|
50
51
|
}
|
|
51
52
|
onKeyError(session, (evt) => {
|
|
52
53
|
manualCanceller.cancel();
|
|
53
|
-
callbacks.onError(new EncryptedMediaError("KEY_ERROR", evt.type
|
|
54
|
+
callbacks.onError(new EncryptedMediaError("KEY_ERROR", evt.type, {
|
|
55
|
+
keyStatuses: undefined,
|
|
56
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
57
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
58
|
+
}));
|
|
54
59
|
}, manualCanceller.signal);
|
|
55
60
|
onKeyStatusesChange(session, () => {
|
|
56
61
|
log.info("DRM: keystatuseschange event received", session.sessionId);
|
|
@@ -83,7 +88,7 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
|
|
|
83
88
|
}
|
|
84
89
|
else {
|
|
85
90
|
try {
|
|
86
|
-
await updateSessionWithMessage(session, licenseObject);
|
|
91
|
+
await updateSessionWithMessage(session, licenseObject, mediaKeySystemAccess);
|
|
87
92
|
}
|
|
88
93
|
catch (err) {
|
|
89
94
|
manualCanceller.cancel();
|
|
@@ -95,7 +100,7 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
|
|
|
95
100
|
return;
|
|
96
101
|
}
|
|
97
102
|
manualCanceller.cancel();
|
|
98
|
-
const formattedError = formatGetLicenseError(err);
|
|
103
|
+
const formattedError = formatGetLicenseError(err, mediaKeySystemAccess);
|
|
99
104
|
if (!isNullOrUndefined(err)) {
|
|
100
105
|
const { fallbackOnLastTry } = err;
|
|
101
106
|
if (fallbackOnLastTry === true) {
|
|
@@ -121,7 +126,7 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
|
|
|
121
126
|
if (manualCanceller.isUsed() || session.keyStatuses.size === 0) {
|
|
122
127
|
return;
|
|
123
128
|
}
|
|
124
|
-
const { warning, blacklistedKeyIds, whitelistedKeyIds } = checkKeyStatuses(session, keySystemOptions,
|
|
129
|
+
const { warning, blacklistedKeyIds, whitelistedKeyIds } = checkKeyStatuses(session, keySystemOptions, mediaKeySystemAccess);
|
|
125
130
|
if (warning !== undefined) {
|
|
126
131
|
callbacks.onWarning(warning);
|
|
127
132
|
if (manualCanceller.isUsed()) {
|
|
@@ -177,7 +182,7 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
|
|
|
177
182
|
shouldRetry: (error) => error instanceof GetLicenseTimeoutError ||
|
|
178
183
|
isNullOrUndefined(error) ||
|
|
179
184
|
error.noRetry !== true,
|
|
180
|
-
onRetry: (error) => callbacks.onWarning(formatGetLicenseError(error)),
|
|
185
|
+
onRetry: (error) => callbacks.onWarning(formatGetLicenseError(error, mediaKeySystemAccess)),
|
|
181
186
|
};
|
|
182
187
|
}
|
|
183
188
|
}
|
|
@@ -185,13 +190,24 @@ export default function SessionEventsListener(session, keySystemOptions, keySyst
|
|
|
185
190
|
* Format an error returned by a `getLicense` call to a proper form as defined
|
|
186
191
|
* by the RxPlayer's API.
|
|
187
192
|
* @param {*} error
|
|
193
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
194
|
+
* `MediaKeySystemAccess` that produced the linked `MediaKeys` instance.
|
|
195
|
+
* This parameter is mainly useful for error generation.
|
|
188
196
|
* @returns {Error}
|
|
189
197
|
*/
|
|
190
|
-
function formatGetLicenseError(error) {
|
|
198
|
+
function formatGetLicenseError(error, mediaKeySystemAccess) {
|
|
191
199
|
if (error instanceof GetLicenseTimeoutError) {
|
|
192
|
-
return new EncryptedMediaError("KEY_LOAD_TIMEOUT", "The license server took too much time to " + "respond."
|
|
200
|
+
return new EncryptedMediaError("KEY_LOAD_TIMEOUT", "The license server took too much time to " + "respond.", {
|
|
201
|
+
keyStatuses: undefined,
|
|
202
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
203
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
204
|
+
});
|
|
193
205
|
}
|
|
194
|
-
const err = new EncryptedMediaError("KEY_LOAD_ERROR", "An error occured when calling `getLicense`."
|
|
206
|
+
const err = new EncryptedMediaError("KEY_LOAD_ERROR", "An error occured when calling `getLicense`.", {
|
|
207
|
+
keyStatuses: undefined,
|
|
208
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
209
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
210
|
+
});
|
|
195
211
|
if (!isNullOrUndefined(error) &&
|
|
196
212
|
isNonEmptyString(error.message)) {
|
|
197
213
|
err.message = error.message;
|
|
@@ -202,16 +218,23 @@ function formatGetLicenseError(error) {
|
|
|
202
218
|
* Call MediaKeySession.update with the given `message`, if defined.
|
|
203
219
|
* @param {MediaKeySession} session
|
|
204
220
|
* @param {ArrayBuffer|TypedArray|null} message
|
|
221
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
222
|
+
* `MediaKeySystemAccess` that produced the linked `MediaKeys` instance.
|
|
223
|
+
* This parameter is mainly useful for error generation.
|
|
205
224
|
* @returns {Promise}
|
|
206
225
|
*/
|
|
207
|
-
async function updateSessionWithMessage(session, message) {
|
|
226
|
+
async function updateSessionWithMessage(session, message, mediaKeySystemAccess) {
|
|
208
227
|
log.info("DRM: Updating MediaKeySession with message");
|
|
209
228
|
try {
|
|
210
229
|
await session.update(message);
|
|
211
230
|
}
|
|
212
231
|
catch (error) {
|
|
213
232
|
const reason = error instanceof Error ? error.toString() : "`session.update` failed";
|
|
214
|
-
throw new EncryptedMediaError("KEY_UPDATE_ERROR", reason
|
|
233
|
+
throw new EncryptedMediaError("KEY_UPDATE_ERROR", reason, {
|
|
234
|
+
keyStatuses: undefined,
|
|
235
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
236
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
237
|
+
});
|
|
215
238
|
}
|
|
216
239
|
log.info("DRM: MediaKeySession update succeeded.");
|
|
217
240
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IMediaKeys } from "../../compat/browser_compatibility_types";
|
|
16
|
+
import type { IMediaKeys, IMediaKeySystemAccess } from "../../compat/browser_compatibility_types";
|
|
17
17
|
import type { IPlayerError } from "../../public_types";
|
|
18
18
|
/**
|
|
19
19
|
* Call the setServerCertificate API with the given certificate.
|
|
@@ -27,17 +27,23 @@ import type { IPlayerError } from "../../public_types";
|
|
|
27
27
|
*
|
|
28
28
|
* @param {MediaKeys} mediaKeys
|
|
29
29
|
* @param {ArrayBuffer} serverCertificate
|
|
30
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
31
|
+
* `MediaKeySystemAccess` that produced the `MediaKeys` instance provided.
|
|
32
|
+
* This parameter is mainly useful for error generation.
|
|
30
33
|
* @returns {Promise}
|
|
31
34
|
*/
|
|
32
|
-
declare function setServerCertificate(mediaKeys: IMediaKeys, serverCertificate: BufferSource): Promise<unknown>;
|
|
35
|
+
declare function setServerCertificate(mediaKeys: IMediaKeys, serverCertificate: BufferSource, mediaKeySystemAccess: IMediaKeySystemAccess): Promise<unknown>;
|
|
33
36
|
/**
|
|
34
37
|
* Call the setCertificate API. If it fails just emit the error as warning
|
|
35
38
|
* and complete.
|
|
36
39
|
* @param {MediaKeys} mediaKeys
|
|
37
40
|
* @param {ArrayBuffer} serverCertificate
|
|
41
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
42
|
+
* `MediaKeySystemAccess` that produced the `MediaKeys` instance provided.
|
|
43
|
+
* This parameter is mainly useful for error generation.
|
|
38
44
|
* @returns {Promise.<Object>}
|
|
39
45
|
*/
|
|
40
|
-
export default function trySettingServerCertificate(mediaKeys: IMediaKeys, serverCertificate: BufferSource): Promise<{
|
|
46
|
+
export default function trySettingServerCertificate(mediaKeys: IMediaKeys, serverCertificate: BufferSource, mediaKeySystemAccess: IMediaKeySystemAccess): Promise<{
|
|
41
47
|
type: "success";
|
|
42
48
|
value: unknown;
|
|
43
49
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_server_certificate.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/set_server_certificate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"set_server_certificate.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/decrypt/set_server_certificate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACtB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAe,oBAAoB,CACjC,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,YAAY,EAC/B,oBAAoB,EAAE,qBAAqB,GAC1C,OAAO,CAAC,OAAO,CAAC,CAoBlB;AAED;;;;;;;;;GASG;AACH,wBAA8B,2BAA2B,CACvD,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,YAAY,EAC/B,oBAAoB,EAAE,qBAAqB,GAC1C,OAAO,CACN;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,wBAAwB,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CACzC,CAyCA;AAED,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -28,9 +28,12 @@ import ServerCertificateStore from "./utils/server_certificate_store";
|
|
|
28
28
|
*
|
|
29
29
|
* @param {MediaKeys} mediaKeys
|
|
30
30
|
* @param {ArrayBuffer} serverCertificate
|
|
31
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
32
|
+
* `MediaKeySystemAccess` that produced the `MediaKeys` instance provided.
|
|
33
|
+
* This parameter is mainly useful for error generation.
|
|
31
34
|
* @returns {Promise}
|
|
32
35
|
*/
|
|
33
|
-
async function setServerCertificate(mediaKeys, serverCertificate) {
|
|
36
|
+
async function setServerCertificate(mediaKeys, serverCertificate, mediaKeySystemAccess) {
|
|
34
37
|
try {
|
|
35
38
|
const res = await mediaKeys.setServerCertificate(serverCertificate);
|
|
36
39
|
// Note: Even if `setServerCertificate` technically should return a
|
|
@@ -41,7 +44,11 @@ async function setServerCertificate(mediaKeys, serverCertificate) {
|
|
|
41
44
|
catch (error) {
|
|
42
45
|
log.warn("DRM: mediaKeys.setServerCertificate returned an error", error instanceof Error ? error : "");
|
|
43
46
|
const reason = error instanceof Error ? error.toString() : "`setServerCertificate` error";
|
|
44
|
-
throw new EncryptedMediaError("LICENSE_SERVER_CERTIFICATE_ERROR", reason
|
|
47
|
+
throw new EncryptedMediaError("LICENSE_SERVER_CERTIFICATE_ERROR", reason, {
|
|
48
|
+
keyStatuses: undefined,
|
|
49
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
50
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
51
|
+
});
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
54
|
/**
|
|
@@ -49,9 +56,12 @@ async function setServerCertificate(mediaKeys, serverCertificate) {
|
|
|
49
56
|
* and complete.
|
|
50
57
|
* @param {MediaKeys} mediaKeys
|
|
51
58
|
* @param {ArrayBuffer} serverCertificate
|
|
59
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
60
|
+
* `MediaKeySystemAccess` that produced the `MediaKeys` instance provided.
|
|
61
|
+
* This parameter is mainly useful for error generation.
|
|
52
62
|
* @returns {Promise.<Object>}
|
|
53
63
|
*/
|
|
54
|
-
export default async function trySettingServerCertificate(mediaKeys, serverCertificate) {
|
|
64
|
+
export default async function trySettingServerCertificate(mediaKeys, serverCertificate, mediaKeySystemAccess) {
|
|
55
65
|
if (ServerCertificateStore.hasOne(mediaKeys) === true) {
|
|
56
66
|
log.info("DRM: The MediaKeys already has a server certificate, skipping...");
|
|
57
67
|
return { type: "already-has-one" };
|
|
@@ -68,14 +78,18 @@ export default async function trySettingServerCertificate(mediaKeys, serverCerti
|
|
|
68
78
|
// Calling `prepare` allow to invalidate temporarily that status.
|
|
69
79
|
ServerCertificateStore.prepare(mediaKeys);
|
|
70
80
|
try {
|
|
71
|
-
const result = await setServerCertificate(mediaKeys, serverCertificate);
|
|
81
|
+
const result = await setServerCertificate(mediaKeys, serverCertificate, mediaKeySystemAccess);
|
|
72
82
|
ServerCertificateStore.set(mediaKeys, serverCertificate);
|
|
73
83
|
return { type: "success", value: result };
|
|
74
84
|
}
|
|
75
85
|
catch (error) {
|
|
76
86
|
const formattedErr = isKnownError(error)
|
|
77
87
|
? error
|
|
78
|
-
: new EncryptedMediaError("LICENSE_SERVER_CERTIFICATE_ERROR", "Unknown error when setting the server certificate."
|
|
88
|
+
: new EncryptedMediaError("LICENSE_SERVER_CERTIFICATE_ERROR", "Unknown error when setting the server certificate.", {
|
|
89
|
+
keyStatuses: undefined,
|
|
90
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
91
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
92
|
+
});
|
|
79
93
|
return { type: "error", value: formattedErr };
|
|
80
94
|
}
|
|
81
95
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IMediaKeySession } from "../../../compat/browser_compatibility_types";
|
|
16
|
+
import type { IMediaKeySession, IMediaKeySystemAccess } from "../../../compat/browser_compatibility_types";
|
|
17
17
|
import { EncryptedMediaError } from "../../../errors";
|
|
18
18
|
import type { IKeySystemOption, IPlayerError } from "../../../public_types";
|
|
19
19
|
/**
|
|
@@ -42,10 +42,11 @@ export type IKeyStatusesCheckingOptions = Pick<IKeySystemOption, "onKeyOutputRes
|
|
|
42
42
|
* @param {MediaKeySession} session - The MediaKeySession from which the keys
|
|
43
43
|
* will be checked.
|
|
44
44
|
* @param {Object} options
|
|
45
|
-
* @param {
|
|
45
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
46
|
+
* `MediaKeySystemAccess` that produced the linked `MediaKeys` instance.
|
|
46
47
|
* @returns {Object} - Warnings to send, whitelisted and blacklisted key ids.
|
|
47
48
|
*/
|
|
48
|
-
export default function checkKeyStatuses(session: IMediaKeySession, options: IKeyStatusesCheckingOptions,
|
|
49
|
+
export default function checkKeyStatuses(session: IMediaKeySession, options: IKeyStatusesCheckingOptions, mediaKeySystemAccess: IMediaKeySystemAccess): {
|
|
49
50
|
warning: EncryptedMediaError | undefined;
|
|
50
51
|
blacklistedKeyIds: Uint8Array[];
|
|
51
52
|
whitelistedKeyIds: Uint8Array[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check_key_statuses.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/decrypt/utils/check_key_statuses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"check_key_statuses.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/decrypt/utils/check_key_statuses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,uBAAuB,CAAC;AAI/B;;;;;;;GAOG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IAC5C,MAAM,EAAE,YAAY,CAAC;IAE5B;;;;OAIG;gBACS,MAAM,EAAE,YAAY;CAMjC;AAQD,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,gBAAgB,EAChB,uBAAuB,GAAG,oBAAoB,GAAG,iBAAiB,CACnE,CAAC;AAYF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,2BAA2B,EACpC,oBAAoB,EAAE,qBAAqB,GAC1C;IACD,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACzC,iBAAiB,EAAE,UAAU,EAAE,CAAC;IAChC,iBAAiB,EAAE,UAAU,EAAE,CAAC;CACjC,CA4JA"}
|
|
@@ -52,10 +52,11 @@ const KEY_STATUSES = {
|
|
|
52
52
|
* @param {MediaKeySession} session - The MediaKeySession from which the keys
|
|
53
53
|
* will be checked.
|
|
54
54
|
* @param {Object} options
|
|
55
|
-
* @param {
|
|
55
|
+
* @param {MediaKeySystemAccess} mediaKeySystemAccess - The
|
|
56
|
+
* `MediaKeySystemAccess` that produced the linked `MediaKeys` instance.
|
|
56
57
|
* @returns {Object} - Warnings to send, whitelisted and blacklisted key ids.
|
|
57
58
|
*/
|
|
58
|
-
export default function checkKeyStatuses(session, options,
|
|
59
|
+
export default function checkKeyStatuses(session, options, mediaKeySystemAccess) {
|
|
59
60
|
const { onKeyInternalError, onKeyOutputRestricted, onKeyExpiration } = options;
|
|
60
61
|
const blacklistedKeyIds = [];
|
|
61
62
|
const whitelistedKeyIds = [];
|
|
@@ -66,14 +67,18 @@ export default function checkKeyStatuses(session, options, keySystem) {
|
|
|
66
67
|
const [keyStatus, keyStatusKeyId] = (() => {
|
|
67
68
|
return (typeof _arg1 === "string" ? [_arg1, _arg2] : [_arg2, _arg1]);
|
|
68
69
|
})();
|
|
69
|
-
const keyId = getUUIDKidFromKeyStatusKID(keySystem, new Uint8Array(keyStatusKeyId));
|
|
70
|
+
const keyId = getUUIDKidFromKeyStatusKID(mediaKeySystemAccess.keySystem, new Uint8Array(keyStatusKeyId));
|
|
70
71
|
const keyStatusObj = { keyId: keyId.buffer, keyStatus };
|
|
71
72
|
if (log.hasLevel("DEBUG")) {
|
|
72
73
|
log.debug(`DRM: key status update (${bytesToHex(keyId)}): ${keyStatus}`);
|
|
73
74
|
}
|
|
74
75
|
switch (keyStatus) {
|
|
75
76
|
case KEY_STATUSES.EXPIRED: {
|
|
76
|
-
const error = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", `A decryption key expired (${bytesToHex(keyId)})`, {
|
|
77
|
+
const error = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", `A decryption key expired (${bytesToHex(keyId)})`, {
|
|
78
|
+
keyStatuses: [keyStatusObj, ...badKeyStatuses],
|
|
79
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
80
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
81
|
+
});
|
|
77
82
|
if (onKeyExpiration === "error" || onKeyExpiration === undefined) {
|
|
78
83
|
throw error;
|
|
79
84
|
}
|
|
@@ -99,7 +104,11 @@ export default function checkKeyStatuses(session, options, keySystem) {
|
|
|
99
104
|
break;
|
|
100
105
|
}
|
|
101
106
|
case KEY_STATUSES.INTERNAL_ERROR: {
|
|
102
|
-
const error = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", `A "${keyStatus}" status has been encountered (${bytesToHex(keyId)})`, {
|
|
107
|
+
const error = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", `A "${keyStatus}" status has been encountered (${bytesToHex(keyId)})`, {
|
|
108
|
+
keyStatuses: [keyStatusObj, ...badKeyStatuses],
|
|
109
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
110
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
111
|
+
});
|
|
103
112
|
switch (onKeyInternalError) {
|
|
104
113
|
case undefined:
|
|
105
114
|
case "error":
|
|
@@ -126,7 +135,11 @@ export default function checkKeyStatuses(session, options, keySystem) {
|
|
|
126
135
|
break;
|
|
127
136
|
}
|
|
128
137
|
case KEY_STATUSES.OUTPUT_RESTRICTED: {
|
|
129
|
-
const error = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", `A "${keyStatus}" status has been encountered (${bytesToHex(keyId)})`, {
|
|
138
|
+
const error = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", `A "${keyStatus}" status has been encountered (${bytesToHex(keyId)})`, {
|
|
139
|
+
keyStatuses: [keyStatusObj, ...badKeyStatuses],
|
|
140
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
141
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
142
|
+
});
|
|
130
143
|
switch (onKeyOutputRestricted) {
|
|
131
144
|
case undefined:
|
|
132
145
|
case "error":
|
|
@@ -157,7 +170,11 @@ export default function checkKeyStatuses(session, options, keySystem) {
|
|
|
157
170
|
});
|
|
158
171
|
let warning;
|
|
159
172
|
if (badKeyStatuses.length > 0) {
|
|
160
|
-
warning = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", "One or several problematic key statuses have been encountered", {
|
|
173
|
+
warning = new EncryptedMediaError("KEY_STATUS_CHANGE_ERROR", "One or several problematic key statuses have been encountered", {
|
|
174
|
+
keyStatuses: badKeyStatuses,
|
|
175
|
+
keySystem: mediaKeySystemAccess.keySystem,
|
|
176
|
+
keySystemConfiguration: mediaKeySystemAccess.getConfiguration(),
|
|
177
|
+
});
|
|
161
178
|
}
|
|
162
179
|
return { warning, blacklistedKeyIds, whitelistedKeyIds };
|
|
163
180
|
}
|
|
@@ -158,7 +158,11 @@ async function attachMediaKeys(mediaElement, previousState, mediaKeysInfo) {
|
|
|
158
158
|
}
|
|
159
159
|
catch (err) {
|
|
160
160
|
const errMessage = err instanceof Error ? err.toString() : "Unknown Error";
|
|
161
|
-
throw new EncryptedMediaError("MEDIA_KEYS_ATTACHMENT_ERROR", "Could not attach the MediaKeys to the media element: " + errMessage
|
|
161
|
+
throw new EncryptedMediaError("MEDIA_KEYS_ATTACHMENT_ERROR", "Could not attach the MediaKeys to the media element: " + errMessage, {
|
|
162
|
+
keyStatuses: undefined,
|
|
163
|
+
keySystemConfiguration: mediaKeysInfo.mediaKeySystemAccess.getConfiguration(),
|
|
164
|
+
keySystem: mediaKeysInfo.mediaKeySystemAccess.keySystem,
|
|
165
|
+
});
|
|
162
166
|
}
|
|
163
167
|
}
|
|
164
168
|
async function clearMediaKeys(mediaElement, previousState) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi_thread_content_initializer.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/init/multi_thread_content_initializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAI9E,OAAO,KAAK,EACV,wCAAwC,EAGzC,MAAM,kBAAkB,CAAC;AAU1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,wBAAwB,MAAM,uCAAuC,CAAC;AAO7E,OAAO,KAAK,EAE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IAQrB,OAAO,CAAC,4BAA4B;
|
|
1
|
+
{"version":3,"file":"multi_thread_content_initializer.d.ts","sourceRoot":"","sources":["../../../../src/main_thread/init/multi_thread_content_initializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAI9E,OAAO,KAAK,EACV,wCAAwC,EAGzC,MAAM,kBAAkB,CAAC;AAU1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,wBAAwB,MAAM,uCAAuC,CAAC;AAO7E,OAAO,KAAK,EAEV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAM9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAMtE,OAAO,KAAK,iBAAiB,MAAM,YAAY,CAAC;AAIhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAIpE,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AACnE,OAAO,mBAAmB,MAAM,qDAAqD,CAAC;AAMtF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,kBAAkB;IAC3E,+EAA+E;IAC/E,OAAO,CAAC,SAAS,CAAuB;IAExC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,qBAAqB,CAAwB;IAErD;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAAoD;IAC/E;;;OAGG;IACH,OAAO,CAAC,cAAc,CAAgB;IACtC;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B,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C;QAC7B;;;;;WAKG;QACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC;;;;WAIG;QACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,+CAA+C;QAC/C,6BAA6B,EAAE,MAAM,CAAC;QACtC;;;WAGG;QACH,eAAe,EAAE,gBAAgB,GAAG,SAAS,CAAC;KAC/C,CAAC;IACF,sDAAsD;IACtD,qBAAqB,EAAE;QACrB,cAAc,EAAE,OAAO,CAAC;QACxB;;;;WAIG;QACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC;;;;WAIG;QACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,iEAAiE;QACjE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;KAC9B,CAAC;IACF,sDAAsD;IACtD,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACxC,wCAAwC;IACxC,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,oEAAoE;IACpE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB"}
|
|
@@ -908,7 +908,11 @@ export default class MultiThreadContentInitializer extends ContentInitializer {
|
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
910
910
|
stopListening();
|
|
911
|
-
const err = new EncryptedMediaError("MEDIA_IS_ENCRYPTED_ERROR", errMsg
|
|
911
|
+
const err = new EncryptedMediaError("MEDIA_IS_ENCRYPTED_ERROR", errMsg, {
|
|
912
|
+
keyStatuses: undefined,
|
|
913
|
+
keySystemConfiguration: undefined,
|
|
914
|
+
keySystem: undefined,
|
|
915
|
+
});
|
|
912
916
|
this._onFatalError(err);
|
|
913
917
|
}, { clearSignal: cancelSignal });
|
|
914
918
|
const ref = new SharedReference({
|
|
@@ -1423,7 +1427,6 @@ function bindNumberReferencesToWorker(worker, cancellationSignal, ...refs) {
|
|
|
1423
1427
|
}
|
|
1424
1428
|
}
|
|
1425
1429
|
function formatWorkerError(sentError) {
|
|
1426
|
-
var _a;
|
|
1427
1430
|
switch (sentError.name) {
|
|
1428
1431
|
case "NetworkError":
|
|
1429
1432
|
return new NetworkError(sentError.code, new RequestError(sentError.baseError.url, sentError.baseError.status, sentError.baseError.type));
|
|
@@ -1433,14 +1436,14 @@ function formatWorkerError(sentError) {
|
|
|
1433
1436
|
tracks: sentError.tracks,
|
|
1434
1437
|
});
|
|
1435
1438
|
case "EncryptedMediaError":
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}
|
|
1439
|
+
// We assume that everything have already been checked Worker-side here
|
|
1440
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
1441
|
+
return new EncryptedMediaError(sentError.code, sentError.reason, {
|
|
1442
|
+
keyStatuses: sentError.keyStatuses,
|
|
1443
|
+
keySystemConfiguration: sentError.keySystemConfiguration,
|
|
1444
|
+
keySystem: sentError.keySystem,
|
|
1445
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1446
|
+
});
|
|
1444
1447
|
case "OtherError":
|
|
1445
1448
|
return new OtherError(sentError.code, sentError.reason);
|
|
1446
1449
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize_content_decryption.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/init/utils/initialize_content_decryption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,eAAe,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CACjD,YAAY,EAAE,aAAa,EAC3B,UAAU,EAAE,gBAAgB,EAAE,EAC9B,SAAS,EAAE;IACT,SAAS,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAC9B,yBAAyB,EAAE,CAAC,GAAG,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACnE,2BAA2B,EAAE,CAAC,OAAO,EAAE;QACrC,iBAAiB,EAAE,UAAU,EAAE,CAAC;QAChC,iBAAiB,EAAE,UAAU,EAAE,CAAC;QAChC,cAAc,EAAE,UAAU,EAAE,CAAC;KAC9B,KAAK,IAAI,CAAC;IACX,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC,EACD,YAAY,EAAE,kBAAkB,GAC/B;IACD,SAAS,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EACZ;QACE,OAAO,EAAE,IAAI,CAAC;QACd,KAAK,EAAE,iBAAiB,CAAC;KAC1B,GACD;QACE,OAAO,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,mBAAmB,CAAC;KAC5B,CAAC;CACP,
|
|
1
|
+
{"version":3,"file":"initialize_content_decryption.d.ts","sourceRoot":"","sources":["../../../../../src/main_thread/init/utils/initialize_content_decryption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE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