hls.js 1.5.9-0.canary.10275 → 1.5.9-0.canary.10277

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
@@ -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.10275"}`);
515
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.9-0.canary.10277"}`);
516
516
  } catch (e) {
517
517
  /* log fn threw an exception. All logger methods are no-ops. */
518
518
  return createLogger();
@@ -9233,7 +9233,7 @@ class Decrypter {
9233
9233
  /* no-op */
9234
9234
  }
9235
9235
  }
9236
- this.useSoftware = this.subtle === null;
9236
+ this.useSoftware = !this.subtle;
9237
9237
  }
9238
9238
  destroy() {
9239
9239
  this.subtle = null;
@@ -9331,18 +9331,20 @@ class Decrypter {
9331
9331
  return result;
9332
9332
  }
9333
9333
  webCryptoDecrypt(data, key, iv, aesMode) {
9334
- const subtle = this.subtle;
9335
9334
  if (this.key !== key || !this.fastAesKey) {
9335
+ if (!this.subtle) {
9336
+ return Promise.resolve(this.onWebCryptoError(data, key, iv, aesMode));
9337
+ }
9336
9338
  this.key = key;
9337
- this.fastAesKey = new FastAESKey(subtle, key, aesMode);
9339
+ this.fastAesKey = new FastAESKey(this.subtle, key, aesMode);
9338
9340
  }
9339
9341
  return this.fastAesKey.expandKey().then(aesKey => {
9340
9342
  // decrypt using web crypto
9341
- if (!subtle) {
9343
+ if (!this.subtle) {
9342
9344
  return Promise.reject(new Error('web crypto not initialized'));
9343
9345
  }
9344
9346
  this.logOnce('WebCrypto AES decrypt');
9345
- const crypto = new AESCrypto(subtle, new Uint8Array(iv), aesMode);
9347
+ const crypto = new AESCrypto(this.subtle, new Uint8Array(iv), aesMode);
9346
9348
  return crypto.decrypt(data.buffer, aesKey);
9347
9349
  }).catch(err => {
9348
9350
  logger.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${err.name}: ${err.message}`);
@@ -13829,8 +13831,7 @@ function parsePMT(data, offset, typeSupported, isSampleAes) {
13829
13831
  case 0xc2: // SAMPLE-AES EC3
13830
13832
  /* falls through */
13831
13833
  case 0x87:
13832
- logger.warn('Unsupported EC-3 in M2TS found');
13833
- break;
13834
+ throw new Error('Unsupported EC-3 in M2TS found');
13834
13835
  case 0x24:
13835
13836
  // ITU-T Rec. H.265 and ISO/IEC 23008-2 (HEVC)
13836
13837
  {
@@ -16781,6 +16782,7 @@ class TransmuxerInterface {
16781
16782
  type: ErrorTypes.MEDIA_ERROR,
16782
16783
  details: ErrorDetails.FRAG_PARSING_ERROR,
16783
16784
  chunkMeta,
16785
+ frag: this.frag || undefined,
16784
16786
  fatal: false,
16785
16787
  error,
16786
16788
  err: error,
@@ -29014,7 +29016,7 @@ class Hls {
29014
29016
  * Get the video-dev/hls.js package version.
29015
29017
  */
29016
29018
  static get version() {
29017
- return "1.5.9-0.canary.10275";
29019
+ return "1.5.9-0.canary.10277";
29018
29020
  }
29019
29021
 
29020
29022
  /**