@gcorevideo/player 2.28.10 → 2.28.12

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.
@@ -49329,21 +49329,22 @@ class HTML5Video extends BasePlayback {
49329
49329
  super._onEnded();
49330
49330
  }
49331
49331
  _handleBufferingEvents() {
49332
- // TODO use the logic from the base class to detect if it's stalled or resumed, because in the latter case the current behavior is not correct
49333
- if (!this.stallTimerId) {
49334
- this.stallTimerId = setTimeout(() => {
49335
- this.stallTimerId = null;
49336
- const error = this.createError({
49337
- code: PlaybackErrorCode.MediaSourceUnavailable,
49338
- level: PlayerError.Levels.FATAL,
49339
- message: 'Stall timeout',
49340
- description: 'Playback stalled for too long',
49341
- });
49342
- this.trigger(Events$1.PLAYBACK_ERROR, error);
49343
- setTimeout(() => this.stop(), 0);
49344
- }, STALL_TIMEOUT);
49345
- }
49346
49332
  super._handleBufferingEvents();
49333
+ // TODO test case: playback stalled and then resumed. The should be no MediaSourceUnavailable/"Stall timeout" error
49334
+ if (!this._isBuffering || this.stallTimerId) {
49335
+ return;
49336
+ }
49337
+ this.stallTimerId = setTimeout(() => {
49338
+ this.stallTimerId = null;
49339
+ const error = this.createError({
49340
+ code: PlaybackErrorCode.MediaSourceUnavailable,
49341
+ level: PlayerError.Levels.FATAL,
49342
+ message: 'Stall timeout',
49343
+ description: 'Playback stalled for too long',
49344
+ });
49345
+ this.trigger(Events$1.PLAYBACK_ERROR, error);
49346
+ setTimeout(() => this.stop(), 0);
49347
+ }, STALL_TIMEOUT);
49347
49348
  }
