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.js CHANGED
@@ -1057,7 +1057,7 @@
1057
1057
  // Some browsers don't allow to use bind on console object anyway
1058
1058
  // fallback to default if needed
1059
1059
  try {
1060
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10806");
1060
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10809");
1061
1061
  } catch (e) {
1062
1062
  /* log fn threw an exception. All logger methods are no-ops. */
1063
1063
  return createLogger();
@@ -5862,7 +5862,8 @@
5862
5862
  var _this = this;
5863
5863
  if (this.useSoftware) {
5864
5864
  return new Promise(function (resolve, reject) {
5865
- _this.softwareDecrypt(new Uint8Array(data), key, iv, aesMode);
5865
+ var dataView = ArrayBuffer.isView(data) ? data : new Uint8Array(data);
5866
+ _this.softwareDecrypt(dataView, key, iv, aesMode);
5866
5867
  var decryptResult = _this.flush();
5867
5868
  if (decryptResult) {
5868
5869
  resolve(decryptResult.buffer);
@@ -15844,7 +15845,8 @@
15844
15845
  // For Low-Latency HLS Parts, decrypt in place, since part parsing is expected on push progress
15845
15846
  var loadingParts = chunkMeta.part > -1;
15846
15847
  if (loadingParts) {
15847
- decryptedData = decrypter.flush();
15848
+ var _data = decrypter.flush();
15849
+ decryptedData = _data ? _data.buffer : _data;
15848
15850
  }
15849
15851
  if (!decryptedData) {
15850
15852
  stats.executeEnd = now();
@@ -15924,7 +15926,7 @@
15924
15926
  var decryptedData = decrypter.flush();
15925
15927
  if (decryptedData) {
15926
15928
  // Push always returns a TransmuxerResult if decryptdata is null
15927
- transmuxResults.push(this.push(decryptedData, null, chunkMeta));
15929
+ transmuxResults.push(this.push(decryptedData.buffer, null, chunkMeta));
15928
15930
  }
15929
15931
  }
15930
15932
  var demuxer = this.demuxer,
@@ -16286,7 +16288,7 @@
16286
16288
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16287
16289
  }
16288
16290
 
16289
- var version = "1.6.0-beta.1.0.canary.10806";
16291
+ var version = "1.6.0-beta.1.0.canary.10809";
16290
16292
 
16291
16293
  // ensure the worker ends up in the bundle
16292
16294
  // If the worker should not be included this gets aliased to empty.js
@@ -16852,7 +16854,7 @@
16852
16854
  if (this.initPTS[frag.cc] !== undefined) {
16853
16855
  this.waitingData = null;
16854
16856
  this.state = State.FRAG_LOADING;
16855
- var payload = cache.flush();
16857
+ var payload = cache.flush().buffer;
16856
16858
  var data = {
16857
16859
  frag: frag,
16858
16860
  part: part,
@@ -21736,7 +21738,7 @@
21736
21738
  var json = bin2str(new Uint8Array(initData));
21737
21739
  try {
21738
21740
  var sinf = base64Decode(JSON.parse(json).sinf);
21739
- var tenc = parseSinf(new Uint8Array(sinf));
21741
+ var tenc = parseSinf(sinf);
21740
21742
  if (!tenc) {
21741
21743
  throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");
21742
21744
  }
@@ -22022,7 +22024,7 @@
22022
22024
  var keySessionContext = this.createMediaKeySessionContext(mediaKeySessionContext);
22023
22025
  var keyId = this.getKeyIdString(decryptdata);
22024
22026
  var scheme = 'cenc';
22025
- this.keyIdToKeySessionPromise[keyId] = this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh, 'expired');
22027
+ this.keyIdToKeySessionPromise[keyId] = this.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh.buffer, 'expired');
22026
22028
  } else {
22027
22029
  this.warn("Could not renew expired session. Missing pssh initData.");
22028
22030
  }
@@ -22093,7 +22095,8 @@
22093
22095
  });
22094
22096
  var keySessionContextPromise = this.keyIdToKeySessionPromise[keyId] = keyContextPromise.then(function (keySessionContext) {
22095
22097
  var scheme = 'cenc';
22096
- return _this6.generateRequestWithPreferredKeySession(keySessionContext, scheme, decryptdata.pssh, 'playlist-key');
22098
+ var initData = decryptdata.pssh ? decryptdata.pssh.buffer : null;
22099
+ return _this6.generateRequestWithPreferredKeySession(keySessionContext, scheme, initData, 'playlist-key');
22097
22100
  });
22098
22101
  keySessionContextPromise.catch(function (error) {
22099
22102
  return _this6.handleError(error);
@@ -22180,7 +22183,8 @@
22180
22183
  throw new Error('Invalid response from configured generateRequest filter');
22181
22184
  }
22182
22185
  initDataType = mappedInitData.initDataType;
22183
- initData = context.decryptdata.pssh = mappedInitData.initData ? new Uint8Array(mappedInitData.initData) : null;
22186
+ initData = mappedInitData.initData ? mappedInitData.initData : null;
22187
+ context.decryptdata.pssh = initData ? new Uint8Array(initData) : null;
22184
22188
  } catch (error) {
22185
22189
  var _this$hls;
22186
22190
  this.warn(error.message);
@@ -29352,7 +29356,7 @@
29352
29356
  }
29353
29357
  var hls = this.hls;
29354
29358
  // Parse the WebVTT file contents.
29355
- var payloadWebVTT = (_frag$initSegment = frag.initSegment) != null && _frag$initSegment.data ? appendUint8Array(frag.initSegment.data, new Uint8Array(payload)) : payload;
29359
+ var payloadWebVTT = (_frag$initSegment = frag.initSegment) != null && _frag$initSegment.data ? appendUint8Array(frag.initSegment.data, new Uint8Array(payload)).buffer : payload;
29356
29360
  parseWebVTT(payloadWebVTT, this.initPTS[frag.cc], this.vttCCs, frag.cc, frag.start, function (cues) {
29357
29361
  _this5._appendCues(cues, frag.level);
29358
29362
  hls.trigger(Events.SUBTITLE_FRAG_PROCESSED, {
@@ -29761,7 +29765,7 @@
29761
29765
  return reader.read().then(function (data) {
29762
29766
  if (data.done) {
29763
29767
  if (chunkCache.dataLength) {
29764
- onProgress(stats, context, chunkCache.flush(), response);
29768
+ onProgress(stats, context, chunkCache.flush().buffer, response);
29765
29769
  }
29766
29770
  return Promise.resolve(new ArrayBuffer(0));
29767
29771
  }
@@ -29774,12 +29778,12 @@
29774
29778
  chunkCache.push(chunk);
29775
29779
  if (chunkCache.dataLength >= highWaterMark) {
29776
29780
  // flush in order to join the typed arrays
29777
- onProgress(stats, context, chunkCache.flush(), response);
29781
+ onProgress(stats, context, chunkCache.flush().buffer, response);
29778
29782
  }
29779
29783
  } else {
29780
29784
  // If there's nothing cached already, and the chache is large enough
29781
29785
  // just emit the progress event
29782
- onProgress(stats, context, chunk, response);
29786
+ onProgress(stats, context, chunk.buffer, response);
29783
29787
  }
29784
29788
  return _pump();
29785
29789
  }).catch(function () {