@gcorevideo/player 2.20.18 → 2.20.20

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.
@@ -37249,7 +37249,7 @@ class ClipsPlugin extends UICorePlugin {
37249
37249
 
37250
37250
  const templateHtml$1 = "<ul class=\"context-menu-list\">\n <% if(options) { %>\n <% for (var i = 0; i < options.length; i++) { %>\n <li class=\"context-menu-list-item <%= options[i].class %>\"\n data-<%= options[i].name %>><%= options[i].label %></li>\n <% } %>\n <% } %>\n</ul>\n";
37251
37251
 
37252
- var version$1 = "2.20.18";
37252
+ var version$1 = "2.20.20";
37253
37253
 
37254
37254
  var packages = {
37255
37255
  "node_modules/@clappr/core": {
@@ -2,7 +2,6 @@ import { ErrorOptions } from '@clappr/core';
2
2
  import { BasePlayback } from './BasePlayback.js';
3
3
  export default class HTML5Video extends BasePlayback {
4
4
  private stallTimerId;
5
- private statllTimerId;
6
5
  /**
7
6
  * @internal
8
7
  */
@@ -11,5 +10,6 @@ export default class HTML5Video extends BasePlayback {
11
10
  _onEnded(): void;
12
11
  _handleBufferingEvents(): void;
13
12
  _onPlaying(): void;
13
+ _onPause(): void;
14
14
  }
15
15
  //# sourceMappingURL=HTML5Video.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HTML5Video.d.ts","sourceRoot":"","sources":["../../src/playback/HTML5Video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAQhD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,YAAY;IAClD,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,aAAa,CAA8B;IAEnD;;OAEG;IACM,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;IAyBlD,UAAU;IAKV,QAAQ;IASR,sBAAsB;IAuBtB,UAAU;CAQpB"}
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;AAQhD,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;IAyBlD,UAAU;IAKV,QAAQ;IASR,sBAAsB;IAsBtB,UAAU;IASV,QAAQ;CAQlB"}
@@ -1,3 +1,4 @@
1
+ import { PlayerError } from '@clappr/core';
1
2
  import { PlaybackErrorCode } from '../playback.types.js';
2
3
  import { BasePlayback } from './BasePlayback.js';
3
4
  import { trace } from '@gcorevideo/utils';
@@ -5,7 +6,6 @@ const T = 'playback.html5_video';
5
6
  const STALL_TIMEOUT = 15000;
6
7
  export default class HTML5Video extends BasePlayback {
7
8
  stallTimerId = null;
8
- statllTimerId = null;
9
9
  /**
10
10
  * @internal
11
11
  */
@@ -45,20 +45,19 @@ export default class HTML5Video extends BasePlayback {
45
45
  trace(`${T} _handleBufferingEvents`, {
46
46
  networkState: this.el.networkState,
47
47
  });
48
- if (!this.statllTimerId) {
49
- this.statllTimerId = setTimeout(() => {
48
+ if (!this.stallTimerId) {
49
+ this.stallTimerId = setTimeout(() => {
50
50
  trace(`${T} _handleBufferingEvents stall timeout`, {
51
51
  buffering: this.buffering,
52
52
  ended: this.ended,
53
- isPlaying: this.isPlaying,
54
53
  });
55
- this.statllTimerId = null;
56
- if (!this.isPlaying) {
57
- this.createError({
58
- code: PlaybackErrorCode.MediaSourceUnavailable,
59
- message: 'Stall timeout',
60
- });
61
- }
54
+ this.stallTimerId = null;
55
+ this.createError({
56
+ code: PlaybackErrorCode.MediaSourceUnavailable,
57
+ level: PlayerError.Levels.FATAL,
58
+ message: 'Stall timeout',
59
+ description: 'Playback stalled for too long',
60
+ });
62
61
  }, STALL_TIMEOUT);
63
62
  }
64
63
  super._handleBufferingEvents();
@@ -71,4 +70,12 @@ export default class HTML5Video extends BasePlayback {
71
70
  }
72
71
  super._onPlaying();
73
72
  }
73
+ _onPause() {
74
+ trace(`${T} _onPause`);
75
+ super._onPause();
76
+ if (this.stallTimerId) {
77
+ clearTimeout(this.stallTimerId);
78
+ this.stallTimerId = null;
79
+ }
80
+ }
74
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gcorevideo/player",
3
- "version": "2.20.18",
3
+ "version": "2.20.20",
4
4
  "description": "Gcore JavaScript video player",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,3 +1,4 @@
1
+ import { PlayerError } from '@clappr/core'
1
2
  import { ErrorOptions } from '@clappr/core'
2
3
 
3
4
  import { PlaybackErrorCode } from '../playback.types.js'
@@ -11,7 +12,6 @@ const STALL_TIMEOUT = 15000
11
12
 
12
13
  export default class HTML5Video extends BasePlayback {
13
14
  private stallTimerId: TimerId | null = null
14
- private statllTimerId: NodeJS.Timeout | null = null
15
15
 
16
16
  /**
17
17
  * @internal
@@ -59,20 +59,19 @@ export default class HTML5Video extends BasePlayback {
59
59
  trace(`${T} _handleBufferingEvents`, {
60
60
  networkState: (this.el as HTMLMediaElement).networkState,
61
61
  })
62
- if (!this.statllTimerId) {
63
- this.statllTimerId = setTimeout(() => {
62
+ if (!this.stallTimerId) {
63
+ this.stallTimerId = setTimeout(() => {
64
64
  trace(`${T} _handleBufferingEvents stall timeout`, {
65
65
  buffering: this.buffering,
66
66
  ended: this.ended,
67
- isPlaying: this.isPlaying,
68
67
  })
69
- this.statllTimerId = null
70
- if (!this.isPlaying) {
71
- this.createError({
72
- code: PlaybackErrorCode.MediaSourceUnavailable,
73
- message: 'Stall timeout',
74
- })
75
- }
68
+ this.stallTimerId = null
69
+ this.createError({
70
+ code: PlaybackErrorCode.MediaSourceUnavailable,
71
+ level: PlayerError.Levels.FATAL,
72
+ message: 'Stall timeout',
73
+ description: 'Playback stalled for too long',
74
+ })
76
75
  }, STALL_TIMEOUT)
77
76
  }
78
77
  super._handleBufferingEvents()
@@ -86,4 +85,13 @@ export default class HTML5Video extends BasePlayback {
86
85
  }
87
86
  super._onPlaying()
88
87
  }
88
+
89
+ override _onPause() {
90
+ trace(`${T} _onPause`)
91
+ super._onPause()
92
+ if (this.stallTimerId) {
93
+ clearTimeout(this.stallTimerId)
94
+ this.stallTimerId = null
95
+ }
96
+ }
89
97
  }