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 CHANGED
@@ -1194,7 +1194,7 @@
1194
1194
  // Some browsers don't allow to use bind on console object anyway
1195
1195
  // fallback to default if needed
1196
1196
  try {
1197
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.1-0.canary.11110");
1197
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.1-0.canary.11112");
1198
1198
  } catch (e) {
1199
1199
  /* log fn threw an exception. All logger methods are no-ops. */
1200
1200
  return createLogger();
@@ -7649,6 +7649,12 @@
7649
7649
  };
7650
7650
  return [baseConfig];
7651
7651
  }
7652
+ function isPersistentSessionType(drmSystemOptions) {
7653
+ var _drmSystemOptions$ses;
7654
+ return drmSystemOptions.sessionType === 'persistent-license' || !!((_drmSystemOptions$ses = drmSystemOptions.sessionTypes) != null && _drmSystemOptions$ses.some(function (type) {
7655
+ return type === 'persistent-license';
7656
+ }));
7657
+ }
7652
7658
  function parsePlayReadyWRM(keyBytes) {
7653
7659
  var keyBytesUtf16 = new Uint16Array(keyBytes.buffer, keyBytes.byteOffset, keyBytes.byteLength / 2);
7654
7660
  var keyByteStr = String.fromCharCode.apply(null, Array.from(keyBytesUtf16));
@@ -16721,7 +16727,7 @@
16721
16727
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16722
16728
  }
16723
16729
 
16724
- var version = "1.6.1-0.canary.11110";
16730
+ var version = "1.6.1-0.canary.11112";
16725
16731
 
16726
16732
  // ensure the worker ends up in the bundle
16727
16733
  // If the worker should not be included this gets aliased to empty.js
@@ -22810,6 +22816,13 @@
22810
22816
  _proto.onKeyStatusChange = function onKeyStatusChange(mediaKeySessionContext) {
22811
22817
  var _this9 = this;
22812
22818
  mediaKeySessionContext.mediaKeysSession.keyStatuses.forEach(function (status, keyId) {
22819
+ // keyStatuses.forEach is not standard API so the callback value looks weird on xboxone
22820
+ // xboxone callback(keyId, status) so we need to exchange them
22821
+ if (typeof keyId === 'string' && typeof status === 'object') {
22822
+ var temp = keyId;
22823
+ keyId = status;
22824
+ status = temp;
22825
+ }
22813
22826
  _this9.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);
22814
22827
  mediaKeySessionContext.keyStatus = status;
22815
22828
  });
@@ -23138,7 +23151,14 @@
23138
23151
  if (index > -1) {
23139
23152
  this.mediaKeySessions.splice(index, 1);
23140
23153
  }
23141
- return mediaKeysSession.remove().catch(function (error) {
23154
+ var drmSystemOptions = this.config.drmSystemOptions;
23155
+ var removePromise = isPersistentSessionType(drmSystemOptions) ? new Promise(function (resolve, reject) {
23156
+ self.setTimeout(function () {
23157
+ return reject(new Error("MediaKeySession.remove() timeout"));
23158
+ }, 8000);
23159
+ mediaKeysSession.remove().then(resolve);
23160
+ }) : Promise.resolve();
23161
+ return removePromise.catch(function (error) {
23142
23162
  var _this15$hls;
23143
23163
  _this15.log("Could not remove session: " + error);
23144
23164
  (_this15$hls = _this15.hls) == null ? void 0 : _this15$hls.trigger(Events.ERROR, {