hls.js 1.6.1-0.canary.11111 → 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.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.11111"}`);
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.11111";
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
@@ -22432,7 +22436,14 @@ class EMEController extends Logger {
22432
22436
  if (index > -1) {
22433
22437
  this.mediaKeySessions.splice(index, 1);
22434
22438
  }
22435
- return mediaKeysSession.remove().catch(error => {
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 => {
22436
22447
  var _this$hls4;
22437
22448
  this.log(`Could not remove session: ${error}`);
22438
22449
  (_this$hls4 = this.hls) == null ? void 0 : _this$hls4.trigger(Events.ERROR, {