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.
package/dist/hls.mjs CHANGED
@@ -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();
@@ -5116,6 +5116,7 @@ class LatencyController {
5116
5116
  this.currentTime = 0;
5117
5117
  this.stallCount = 0;
5118
5118
  this._latency = null;
5119
+ this._targetLatencyUpdated = false;
5119
5120
  this.onTimeupdate = () => {
5120
5121
  const {
5121
5122
  media,
@@ -5193,12 +5194,17 @@ class LatencyController {
5193
5194
  } = this.config;
5194
5195
  const userConfig = this.hls.userConfig;
5195
5196
  let targetLatency = lowLatencyMode ? partHoldBack || holdBack : holdBack;
5196
- if (userConfig.liveSyncDuration || userConfig.liveSyncDurationCount || targetLatency === 0) {
5197
+ if (this._targetLatencyUpdated || userConfig.liveSyncDuration || userConfig.liveSyncDurationCount || targetLatency === 0) {
5197
5198
  targetLatency = liveSyncDuration !== undefined ? liveSyncDuration : liveSyncDurationCount * targetduration;
5198
5199
  }
5199
5200
  const maxLiveSyncOnStallIncrease = targetduration;
5200
5201
  return targetLatency + Math.min(this.stallCount * this.config.liveSyncOnStallIncrease, maxLiveSyncOnStallIncrease);
5201
5202
  }
5203
+ set targetLatency(latency) {
5204
+ this.stallCount = 0;
5205
+ this.config.liveSyncDuration = latency;
5206
+ this._targetLatencyUpdated = true;
5207
+ }
5202
5208
  get liveSyncPosition() {
5203
5209
  const liveEdge = this.estimateLiveEdge();
5204
5210
  const targetLatency = this.targetLatency;
@@ -29273,7 +29279,7 @@ class Hls {
29273
29279
  * Get the video-dev/hls.js package version.
29274
29280
  */
29275
29281
  static get version() {
29276
- return "1.5.12-0.canary.10395";
29282
+ return "1.5.12-0.canary.10398";
29277
29283
  }
29278
29284
 
29279
29285
  /**
@@ -30068,6 +30074,9 @@ class Hls {
30068
30074
  get targetLatency() {
30069
30075
  return this.latencyController.targetLatency;
30070
30076
  }
30077
+ set targetLatency(latency) {
30078
+ this.latencyController.targetLatency = latency;
30079
+ }
30071
30080
 
30072
30081
  /**
30073
30082
  * the rate at which the edge of the current live playlist is advancing or 1 if there is none