hls.js 1.6.0-beta.1.0.canary.10810 → 1.6.0-beta.1.0.canary.10812

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.10810"}`);
403
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10812"}`);
404
404
  } catch (e) {
405
405
  /* log fn threw an exception. All logger methods are no-ops. */
406
406
  return createLogger();
@@ -9835,7 +9835,7 @@ var eventemitter3 = {exports: {}};
9835
9835
  var eventemitter3Exports = eventemitter3.exports;
9836
9836
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9837
9837
 
9838
- const version = "1.6.0-beta.1.0.canary.10810";
9838
+ const version = "1.6.0-beta.1.0.canary.10812";
9839
9839
 
9840
9840
  // ensure the worker ends up in the bundle
9841
9841
  // If the worker should not be included this gets aliased to empty.js
@@ -14346,19 +14346,23 @@ class MP4Remuxer {
14346
14346
  this.videoTrackConfig = undefined;
14347
14347
  }
14348
14348
  getVideoStartPts(videoSamples) {
14349
+ // Get the minimum PTS value relative to the first sample's PTS, normalized for 33-bit wrapping
14349
14350
  let rolloverDetected = false;
14351
+ const firstPts = videoSamples[0].pts;
14350
14352
  const startPTS = videoSamples.reduce((minPTS, sample) => {
14351
- const delta = sample.pts - minPTS;
14353
+ let pts = sample.pts;
14354
+ let delta = pts - minPTS;
14352
14355
  if (delta < -4294967296) {
14353
14356
  // 2^32, see PTSNormalize for reasoning, but we're hitting a rollover here, and we don't want that to impact the timeOffset calculation
14354
14357
  rolloverDetected = true;
14355
- return normalizePts(minPTS, sample.pts);
14356
- } else if (delta > 0) {
14358
+ pts = normalizePts(pts, firstPts);
14359
+ delta = pts - minPTS;
14360
+ }
14361
+ if (delta > 0) {
14357
14362
  return minPTS;
14358
- } else {
14359
- return sample.pts;
14360
14363
  }
14361
- }, videoSamples[0].pts);
14364
+ return pts;
14365
+ }, firstPts);
14362
14366
  if (rolloverDetected) {
14363
14367
  this.logger.debug('PTS rollover detected');
14364
14368
  }
@@ -32993,7 +32997,11 @@ class PlaylistLoader {
32993
32997
  startTimeOffset,
32994
32998
  variableList
32995
32999
  });
32996
- this.checkAutostartLoad();
33000
+ }
33001
+ onManifestLoaded(event, data) {
33002
+ if (!data.isMediaPlaylist) {
33003
+ this.checkAutostartLoad();
33004
+ }
32997
33005
  }
32998
33006
  handleTrackOrLevelPlaylist(response, stats, context, networkDetails, loader) {
32999
33007
  const hls = this.hls;
@@ -33029,7 +33037,8 @@ class PlaylistLoader {
33029
33037
  sessionKeys: null,
33030
33038
  contentSteering: null,
33031
33039
  startTimeOffset: null,
33032
- variableList: null
33040
+ variableList: null,
33041
+ isMediaPlaylist: true
33033
33042
  });
33034
33043
  }
33035
33044
 
@@ -33380,6 +33389,8 @@ class Hls {
33380
33389
  if (typeof onErrorOut === 'function') {
33381
33390
  this.on(Events.ERROR, onErrorOut, errorController);
33382
33391
  }
33392
+ // Autostart load handler
33393
+ this.on(Events.MANIFEST_LOADED, playListLoader.onManifestLoaded, playListLoader);
33383
33394
  }
33384
33395
  createController(ControllerClass, components) {
33385
33396
  if (ControllerClass) {