hls.js 1.5.12-0.canary.10395 → 1.5.12-0.canary.10398

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.
@@ -420,7 +420,7 @@ function enableLogs(debugConfig, context, id) {
420
420
  // Some browsers don't allow to use bind on console object anyway
421
421
  // fallback to default if needed
422
422
  try {
423
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.12-0.canary.10395"}`);
423
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.12-0.canary.10398"}`);
424
424
  } catch (e) {
425
425
  /* log fn threw an exception. All logger methods are no-ops. */
426
426
  return createLogger();
@@ -4570,6 +4570,7 @@ class LatencyController {
4570
4570
  this.currentTime = 0;
4571
4571
  this.stallCount = 0;
4572
4572
  this._latency = null;
4573
+ this._targetLatencyUpdated = false;
4573
4574
  this.onTimeupdate = () => {
4574
4575
  const {
4575
4576
  media,
@@ -4647,12 +4648,17 @@ class LatencyController {
4647
4648
  } = this.config;
4648
4649
  const userConfig = this.hls.userConfig;
4649
4650
  let targetLatency = lowLatencyMode ? partHoldBack || holdBack : holdBack;
4650
- if (userConfig.liveSyncDuration || userConfig.liveSyncDurationCount || targetLatency === 0) {
4651
+ if (this._targetLatencyUpdated || userConfig.liveSyncDuration || userConfig.liveSyncDurationCount || targetLatency === 0) {
4651
4652
  targetLatency = liveSyncDuration !== undefined ? liveSyncDuration : liveSyncDurationCount * targetduration;
4652
4653
  }
4653
4654
  const maxLiveSyncOnStallIncrease = targetduration;
4654
4655
  return targetLatency + Math.min(this.stallCount * this.config.liveSyncOnStallIncrease, maxLiveSyncOnStallIncrease);
4655
4656
  }
4657
+ set targetLatency(latency) {
4658
+ this.stallCount = 0;
4659
+ this.config.liveSyncDuration = latency;
4660
+ this._targetLatencyUpdated = true;
4661
+ }
4656
4662
  get liveSyncPosition() {
4657
4663
  const liveEdge = this.estimateLiveEdge();
4658
4664
  const targetLatency = this.targetLatency;
@@ -20658,7 +20664,7 @@ class Hls {
20658
20664
  * Get the video-dev/hls.js package version.
20659
20665
  */
20660
20666
  static get version() {
20661
- return "1.5.12-0.canary.10395";
20667
+ return "1.5.12-0.canary.10398";
20662
20668
  }
20663
20669
 
20664
20670
  /**
@@ -21453,6 +21459,9 @@ class Hls {
21453
21459
  get targetLatency() {
21454
21460
  return this.latencyController.targetLatency;
21455
21461
  }
21462
+ set targetLatency(latency) {
21463
+ this.latencyController.targetLatency = latency;
21464
+ }
21456
21465
 
21457
21466
  /**
21458
21467
  * the rate at which the edge of the current live playlist is advancing or 1 if there is none