@gcorevideo/player 2.20.17 → 2.20.19

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/index.js CHANGED
@@ -42621,7 +42621,10 @@ HlsPlayback.canPlay = function (resource, mimeType) {
42621
42621
  };
42622
42622
 
42623
42623
  const T$h = 'playback.html5_video';
42624
+ const STALL_TIMEOUT = 15000;
42624
42625
  class HTML5Video extends BasePlayback {
42626
+ stallTimerId = null;
42627
+ statllTimerId = null;
42625
42628
  /**
42626
42629
  * @internal
42627
42630
  */
@@ -42651,8 +42654,44 @@ class HTML5Video extends BasePlayback {
42651
42654
  }
42652
42655
  _onEnded() {
42653
42656
  trace(`${T$h} _onEnded`);
42657
+ if (this.stallTimerId) {
42658
+ clearTimeout(this.stallTimerId);
42659
+ this.stallTimerId = null;
42660
+ }
42654
42661
  super._onEnded();
42655
42662
  }
42663
+ _handleBufferingEvents() {
42664
+ trace(`${T$h} _handleBufferingEvents`, {
42665
+ networkState: this.el.networkState,
42666
+ });
42667
+ if (!this.statllTimerId) {
42668
+ this.statllTimerId = setTimeout(() => {
42669
+ trace(`${T$h} _handleBufferingEvents stall timeout`, {
42670
+ buffering: this.buffering,
42671
+ ended: this.ended,
42672
+ isPlaying: this.isPlaying,
42673
+ });
42674
+ this.statllTimerId = null;
42675
+ if (!this.isPlaying) {
42676
+ this.createError({
42677
+ code: PlaybackErrorCode.MediaSourceUnavailable,
42678
+ level: PlayerError.Levels.FATAL,
42679
+ message: 'Stall timeout',
42680
+ description: 'Playback stalled for too long',
42681
+ });
42682
+ }
42683
+ }, STALL_TIMEOUT);
42684
+ }
42685
+ super._handleBufferingEvents();
42686
+ }
42687
+ _onPlaying() {
42688
+ trace(`${T$h} _onPlaying`);
42689
+ if (this.stallTimerId) {
42690
+ clearTimeout(this.stallTimerId);
42691
+ this.stallTimerId = null;
42692
+ }
42693
+ super._onPlaying();
42694
+ }
42656
42695
  }
42657
42696
 
42658
42697
  // TODO consider allowing the variation of the order of playback modules
@@ -43126,7 +43165,7 @@ class Player {
43126
43165
  }
43127
43166
  }
43128
43167
 
43129
- var version$1 = "2.20.17";
43168
+ var version$1 = "2.20.19";
43130
43169
 
43131
43170
  var packages = {
43132
43171
  "node_modules/@clappr/core": {