hls.js 1.6.0-beta.1.0.canary.10806 → 1.6.0-beta.1.0.canary.10809

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
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
400
400
  // Some browsers don't allow to use bind on console object anyway
401
401
  // fallback to default if needed
402
402
  try {
403
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10806"}`);
403
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10809"}`);
404
404
  } catch (e) {
405
405
  /* log fn threw an exception. All logger methods are no-ops. */
406
406
  return createLogger();
@@ -5235,7 +5235,8 @@ class Decrypter {
5235
5235
  decrypt(data, key, iv, aesMode) {
5236
5236
  if (this.useSoftware) {
5237
5237
  return new Promise((resolve, reject) => {
5238
- this.softwareDecrypt(new Uint8Array(data), key, iv, aesMode);
5238
+ const dataView = ArrayBuffer.isView(data) ? data : new Uint8Array(data);
5239
+ this.softwareDecrypt(dataView, key, iv, aesMode);
5239
5240
  const decryptResult = this.flush();
5240
5241
  if (decryptResult) {
5241
5242
  resolve(decryptResult.buffer);
@@ -9830,7 +9831,7 @@ var eventemitter3 = {exports: {}};
9830
9831
  var eventemitter3Exports = eventemitter3.exports;
9831
9832
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9832
9833
 
9833
- const version = "1.6.0-beta.1.0.canary.10806";
9834
+ const version = "1.6.0-beta.1.0.canary.10809";
9834
9835
 
9835
9836
  // ensure the worker ends up in the bundle
9836
9837
  // If the worker should not be included this gets aliased to empty.js
@@ -15445,7 +15446,8 @@ class Transmuxer {
15445
15446
  // For Low-Latency HLS Parts, decrypt in place, since part parsing is expected on push progress
15446
15447
  const loadingParts = chunkMeta.part > -1;
15447
15448
  if (loadingParts) {
15448
- decryptedData = decrypter.flush();
15449
+ const _data = decrypter.flush();
15450
+ decryptedData = _data ? _data.buffer : _data;
15449
15451
  }
15450
15452
  if (!decryptedData) {
15451
15453
  stats.executeEnd = now();
@@ -15527,7 +15529,7 @@ class Transmuxer {
15527
15529
  const decryptedData = decrypter.flush();
15528
15530
  if (decryptedData) {
15529
15531
  // Push always returns a TransmuxerResult if decryptdata is null
15530
- transmuxResults.push(this.push(decryptedData, null, chunkMeta));
15532
+ transmuxResults.push(this.push(decryptedData.buffer, null, chunkMeta));
15531
15533
  }
15532
15534
  }
15533
15535
  const {
@@ -16260,7 +16262,7 @@ class AudioStreamController extends BaseStreamController {
16260
16262
  if (this.initPTS[frag.cc] !== undefined) {
16261
16263
  this.waitingData = null;
16262
16264
  this.state = State.FRAG_LOADING;
16263
- const payload = cache.flush();
16265
+ const payload = cache.flush().buffer;
16264
16266
  const data = {
16265
16267
  frag,
16266
16268
  part,
@@ -21067,7 +21069,7 @@ class EMEController extends Logger {
21067
21069
  const json = bin2str(new Uint8Array(initData));
21068
21070
  try {
21069
21071
  const sinf = base64Decode(JSON.parse(json).sinf);
21070
- const tenc = parseSinf(new Uint8Array(sinf));
21072
+ const tenc = parseSinf(sinf);
21071
21073
  if (!tenc) {
21072
21074
  throw new Error(`'schm' box missing or not cbcs/cenc with schi > tenc`);
21073
21075
  }
@@ -21332,7 +21334,7 @@ class EMEController extends Logger {
21332
21334
  const keySessionContext = this.createMediaKeySessionContext(mediaKeySessionContext);
21333
21335
  const keyId = this.getKeyIdString(decryptdata);
21334
21336
  const scheme = 'cenc';
21335
- this.keyIdToKeySessionPromise[keyId] = this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh, 'expired');
21337
+ this.keyIdToKeySessionPromise[keyId] = this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh.buffer, 'expired');
21336
21338
  } else {
21337
21339
  this.warn(`Could not renew expired session. Missing pssh initData.`);
21338
21340
  }
@@ -21402,7 +21404,8 @@ class EMEController extends Logger {
21402
21404
  });
21403
21405
  const keySessionContextPromise = this.keyIdToKeySessionPromise[keyId] = keyContextPromise.then(keySessionContext => {
21404
21406
  const scheme = 'cenc';
21405
- return this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh, 'playlist-key');
21407
+ const initData = decryptdata.pssh ? decryptdata.pssh.buffer : null;
21408
+ return this.generateRequestWithPreferredKeySession(keySessionContext, scheme, initData, 'playlist-key');
21406
21409
  });
21407
21410
  keySessionContextPromise.catch(error => this.handleError(error));
21408
21411
  }
@@ -21482,7 +21485,8 @@ class EMEController extends Logger {
21482
21485
  throw new Error('Invalid response from configured generateRequest filter');
21483
21486
  }
21484
21487
  initDataType = mappedInitData.initDataType;
21485
- initData = context.decryptdata.pssh = mappedInitData.initData ? new Uint8Array(mappedInitData.initData) : null;
21488
+ initData = mappedInitData.initData ? mappedInitData.initData : null;
21489
+ context.decryptdata.pssh = initData ? new Uint8Array(initData) : null;
21486
21490
  } catch (error) {
21487
21491
  var _this$hls;
21488
21492
  this.warn(error.message);
@@ -28445,7 +28449,7 @@ class TimelineController {
28445
28449
  }
28446
28450
  const hls = this.hls;
28447
28451
  // Parse the WebVTT file contents.
28448
- const payloadWebVTT = (_frag$initSegment = frag.initSegment) != null && _frag$initSegment.data ? appendUint8Array(frag.initSegment.data, new Uint8Array(payload)) : payload;
28452
+ const payloadWebVTT = (_frag$initSegment = frag.initSegment) != null && _frag$initSegment.data ? appendUint8Array(frag.initSegment.data, new Uint8Array(payload)).buffer : payload;
28449
28453
  parseWebVTT(payloadWebVTT, this.initPTS[frag.cc], this.vttCCs, frag.cc, frag.start, cues => {
28450
28454
  this._appendCues(cues, frag.level);
28451
28455
  hls.trigger(Events.SUBTITLE_FRAG_PROCESSED, {
@@ -28853,7 +28857,7 @@ class FetchLoader {
28853
28857
  return reader.read().then(data => {
28854
28858
  if (data.done) {
28855
28859
  if (chunkCache.dataLength) {
28856
- onProgress(stats, context, chunkCache.flush(), response);
28860
+ onProgress(stats, context, chunkCache.flush().buffer, response);
28857
28861
  }
28858
28862
  return Promise.resolve(new ArrayBuffer(0));
28859
28863
  }
@@ -28866,12 +28870,12 @@ class FetchLoader {
28866
28870
  chunkCache.push(chunk);
28867
28871
  if (chunkCache.dataLength >= highWaterMark) {
28868
28872
  // flush in order to join the typed arrays
28869
- onProgress(stats, context, chunkCache.flush(), response);
28873
+ onProgress(stats, context, chunkCache.flush().buffer, response);
28870
28874
  }
28871
28875
  } else {
28872
28876
  // If there's nothing cached already, and the chache is large enough
28873
28877
  // just emit the progress event
28874
- onProgress(stats, context, chunk, response);
28878
+ onProgress(stats, context, chunk.buffer, response);
28875
28879
  }
28876
28880
  return pump();
28877
28881
  }).catch(() => {