49348
49349
  _onPlaying() {
49349
49350
  if (this.stallTimerId) {
package/dist/index.js CHANGED
@@ -49490,21 +49490,22 @@ class HTML5Video extends BasePlayback {
49490
49490
  super._onEnded();
49491
49491
  }
49492
49492
  _handleBufferingEvents() {
49493
- // TODO use the logic from the base class to detect if it's stalled or resumed, because in the latter case the current behavior is not correct
49494
- if (!this.stallTimerId) {
49495
- this.stallTimerId = setTimeout(() => {
49496
- this.stallTimerId = null;
49497
- const error = this.createError({
49498
- code: PlaybackErrorCode.MediaSourceUnavailable,
49499
- level: PlayerError.Levels.FATAL,
49500
- message: 'Stall timeout',
49501
- description: 'Playback stalled for too long',
49502
- });
49503
- this.trigger(Events$1.PLAYBACK_ERROR, error);
49504
- setTimeout(() => this.stop(), 0);
49505
- }, STALL_TIMEOUT);
49506
- }
49507
49493
  super._handleBufferingEvents();
49494
+ // TODO test case: playback stalled and then resumed. The should be no MediaSourceUnavailable/"Stall timeout" error
49495
+ if (!this._isBuffering || this.stallTimerId) {
49496
+ return;
49497
+ }
49498
+ this.stallTimerId = setTimeout(() => {
49499
+ this.stallTimerId = null;
49500
+ const error = this.createError({
49501
+ code: PlaybackErrorCode.MediaSourceUnavailable,
49502
+ level: PlayerError.Levels.FATAL,
49503
+ message: 'Stall timeout',
49504
+ description: 'Playback stalled for too long',
49505
+ });
49506
+ this.trigger(Events$1.PLAYBACK_ERROR, error);
49507
+ setTimeout(() => this.stop(), 0);
49508
+ }, STALL_TIMEOUT);
49508
49509
  }
49509
49510
  _onPlaying() {
49510
49511
  if (this.stallTimerId) {
@@ -50043,7 +50044,7 @@ class Player {
50043
50044
  }
50044
50045
  }
50045
50046
 
50046
- var version$1 = "2.28.10";
50047
+ var version$1 = "2.28.12";
50047
50048
 
50048
50049
  var packages = {
50049
50050
  "node_modules/@clappr/core": {
@@ -1 +1 @@
1
- {"version":3,"file":"HTML5Video.d.ts","sourceRoot":"","sources":["../../src/playback/HTML5Video.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AAMzE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,YAAY;IAClD,OAAO,CAAC,YAAY,CAAuB;IAE3C;;OAEG;IACM,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;IAkBlD,UAAU;IAIV,QAAQ;IAQR,sBAAsB;IAkBtB,UAAU;IAQV,QAAQ;IAQjB,IAAI,WAAW,IAAI,UAAU,EAAE,CAgB9B;IAGD,IAAI,iBAAiB,sBAiBpB;IAED,gBAAgB,CAAC,EAAE,EAAE,MAAM;CAa5B"}
1
+ {"version":3,"file":"HTML5Video.d.ts","sourceRoot":"","sources":["../../src/playback/HTML5Video.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AAMzE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,YAAY;IAClD,OAAO,CAAC,YAAY,CAAuB;IAE3C;;OAEG;IACM,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;IAkBlD,UAAU;IAIV,QAAQ;IAQR,sBAAsB;IAmBtB,UAAU;IAQV,QAAQ;IAQjB,IAAI,WAAW,IAAI,UAAU,EAAE,CAgB9B;IAGD,IAAI,iBAAiB,sBAiBpB;IAED,gBAAgB,CAAC,EAAE,EAAE,MAAM;CAa5B"}
@@ -33,21 +33,22 @@ export default class HTML5Video extends BasePlayback {
33
33
  super._onEnded();
34
34
  }
35
35
  _handleBufferingEvents() {
36
- // TODO use the logic from the base class to detect if it's stalled or resumed, because in the latter case the current behavior is not correct
37
- if (!this.stallTimerId) {
38
- this.stallTimerId = setTimeout(() => {
39
- this.stallTimerId = null;
40
- const error = this.createError({
41
- code: PlaybackErrorCode.MediaSourceUnavailable,
42
- level: PlayerError.Levels.FATAL,
43
- message: 'Stall timeout',
44
- description: 'Playback stalled for too long',
45
- });
46
- this.trigger(ClapprEvents.PLAYBACK_ERROR, error);
47
- setTimeout(() => this.stop(), 0);
48
- }, STALL_TIMEOUT);
49
- }
50
36
  super._handleBufferingEvents();
37
+ // TODO test case: playback stalled and then resumed. The should be no MediaSourceUnavailable/"Stall timeout" error
38
+ if (!this._isBuffering || this.stallTimerId) {
39
+ return;
40
+ }
41
+ this.stallTimerId = setTimeout(() => {
42
+ this.stallTimerId = null;
43
+ const error = this.createError({
44
+ code: PlaybackErrorCode.MediaSourceUnavailable,
45
+ level: PlayerError.Levels.FATAL,
46
+ message: 'Stall timeout',
47
+ description: 'Playback stalled for too long',
48
+ });
49
+ this.trigger(ClapprEvents.PLAYBACK_ERROR, error);
50
+ setTimeout(() => this.stop(), 0);
51
+ }, STALL_TIMEOUT);
51
52
  }
52
53
  _onPlaying() {
53
54
  if (this.stallTimerId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gcorevideo/player",
3
- "version": "2.28.10",
3
+ "version": "2.28.12",
4
4
  "description": "Gcore JavaScript video player",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -48,21 +48,22 @@ export default class HTML5Video extends BasePlayback {
48
48
  }
49
49
 
50
50
  override _handleBufferingEvents() {
51
- // TODO use the logic from the base class to detect if it's stalled or resumed, because in the latter case the current behavior is not correct
52
- if (!this.stallTimerId) {
53
- this.stallTimerId = setTimeout(() => {
54
- this.stallTimerId = null
55
- const error = this.createError({
56
- code: PlaybackErrorCode.MediaSourceUnavailable,
57
- level: PlayerError.Levels.FATAL,
58
- message: 'Stall timeout',
59
- description: 'Playback stalled for too long',
60
- })
61
- this.trigger(ClapprEvents.PLAYBACK_ERROR, error)
62
- setTimeout(() => this.stop(), 0)
63
- }, STALL_TIMEOUT)
64
- }
65
51
  super._handleBufferingEvents()
52
+ // TODO test case: playback stalled and then resumed. The should be no MediaSourceUnavailable/"Stall timeout" error
53
+ if (!this._isBuffering || this.stallTimerId) {
54
+ return
55
+ }
56
+ this.stallTimerId = setTimeout(() => {
57
+ this.stallTimerId = null
58
+ const error = this.createError({
59
+ code: PlaybackErrorCode.MediaSourceUnavailable,
60
+ level: PlayerError.Levels.FATAL,
61
+ message: 'Stall timeout',
62
+ description: 'Playback stalled for too long',
63
+ })
64
+ this.trigger(ClapprEvents.PLAYBACK_ERROR, error)
65
+ setTimeout(() => this.stop(), 0)
66
+ }, STALL_TIMEOUT)
66
67
  }
67
68
 
68
69
  override _onPlaying() {