@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/core.js CHANGED
@@ -42535,13 +42535,16 @@ 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
  */
42542
42545
  createError(errorData, options) {
42543
42546
  trace(`${T$1} createError`, {
42544
- errorData: structuredClone(errorData),
42547
+ errorData: { ...errorData },
42545
42548
  });
42546
42549
  const i18n = this.i18n ||
42547
42550
  // @ts-ignore
@@ -42559,6 +42562,48 @@ class HTML5Video extends BasePlayback {
42559
42562
  }
42560
42563
  return super.createError(errorData, { ...options, useCodePrefix: false });
42561
42564
  }
42565
+ _onWaiting() {
42566
+ trace(`${T$1} _onWaiting`);
42567
+ super._onWaiting();
42568
+ }
42569
+ _onEnded() {
42570
+ trace(`${T$1} _onEnded`);
42571
+ if (this.stallTimerId) {
42572
+ clearTimeout(this.stallTimerId);
42573
+ this.stallTimerId = null;
42574
+ }
42575
+ super._onEnded();
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
+ message: 'Stall timeout',
42593
+ });
42594
+ }
42595
+ }, STALL_TIMEOUT);
42596
+ }
42597
+ super._handleBufferingEvents();
42598
+ }
42599
+ _onPlaying() {
42600
+ trace(`${T$1} _onPlaying`);
42601
+ if (this.stallTimerId) {
42602
+ clearTimeout(this.stallTimerId);
42603
+ this.stallTimerId = null;
42604
+ }
42605
+ super._onPlaying();
42606
+ }
42562
42607
  }
42563
42608
 
42564
42609
  // TODO consider allowing the variation of the order of playback modules
@@ -43032,7 +43077,7 @@ class Player {
43032
43077
  }
43033
43078
  }
43034
43079
 
43035
- var version$1 = "2.20.16";
43080
+ var version$1 = "2.20.18";
43036
43081
 
43037
43082
  var packages = {
43038
43083
  "node_modules/@clappr/core": {