@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/core.js CHANGED
@@ -42535,7 +42535,10 @@ HlsPlayback.canPlay = function (resource, mimeType) {
42535
42535
  };
42536
42536
 
42537
42537
  const T$1 = 'playback.html5_video';
42538
+ const STALL_TIMEOUT = 15000;
42538
42539
  class HTML5Video extends BasePlayback {
42540
+ stallTimerId = null;
42541
+ statllTimerId = null;
42539
42542
  /**
42540
42543
  * @internal
42541
42544
  */
@@ -42565,8 +42568,44 @@ class HTML5Video extends BasePlayback {
42565
42568
  }
42566
42569
  _onEnded() {
42567
42570
  trace(`${T$1} _onEnded`);
42571
+ if (this.stallTimerId) {
42572
+ clearTimeout(this.stallTimerId);
42573
+ this.stallTimerId = null;
42574
+ }
42568
42575
  super._onEnded();
42569
42576
  }
42577
+ _handleBufferingEvents() {
42578
+ trace(`${T$1} _handleBufferingEvents`, {
42579
+ networkState: this.el.networkState,
42580
+ });
42581
+ if (!this.statllTimerId) {
42582
+ this.statllTimerId = setTimeout(() => {
42583
+ trace(`${T$1} _handleBufferingEvents stall timeout`, {
42584
+ buffering: this.buffering,
42585
+ ended: this.ended,
42586
+ isPlaying: this.isPlaying,
42587
+ });
42588
+ this.statllTimerId = null;
42589
+ if (!this.isPlaying) {
42590
+ this.createError({
42591
+ code: PlaybackErrorCode.MediaSourceUnavailable,
42592
+ level: PlayerError.Levels.FATAL,
42593
+ message: 'Stall timeout',
42594
+ description: 'Playback stalled for too long',
42595
+ });
42596
+ }
42597
+ }, STALL_TIMEOUT);
42598
+ }
42599
+ super._handleBufferingEvents();
42600
+ }
42601
+ _onPlaying() {
42602
+ trace(`${T$1} _onPlaying`);
42603
+ if (this.stallTimerId) {
42604
+ clearTimeout(this.stallTimerId);
42605
+ this.stallTimerId = null;
42606
+ }
42607
+ super._onPlaying();
42608
+ }
42570
42609
  }
42571
42610
 
42572
42611
  // TODO consider allowing the variation of the order of playback modules
@@ -43040,7 +43079,7 @@ class Player {
43040
43079
  }
43041
43080
  }
43042
43081
 
43043
- var version$1 = "2.20.17";
43082
+ var version$1 = "2.20.19";
43044
43083
 
43045
43084
  var packages = {
43046
43085
  "node_modules/@clappr/core": {