hls.js 1.5.9-0.canary.10273 → 1.5.9-0.canary.10276

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.
@@ -512,7 +512,7 @@ function enableLogs(debugConfig, context, id) {
512
512
  // Some browsers don't allow to use bind on console object anyway
513
513
  // fallback to default if needed
514
514
  try {
515
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.9-0.canary.10273"}`);
515
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.9-0.canary.10276"}`);
516
516
  } catch (e) {
517
517
  /* log fn threw an exception. All logger methods are no-ops. */
518
518
  return createLogger();
@@ -12037,7 +12037,7 @@ class Decrypter {
12037
12037
  /* no-op */
12038
12038
  }
12039
12039
  }
12040
- this.useSoftware = this.subtle === null;
12040
+ this.useSoftware = !this.subtle;
12041
12041
  }
12042
12042
  destroy() {
12043
12043
  this.subtle = null;
@@ -12135,18 +12135,20 @@ class Decrypter {
12135
12135
  return result;
12136
12136
  }
12137
12137
  webCryptoDecrypt(data, key, iv, aesMode) {
12138
- const subtle = this.subtle;
12139
12138
  if (this.key !== key || !this.fastAesKey) {
12139
+ if (!this.subtle) {
12140
+ return Promise.resolve(this.onWebCryptoError(data, key, iv, aesMode));
12141
+ }
12140
12142
  this.key = key;
12141
- this.fastAesKey = new FastAESKey(subtle, key, aesMode);
12143
+ this.fastAesKey = new FastAESKey(this.subtle, key, aesMode);
12142
12144
  }
12143
12145
  return this.fastAesKey.expandKey().then(aesKey => {
12144
12146
  // decrypt using web crypto
12145
- if (!subtle) {
12147
+ if (!this.subtle) {
12146
12148
  return Promise.reject(new Error('web crypto not initialized'));
12147
12149
  }
12148
12150
  this.logOnce('WebCrypto AES decrypt');
12149
- const crypto = new AESCrypto(subtle, new Uint8Array(iv), aesMode);
12151
+ const crypto = new AESCrypto(this.subtle, new Uint8Array(iv), aesMode);
12150
12152
  return crypto.decrypt(data.buffer, aesKey);
12151
12153
  }).catch(err => {
12152
12154
  logger.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${err.name}: ${err.message}`);
@@ -20380,7 +20382,7 @@ class Hls {
20380
20382
  * Get the video-dev/hls.js package version.
20381
20383
  */
20382
20384
  static get version() {
20383
- return "1.5.9-0.canary.10273";
20385
+ return "1.5.9-0.canary.10276";
20384
20386
  }
20385
20387
 
20386
20388
  /**