@gcorevideo/player 2.20.16 → 2.20.18

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,13 +42621,16 @@ 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
  */
42628
42631
  createError(errorData, options) {
42629
42632
  trace(`${T$h} createError`, {
42630
- errorData: structuredClone(errorData),
42633
+ errorData: { ...errorData },
42631
42634
  });
42632
42635
  const i18n = this.i18n ||
42633
42636
  // @ts-ignore
@@ -42645,6 +42648,48 @@ class HTML5Video extends BasePlayback {
42645
42648
  }
42646
42649
  return super.createError(errorData, { ...options, useCodePrefix: false });
42647
42650
  }
42651
+ _onWaiting() {
42652
+ trace(`${T$h} _onWaiting`);
42653
+ super._onWaiting();
42654
+ }
42655
+ _onEnded() {
42656
+ trace(`${T$h} _onEnded`);
42657
+ if (this.stallTimerId) {
42658
+ clearTimeout(this.stallTimerId);
42659
+ this.stallTimerId = null;
42660
+ }
42661
+ super._onEnded();
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
+ message: 'Stall timeout',
42679
+ });
42680
+ }
42681
+ }, STALL_TIMEOUT);
42682
+ }
42683
+ super._handleBufferingEvents();
42684
+ }
42685
+ _onPlaying() {
42686
+ trace(`${T$h} _onPlaying`);
42687
+ if (this.stallTimerId) {
42688
+ clearTimeout(this.stallTimerId);
42689
+ this.stallTimerId = null;
42690
+ }
42691
+ super._onPlaying();
42692
+ }
42648
42693
  }
42649
42694
 
42650
42695
  // TODO consider allowing the variation of the order of playback modules
@@ -43118,7 +43163,7 @@ class Player {
43118
43163
  }
43119
43164
  }
43120
43165
 
43121
- var version$1 = "2.20.16";
43166
+ var version$1 = "2.20.18";
43122
43167
 
43123
43168
  var packages = {
43124
43169
  "node_modules/@clappr/core": {