hls.js 1.6.0-beta.2.0.canary.10939 → 1.6.0-beta.2.0.canary.10942

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.
@@ -402,7 +402,7 @@ function enableLogs(debugConfig, context, id) {
402
402
  // Some browsers don't allow to use bind on console object anyway
403
403
  // fallback to default if needed
404
404
  try {
405
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10939"}`);
405
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10942"}`);
406
406
  } catch (e) {
407
407
  /* log fn threw an exception. All logger methods are no-ops. */
408
408
  return createLogger();
@@ -17889,7 +17889,7 @@ class GapController extends TaskLoop {
17889
17889
  * @private
17890
17890
  */
17891
17891
  _tryFixBufferStall(bufferInfo, stalledDurationMs) {
17892
- var _this$hls3;
17892
+ var _this$hls3, _this$hls4;
17893
17893
  const {
17894
17894
  fragmentTracker,
17895
17895
  media
@@ -17899,8 +17899,9 @@ class GapController extends TaskLoop {
17899
17899
  return;
17900
17900
  }
17901
17901
  const currentTime = media.currentTime;
17902
+ const levelDetails = (_this$hls4 = this.hls) == null ? undefined : _this$hls4.latestLevelDetails;
17902
17903
  const partial = fragmentTracker.getPartialFragment(currentTime);
17903
- if (partial) {
17904
+ if (partial || levelDetails != null && levelDetails.live && currentTime < levelDetails.fragmentStart) {
17904
17905
  // Try to skip over the buffer hole caused by a partial fragment
17905
17906
  // This method isn't limited by the size of the gap between buffered ranges
17906
17907
  const targetTime = this._trySkipBufferHole(partial);
@@ -17961,12 +17962,12 @@ class GapController extends TaskLoop {
17961
17962
  * @private
17962
17963
  */
17963
17964
  _trySkipBufferHole(partial) {
17964
- var _this$hls4;
17965
+ var _this$hls5;
17965
17966
  const {
17966
17967
  fragmentTracker,
17967
17968
  media
17968
17969
  } = this;
17969
- const config = (_this$hls4 = this.hls) == null ? undefined : _this$hls4.config;
17970
+ const config = (_this$hls5 = this.hls) == null ? undefined : _this$hls5.config;
17970
17971
  if (!media || !fragmentTracker || !config) {
17971
17972
  return 0;
17972
17973
  }
@@ -19365,7 +19366,7 @@ function assignTrackIdsByGroup(tracks) {
19365
19366
  });
19366
19367
  }
19367
19368
 
19368
- const version = "1.6.0-beta.2.0.canary.10939";
19369
+ const version = "1.6.0-beta.2.0.canary.10942";
19369
19370
 
19370
19371
  // ensure the worker ends up in the bundle
19371
19372
  // If the worker should not be included this gets aliased to empty.js
@@ -19798,14 +19799,18 @@ class StreamController extends BaseStreamController {
19798
19799
  this.onMediaSeeked = () => {
19799
19800
  const media = this.media;
19800
19801
  const currentTime = media ? media.currentTime : null;
19801
- if (isFiniteNumber(currentTime)) {
19802
- this.log(`Media seeked to ${currentTime.toFixed(3)}`);
19802
+ if (currentTime === null || !isFiniteNumber(currentTime)) {
19803
+ return;
19803
19804
  }
19805
+ this.log(`Media seeked to ${currentTime.toFixed(3)}`);
19804
19806
 
19805
19807
  // If seeked was issued before buffer was appended do not tick immediately
19806
- const bufferInfo = this.getMainFwdBufferInfo();
19808
+ if (!this.getBufferedFrag(currentTime)) {
19809
+ return;
19810
+ }
19811
+ const bufferInfo = this.getFwdBufferInfoAtPos(media, currentTime, PlaylistLevelType.MAIN, 0);
19807
19812
  if (bufferInfo === null || bufferInfo.len === 0) {
19808
- this.warn(`Main forward buffer length on "seeked" event ${bufferInfo ? bufferInfo.len : 'empty'})`);
19813
+ this.warn(`Main forward buffer length at ${currentTime} on "seeked" event ${bufferInfo ? bufferInfo.len : 'empty'})`);
19809
19814
  return;
19810
19815
  }
19811
19816