hls.js 1.6.1-0.canary.11110 → 1.6.1-0.canary.11112
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/dist/hls.js +23 -3
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +2 -2
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.mjs +2 -2
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +21 -3
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/eme-controller.ts +19 -2
- package/src/utils/mediakeys-helper.ts +11 -0
package/dist/hls.mjs
CHANGED
@@ -523,7 +523,7 @@ function enableLogs(debugConfig, context, id) {
|
|
523
523
|
// Some browsers don't allow to use bind on console object anyway
|
524
524
|
// fallback to default if needed
|
525
525
|
try {
|
526
|
-
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.1-0.canary.
|
526
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.1-0.canary.11112"}`);
|
527
527
|
} catch (e) {
|
528
528
|
/* log fn threw an exception. All logger methods are no-ops. */
|
529
529
|
return createLogger();
|
@@ -6916,6 +6916,10 @@ function createMediaKeySystemConfigurations(initDataTypes, audioCodecs, videoCod
|
|
6916
6916
|
};
|
6917
6917
|
return [baseConfig];
|
6918
6918
|
}
|
6919
|
+
function isPersistentSessionType(drmSystemOptions) {
|
6920
|
+
var _drmSystemOptions$ses;
|
6921
|
+
return drmSystemOptions.sessionType === 'persistent-license' || !!((_drmSystemOptions$ses = drmSystemOptions.sessionTypes) != null && _drmSystemOptions$ses.some(type => type === 'persistent-license'));
|
6922
|
+
}
|
6919
6923
|
function parsePlayReadyWRM(keyBytes) {
|
6920
6924
|
const keyBytesUtf16 = new Uint16Array(keyBytes.buffer, keyBytes.byteOffset, keyBytes.byteLength / 2);
|
6921
6925
|
const keyByteStr = String.fromCharCode.apply(null, Array.from(keyBytesUtf16));
|
@@ -10243,7 +10247,7 @@ function requireEventemitter3 () {
|
|
10243
10247
|
var eventemitter3Exports = requireEventemitter3();
|
10244
10248
|
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
10245
10249
|
|
10246
|
-
const version = "1.6.1-0.canary.
|
10250
|
+
const version = "1.6.1-0.canary.11112";
|
10247
10251
|
|
10248
10252
|
// ensure the worker ends up in the bundle
|
10249
10253
|
// If the worker should not be included this gets aliased to empty.js
|
@@ -22101,6 +22105,13 @@ class EMEController extends Logger {
|
|
22101
22105
|
}
|
22102
22106
|
onKeyStatusChange(mediaKeySessionContext) {
|
22103
22107
|
mediaKeySessionContext.mediaKeysSession.keyStatuses.forEach((status, keyId) => {
|
22108
|
+
// keyStatuses.forEach is not standard API so the callback value looks weird on xboxone
|
22109
|
+
// xboxone callback(keyId, status) so we need to exchange them
|
22110
|
+
if (typeof keyId === 'string' && typeof status === 'object') {
|
22111
|
+
const temp = keyId;
|
22112
|
+
keyId = status;
|
22113
|
+
status = temp;
|
22114
|
+
}
|
22104
22115
|
this.log(`key status change "${status}" for keyStatuses keyId: ${Hex.hexDump('buffer' in keyId ? new Uint8Array(keyId.buffer, keyId.byteOffset, keyId.byteLength) : new Uint8Array(keyId))} session keyId: ${Hex.hexDump(new Uint8Array(mediaKeySessionContext.decryptdata.keyId || []))} uri: ${mediaKeySessionContext.decryptdata.uri}`);
|
22105
22116
|
mediaKeySessionContext.keyStatus = status;
|
22106
22117
|
});
|
@@ -22425,7 +22436,14 @@ class EMEController extends Logger {
|
|
22425
22436
|
if (index > -1) {
|
22426
22437
|
this.mediaKeySessions.splice(index, 1);
|
22427
22438
|
}
|
22428
|
-
|
22439
|
+
const {
|
22440
|
+
drmSystemOptions
|
22441
|
+
} = this.config;
|
22442
|
+
const removePromise = isPersistentSessionType(drmSystemOptions) ? new Promise((resolve, reject) => {
|
22443
|
+
self.setTimeout(() => reject(new Error(`MediaKeySession.remove() timeout`)), 8000);
|
22444
|
+
mediaKeysSession.remove().then(resolve);
|
22445
|
+
}) : Promise.resolve();
|
22446
|
+
return removePromise.catch(error => {
|
22429
22447
|
var _this$hls4;
|
22430
22448
|
this.log(`Could not remove session: ${error}`);
|
22431
22449
|
(_this$hls4 = this.hls) == null ? void 0 : _this$hls4.trigger(Events.ERROR, {
|