hls.js 1.5.2-0.canary.9969 → 1.5.2-0.canary.9970

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.light.js CHANGED
@@ -525,7 +525,7 @@
525
525
  // Some browsers don't allow to use bind on console object anyway
526
526
  // fallback to default if needed
527
527
  try {
528
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.2-0.canary.9969");
528
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.2-0.canary.9970");
529
529
  } catch (e) {
530
530
  /* log fn threw an exception. All logger methods are no-ops. */
531
531
  return createLogger();
@@ -7524,6 +7524,7 @@
7524
7524
  _this2.resetBuffer(type);
7525
7525
  });
7526
7526
  this._initSourceBuffer();
7527
+ this.hls.resumeBuffering();
7527
7528
  };
7528
7529
  _proto.resetBuffer = function resetBuffer(type) {
7529
7530
  var sb = this.sourceBuffer[type];
@@ -12294,6 +12295,7 @@
12294
12295
  _this.startFragRequested = false;
12295
12296
  _this.decrypter = void 0;
12296
12297
  _this.initPTS = [];
12298
+ _this.buffering = true;
12297
12299
  _this.onMediaSeeking = function () {
12298
12300
  var _assertThisInitialize = _assertThisInitialized(_this),
12299
12301
  config = _assertThisInitialize.config,
@@ -12397,6 +12399,12 @@
12397
12399
  this.clearNextTick();
12398
12400
  this.state = State.STOPPED;
12399
12401
  };
12402
+ _proto.pauseBuffering = function pauseBuffering() {
12403
+ this.buffering = false;
12404
+ };
12405
+ _proto.resumeBuffering = function resumeBuffering() {
12406
+ this.buffering = true;
12407
+ };
12400
12408
  _proto._streamEnded = function _streamEnded(bufferInfo, levelDetails) {
12401
12409
  // If playlist is live, there is another buffered range after the current range, nothing buffered, media is detached,
12402
12410
  // of nothing loading/loaded return false
@@ -19345,7 +19353,7 @@
19345
19353
  if (this.altAudio && this.audioOnly) {
19346
19354
  return;
19347
19355
  }
19348
- if (!(levels != null && levels[level])) {
19356
+ if (!this.buffering || !(levels != null && levels[level])) {
19349
19357
  return;
19350
19358
  }
19351
19359
  var levelInfo = levels[level];
@@ -20323,7 +20331,6 @@
20323
20331
  this.logger = void 0;
20324
20332
  this.coreComponents = void 0;
20325
20333
  this.networkControllers = void 0;
20326
- this.started = false;
20327
20334
  this._emitter = new EventEmitter();
20328
20335
  this._autoLevelCapping = -1;
20329
20336
  this._maxHdcpLevel = null;
@@ -20554,7 +20561,6 @@
20554
20561
  startPosition = -1;
20555
20562
  }
20556
20563
  this.logger.log("startLoad(" + startPosition + ")");
20557
- this.started = true;
20558
20564
  this.networkControllers.forEach(function (controller) {
20559
20565
  controller.startLoad(startPosition);
20560
20566
  });
@@ -20565,33 +20571,30 @@
20565
20571
  */;
20566
20572
  _proto.stopLoad = function stopLoad() {
20567
20573
  this.logger.log('stopLoad');
20568
- this.started = false;
20569
20574
  this.networkControllers.forEach(function (controller) {
20570
20575
  controller.stopLoad();
20571
20576
  });
20572
20577
  }
20573
20578
 
20574
20579
  /**
20575
- * Resumes stream controller segment loading if previously started.
20580
+ * Resumes stream controller segment loading after `pauseBuffering` has been called.
20576
20581
  */;
20577
20582
  _proto.resumeBuffering = function resumeBuffering() {
20578
- if (this.started) {
20579
- this.networkControllers.forEach(function (controller) {
20580
- if ('fragmentLoader' in controller) {
20581
- controller.startLoad(-1);
20582
- }
20583
- });
20584
- }
20583
+ this.networkControllers.forEach(function (controller) {
20584
+ if (controller.resumeBuffering) {
20585
+ controller.resumeBuffering();
20586
+ }
20587
+ });
20585
20588
  }
20586
20589
 
20587
20590
  /**
20588
- * Stops stream controller segment loading without changing 'started' state like stopLoad().
20591
+ * Prevents stream controller from loading new segments until `resumeBuffering` is called.
20589
20592
  * This allows for media buffering to be paused without interupting playlist loading.
20590
20593
  */;
20591
20594
  _proto.pauseBuffering = function pauseBuffering() {
20592
20595
  this.networkControllers.forEach(function (controller) {
20593
- if ('fragmentLoader' in controller) {
20594
- controller.stopLoad();
20596
+ if (controller.pauseBuffering) {
20597
+ controller.pauseBuffering();
20595
20598
  }
20596
20599
  });
20597
20600
  }
@@ -21148,7 +21151,7 @@
21148
21151
  * Get the video-dev/hls.js package version.
21149
21152
  */
21150
21153
  function get() {
21151
- return "1.5.2-0.canary.9969";
21154
+ return "1.5.2-0.canary.9970";
21152
21155
  }
21153
21156
  }, {
21154
21157
  key: "Events",