@gcorevideo/player 2.22.18 → 2.22.21

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.
Files changed (94) hide show
  1. package/assets/audio-selector/track-selector.ejs +3 -3
  2. package/assets/bottom-gear/bottomgear.ejs +3 -3
  3. package/assets/dvr-controls/dvr_controls.scss +0 -12
  4. package/assets/level-selector/button.ejs +1 -1
  5. package/dist/core.js +1 -1
  6. package/dist/index.css +664 -671
  7. package/dist/index.js +285 -260
  8. package/dist/player.d.ts +144 -123
  9. package/dist/plugins/index.css +758 -765
  10. package/dist/plugins/index.js +194 -172
  11. package/docs/api/player.clapprstats.exportmetrics.md +2 -2
  12. package/docs/api/player.clapprstats.md +0 -4
  13. package/docs/api/player.clapprstatsbitratetrack.md +20 -0
  14. package/docs/api/player.clapprstatschronograph.md +115 -0
  15. package/docs/api/player.clapprstatscounter.md +211 -0
  16. package/docs/api/player.clapprstatsevents.md +51 -0
  17. package/docs/api/player.clapprstatsmetrics.md +52 -0
  18. package/docs/api/player.clipspluginsettings.md +1 -1
  19. package/docs/api/player.gearevents.md +1 -1
  20. package/docs/api/player.md +57 -2
  21. package/docs/api/player.mediacontrol.mount.md +0 -5
  22. package/docs/api/player.mediacontrol.putelement.md +5 -0
  23. package/docs/api/player.mediacontrol.toggleelement.md +1 -1
  24. package/docs/api/player.nerdstats.md +3 -3
  25. package/docs/api/player.playerconfig.md +1 -1
  26. package/docs/api/player.playerconfig.playbacktype.md +6 -1
  27. package/docs/api/player.timeupdate.md +6 -3
  28. package/lib/plugins/audio-selector/AudioSelector.d.ts +1 -1
  29. package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
  30. package/lib/plugins/audio-selector/AudioSelector.js +15 -8
  31. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
  32. package/lib/plugins/bottom-gear/BottomGear.js +2 -2
  33. package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +4 -4
  34. package/lib/plugins/clappr-nerd-stats/NerdStats.js +4 -4
  35. package/lib/plugins/clappr-stats/ClapprStats.d.ts +5 -2
  36. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  37. package/lib/plugins/clappr-stats/ClapprStats.js +31 -33
  38. package/lib/plugins/clappr-stats/types.d.ts +21 -21
  39. package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
  40. package/lib/plugins/clappr-stats/types.js +22 -22
  41. package/lib/plugins/clappr-stats/utils.d.ts +2 -2
  42. package/lib/plugins/clappr-stats/utils.d.ts.map +1 -1
  43. package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
  44. package/lib/plugins/clips/Clips.d.ts +1 -1
  45. package/lib/plugins/dvr-controls/DvrControls.d.ts +6 -2
  46. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  47. package/lib/plugins/dvr-controls/DvrControls.js +39 -27
  48. package/lib/plugins/media-control/MediaControl.d.ts +9 -2
  49. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  50. package/lib/plugins/media-control/MediaControl.js +26 -10
  51. package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
  52. package/lib/plugins/subtitles/ClosedCaptions.js +1 -1
  53. package/lib/plugins/vast-ads/VastAds.js +1 -1
  54. package/lib/plugins/vast-ads/rollmanager.js +1 -1
  55. package/lib/plugins/volume-fade/VolumeFade.d.ts +25 -10
  56. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  57. package/lib/plugins/volume-fade/VolumeFade.js +62 -60
  58. package/lib/testUtils.d.ts.map +1 -1
  59. package/lib/testUtils.js +7 -4
  60. package/lib/types.d.ts +1 -1
  61. package/package.json +3 -3
  62. package/src/playback/__tests__/HTML5Video.test.ts +2 -2
  63. package/src/plugins/audio-selector/AudioSelector.ts +14 -7
  64. package/src/plugins/audio-selector/__tests__/AudioSelector.test.ts +8 -8
  65. package/src/plugins/audio-selector/__tests__/__snapshots__/AudioSelector.test.ts.snap +15 -15
  66. package/src/plugins/bottom-gear/BottomGear.ts +2 -2
  67. package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +8 -5
  68. package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +3 -3
  69. package/src/plugins/clappr-nerd-stats/NerdStats.ts +5 -5
  70. package/src/plugins/clappr-stats/ClapprStats.ts +41 -40
  71. package/src/plugins/clappr-stats/__tests__/ClapprStats.test.ts +12 -12
  72. package/src/plugins/clappr-stats/types.ts +21 -21
  73. package/src/plugins/clappr-stats/utils.ts +2 -2
  74. package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
  75. package/src/plugins/clips/Clips.ts +1 -1
  76. package/src/plugins/clips/__tests__/Clips.test.ts +1 -1
  77. package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +1 -1
  78. package/src/plugins/dvr-controls/DvrControls.ts +51 -37
  79. package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +84 -26
  80. package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +0 -12
  81. package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +1 -1
  82. package/src/plugins/media-control/MediaControl.ts +27 -10
  83. package/src/plugins/media-control/__tests__/MediaControl.test.ts +8 -5
  84. package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +20 -20
  85. package/src/plugins/picture-in-picture/PictureInPicture.ts +1 -1
  86. package/src/plugins/subtitles/ClosedCaptions.ts +1 -1
  87. package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +1 -1
  88. package/src/plugins/vast-ads/VastAds.ts +1 -1
  89. package/src/plugins/vast-ads/rollmanager.ts +1 -1
  90. package/src/plugins/volume-fade/VolumeFade.ts +92 -75
  91. package/src/testUtils.ts +11 -5
  92. package/src/types.ts +1 -1
  93. package/temp/player.api.json +634 -16
  94. package/tsconfig.tsbuildinfo +1 -1
@@ -1,6 +1,6 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`MediaControl > putElement > audiotracks > should put the element in the right panel 1`] = `
3
+ exports[`MediaControl > mount > audiotracks > should put the element in the right panel 1`] = `
4
4
  "<div class="media-control-background" data-background=""></div>
5
5
 
6
6
  <div class="media-control-layer gcore-skin-bg-color" data-controls="">
@@ -26,9 +26,9 @@ exports[`MediaControl > putElement > audiotracks > should put the element in the
26
26
 
27
27
  <div class="bar-container" data-volume="">
28
28
  <div class="bar-background" data-volume="">
29
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
29
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
30
30
  </div>
31
- <div class="bar-scrubber" data-volume="" style="">
31
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
32
32
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
33
33
  </div>
34
34
  </div>
@@ -55,7 +55,7 @@ exports[`MediaControl > putElement > audiotracks > should put the element in the
55
55
  <style>:root {}</style>"
56
56
  `;
57
57
 
58
- exports[`MediaControl > putElement > cc > should put the element in the right panel 1`] = `
58
+ exports[`MediaControl > mount > cc > should put the element in the right panel 1`] = `
59
59
  "<div class="media-control-background" data-background=""></div>
60
60
 
61
61
  <div class="media-control-layer gcore-skin-bg-color" data-controls="">
@@ -81,9 +81,9 @@ exports[`MediaControl > putElement > cc > should put the element in the right pa
81
81
 
82
82
  <div class="bar-container" data-volume="">
83
83
  <div class="bar-background" data-volume="">
84
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
84
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
85
85
  </div>
86
- <div class="bar-scrubber" data-volume="" style="">
86
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
87
87
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
88
88
  </div>
89
89
  </div>
@@ -110,7 +110,7 @@ exports[`MediaControl > putElement > cc > should put the element in the right pa
110
110
  <style>:root {}</style>"
111
111
  `;
112
112
 
113
- exports[`MediaControl > putElement > gear > should put the element in the right panel 1`] = `
113
+ exports[`MediaControl > mount > gear > should put the element in the right panel 1`] = `
114
114
  "<div class="media-control-background" data-background=""></div>
115
115
 
116
116
  <div class="media-control-layer gcore-skin-bg-color" data-controls="">
@@ -136,9 +136,9 @@ exports[`MediaControl > putElement > gear > should put the element in the right
136
136
 
137
137
  <div class="bar-container" data-volume="">
138
138
  <div class="bar-background" data-volume="">
139
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
139
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
140
140
  </div>
141
- <div class="bar-scrubber" data-volume="" style="">
141
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
142
142
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
143
143
  </div>
144
144
  </div>
@@ -165,7 +165,7 @@ exports[`MediaControl > putElement > gear > should put the element in the right
165
165
  <style>:root {}</style>"
166
166
  `;
167
167
 
168
- exports[`MediaControl > putElement > pip > should put the element in the right panel 1`] = `
168
+ exports[`MediaControl > mount > pip > should put the element in the right panel 1`] = `
169
169
  "<div class="media-control-background" data-background=""></div>
170
170
 
171
171
  <div class="media-control-layer gcore-skin-bg-color" data-controls="">
@@ -191,9 +191,9 @@ exports[`MediaControl > putElement > pip > should put the element in the right p
191
191
 
192
192
  <div class="bar-container" data-volume="">
193
193
  <div class="bar-background" data-volume="">
194
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
194
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
195
195
  </div>
196
- <div class="bar-scrubber" data-volume="" style="">
196
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
197
197
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
198
198
  </div>
199
199
  </div>
@@ -248,9 +248,9 @@ exports[`MediaControl > rendering timing > once metadata is loaded > should wait
248
248
 
249
249
  <div class="bar-container" data-volume="">
250
250
  <div class="bar-background" data-volume="">
251
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
251
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
252
252
  </div>
253
- <div class="bar-scrubber" data-volume="" style="">
253
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
254
254
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
255
255
  </div>
256
256
  </div>
@@ -271,11 +271,11 @@ exports[`MediaControl > rendering timing > once metadata is loaded > should wait
271
271
  <div class="bar-container" data-seekbar="">
272
272
  <div class="bar-background" data-seekbar="">
273
273
  <div class="bar-fill-1" data-seekbar=""></div>
274
- <div class="bar-fill-2 gcore-skin-main-color" data-seekbar="" style=""></div>
274
+ <div class="bar-fill-2 gcore-skin-main-color" data-seekbar="" style="width: 0%;"></div>
275
275
  <div class="bar-hover" data-seekbar=""></div>
276
276
  </div>
277
277
  </div>
278
- <div class="bar-scrubber" data-seekbar="" style="">
278
+ <div class="bar-scrubber" data-seekbar="" style="left: 0%;">
279
279
  <div class="bar-scrubber-icon gcore-skin-main-color" data-seekbar=""></div>
280
280
  </div>
281
281
 
@@ -324,9 +324,9 @@ exports[`MediaControl > updateSettings > dvr > when disabled > should disable DV
324
324
 
325
325
  <div class="bar-container" data-volume="">
326
326
  <div class="bar-background" data-volume="">
327
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
327
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
328
328
  </div>
329
- <div class="bar-scrubber" data-volume="" style="">
329
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
330
330
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
331
331
  </div>
332
332
  </div>
@@ -385,9 +385,9 @@ exports[`MediaControl > updateSettings > dvr > when enabled > should enable DVR
385
385
 
386
386
  <div class="bar-container" data-volume="">
387
387
  <div class="bar-background" data-volume="">
388
- <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style=""></div>
388
+ <div class="bar-fill-1 gcore-skin-main-color" data-volume="" style="width: 100%;"></div>
389
389
  </div>
390
- <div class="bar-scrubber" data-volume="" style="">
390
+ <div class="bar-scrubber" data-volume="" style="left: 100%;">
391
391
  <div class="bar-scrubber-icon gcore-skin-main-color" data-volume=""></div>
392
392
  </div>
393
393
  </div>
@@ -97,7 +97,7 @@ export class PictureInPicture extends UICorePlugin {
97
97
 
98
98
  const mediaControl = this.core.getPlugin('media_control');
99
99
  if (mediaControl) {
100
- mediaControl.putElement('pip', this.$el);
100
+ mediaControl.mount('pip', this.$el);
101
101
  }
102
102
 
103
103
  return this;
@@ -337,7 +337,7 @@ export class ClosedCaptions extends UICorePlugin {
337
337
  this.resizeFont()
338
338
 
339
339
  this.core.activeContainer.$el.append(this.$line)
340
- mediaControl.putElement('cc', this.$el)
340
+ mediaControl.mount('cc', this.$el)
341
341
 
342
342
  this.updateSelection()
343
343
 
@@ -53,7 +53,7 @@ describe('ClosedCaptions', () => {
53
53
  it('should render', () => {
54
54
  expect(cc.el.innerHTML).toMatchSnapshot()
55
55
  expect(cc.$el.find('[data-cc-button]').length).toEqual(1)
56
- expect(mediaControl.putElement).toHaveBeenCalledWith('cc', cc.$el)
56
+ expect(mediaControl.mount).toHaveBeenCalledWith('cc', cc.$el)
57
57
  })
58
58
  })
59
59
  })
@@ -627,7 +627,7 @@ export class VastAds extends UICorePlugin {
627
627
 
628
628
  // Attempt to get click-to-pause plugin. (May interfere with advert click handling)
629
629
  this._clickToPausePlugin = this._container?.getPlugin(
630
- 'click_to_pause_custom',
630
+ 'click_to_pause',
631
631
  )
632
632
 
633
633
  assert(this.playback, 'playback is not defined')
@@ -72,7 +72,7 @@ export default class RollManager extends Events {
72
72
  this._playback = this.core.activePlayback;
73
73
  this._contentElement = this._playback.el as HTMLMediaElement;
74
74
  this._posterPlugin = this._container.getPlugin('poster');
75
- this._clickToPausePlugin = this._container.getPlugin('click_to_pause_custom');
75
+ this._clickToPausePlugin = this._container.getPlugin('click_to_pause');
76
76
  this._adContainer = _adContainer;
77
77
  this._events = {};
78
78
  this._pr = Math.floor(Math.random() * 1000000);
@@ -1,7 +1,8 @@
1
- import { UICorePlugin, Events, Browser, $, Container } from '@clappr/core';
2
- import { reportError } from '@gcorevideo/utils';
1
+ import { UICorePlugin, Events, Browser, $, Core } from '@clappr/core'
2
+ import { reportError, trace } from '@gcorevideo/utils'
3
3
 
4
- import { TimerId } from '../../utils/types.js';
4
+ import { TimerId } from '../../utils/types.js'
5
+ import { ExtendedEvents } from '../media-control/MediaControl.js'
5
6
 
6
7
  /**
7
8
  * Events emitted by the VolumeFade plugin.
@@ -11,114 +12,130 @@ export enum VolumeFadeEvents {
11
12
  FADE = 'core:volume:fade',
12
13
  }
13
14
 
15
+ const T = 'plugins.volume_fade'
16
+
17
+ const DEFAULT_DURATION = 600
18
+
19
+ /**
20
+ * @beta
21
+ */
22
+ export type VolumeFadeSettings = {
23
+ /**
24
+ * Initial active volume level, effective until volume is changed via media control
25
+ */
26
+ level?: number
27
+ /**
28
+ * Fade duration, ms
29
+ */
30
+ duration?: number
31
+ }
32
+
14
33
  /**
15
34
  * `PLUGIN` that applies fade effect to the player's volume change.
16
35
  * @beta
36
+ *
37
+ * @remarks
38
+ * Depends on {@link MediaControl} plugin.
39
+ * Configuration options - {@link VolumeFadeSettings}
17
40
  */
18
41
  export class VolumeFade extends UICorePlugin {
19
- private _aboveBorderVolume = 0;
42
+ private activeVolume = 0
20
43
 
21
- private container: Container | null = null;
44
+ private duration = 0
22
45
 
23
- private delay = 0;
24
-
25
- private interval: TimerId | null = null;
46
+ private timerId: TimerId | null = null
26
47
 
27
48
  /**
28
49
  * @internal
29
50
  */
30
51
  get name() {
31
- return 'volume_fade';
52
+ return 'volume_fade'
53
+ }
54
+
55
+ constructor(core: Core) {
56
+ super(core)
57
+ if (typeof this.options.volumeFade?.level === 'number') {
58
+ this.activeVolume = this.options.volumeFade.level
59
+ }
32
60
  }
33
61
 
34
62
  /**
35
63
  * @internal
36
64
  */
37
65
  override bindEvents() {
38
- // TODO on container changed
39
- this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
40
- if (this.core.mediaControl) {
41
- this.listenTo(this.core.mediaControl, 'mediacontrol:volume:user', this._onUserChangeVolume);
42
- }
43
- // this.listenTo(this.core, 'core:volume:config', this._onVolumeConfig);
44
- }
45
-
46
- private unBindEvents() {
47
- this.core.$el.off('mouseleave.volume');
48
- this.core.$el.off('mouseenter.volume');
49
- }
50
-
51
- private _onUserChangeVolume(volume: number) {
52
- this._aboveBorderVolume = volume;
53
- }
54
-
55
- private _onVolumeConfig(value: number) {
56
- this._aboveBorderVolume = value;
57
- this.container?.setVolume(0);
66
+ this.listenTo(this.core, Events.CORE_READY, this.onCoreReady)
58
67
  }
59
68
 
60
69
  private onCoreReady() {
61
- this.unBindEvents();
62
- this.container = this.core.activeContainer;
63
- if (this.core && this.core.$el) {
64
- // TODO find out why options.playerElement instead of this.core.$el or this.container.$el
65
- $(this.options.playerElement).on('mouseenter.volume', () => {
66
- this.onEnter();
67
- });
68
- $(this.options.playerElement).on('mouseleave.volume', () => {
69
- this.onLeave();
70
- });
70
+ const mediaControl = this.core.getPlugin('media_control')
71
+ if (Browser.isMobile) {
72
+ this.destroy()
73
+ return
71
74
  }
72
- if (!this._aboveBorderVolume) {
73
- this._aboveBorderVolume = this.container?.volume && !isNaN(this.container.volume) ? this.container.volume : 80;
75
+ if (mediaControl) {
76
+ this.listenTo(
77
+ mediaControl,
78
+ ExtendedEvents.MEDIACONTROL_VOLUME,
79
+ this.onVolumeChange,
80
+ )
74
81
  }
75
- if (this.options.mute || Browser.isMobile) {
76
- this.destroy();
77
-
78
- return;
82
+ $(this.core.$el).on('mouseenter', () => this.onEnter())
83
+ $(this.core.$el).on('mouseleave', () => this.onLeave())
84
+ if (!this.activeVolume) {
85
+ this.activeVolume =
86
+ this.core.activeContainer?.volume &&
87
+ !isNaN(this.core.activeContainer.volume)
88
+ ? this.core.activeContainer.volume
89
+ : 80
79
90
  }
80
- this.delay = this.options.volumeFade && this.options.volumeFade.delay || 600;
81
- this.container?.setVolume(0);
82
- }
83
91
 
84
- private onEnter() {
85
- this.numberTo(this.delay);
92
+ this.duration = this.options.volumeFade?.duration || DEFAULT_DURATION
93
+ // TODO check if mute must be respected
94
+ this.core.activeContainer?.setVolume(this.activeVolume)
95
+ this.core.activePlayback.volume(0)
86
96
  }
87
97
 
88
- private numberTo(duration: number, contra = 0) {
89
- this.clearCurrentInterval();
90
- const start = new Date().getTime();
98
+ private onVolumeChange(volume: number) {
99
+ trace(`${T} onVolumeChange`, { volume })
100
+ this.activeVolume = volume
101
+ }
91
102
 
92
- this.interval = setInterval(() => {
93
- let now = (new Date().getTime()) - start;
103
+ private onEnter() {
104
+ trace(`${T} onEnter`)
105
+ this.fade(this.duration, 1)
106
+ }
94
107
 
95
- if (now > duration) {
96
- now = duration;
97
- }
98
- const progress = Math.abs(contra - now / duration);
108
+ private onLeave() {
109
+ trace(`${T} onLeave`)
110
+ this.fade(this.duration, 0)
111
+ }
99
112
 
113
+ private fade(duration: number, to: 0 | 1) {
114
+ this.stopFade()
115
+ const start = new Date().getTime()
116
+ const from = 1 - to
117
+ this.timerId = setInterval(() => {
118
+ const delta = new Date().getTime() - start
119
+ const progress = Math.min(1, delta / duration)
120
+ const normVol = progress * to + (1 - progress) * from
121
+ const volume = normVol * this.activeVolume
122
+ this.core.activePlayback.volume(volume)
100
123
  try {
101
- this.container?.setVolume(progress * this._aboveBorderVolume);
102
- this.core.trigger(VolumeFadeEvents.FADE, progress * this._aboveBorderVolume);
124
+ this.core.trigger(VolumeFadeEvents.FADE, volume)
103
125
  } catch (error) {
104
- // LogManager.exception(error);
105
- reportError(error);
106
- this.clearCurrentInterval();
126
+ reportError(error)
107
127
  }
108
- if (progress >= 1 || progress <= 0) {
109
- this.clearCurrentInterval();
128
+ if (progress >= 1) {
129
+ this.stopFade()
110
130
  }
111
- }, 10);
131
+ }, 10)
112
132
  }
113
133
 
114
- private clearCurrentInterval() {
115
- if (this.interval !== null) {
116
- clearInterval(this.interval);
117
- this.interval = null;
134
+ private stopFade() {
135
+ trace(`${T} stopFade`)
136
+ if (this.timerId !== null) {
137
+ clearInterval(this.timerId)
138
+ this.timerId = null
118
139
  }
119
140
  }
120
-
121
- private onLeave() {
122
- this.numberTo(this.delay, 1);
123
- }
124
141
  }
package/src/testUtils.ts CHANGED
@@ -100,7 +100,7 @@ export function createMockCore(
100
100
  ...options,
101
101
  },
102
102
  configure: vi.fn(),
103
- getPlaybackType: vi.fn().mockReturnValue(Playback.LIVE),
103
+ getPlaybackType: vi.fn(),
104
104
  getPlugin: vi.fn(),
105
105
  load: vi.fn(),
106
106
  trigger: emitter.emit,
@@ -140,7 +140,7 @@ export function createMockPlayback(name = 'mock') {
140
140
  getDuration: vi.fn().mockImplementation(() => 100),
141
141
  enterPiP: vi.fn(),
142
142
  exitPiP: vi.fn(),
143
- getPlaybackType: vi.fn().mockImplementation(() => Playback.LIVE),
143
+ getPlaybackType: vi.fn(),
144
144
  getStartTimeOffset: vi.fn().mockImplementation(() => 0),
145
145
  getCurrentTime: vi.fn().mockImplementation(() => 0),
146
146
  isHighDefinitionInUse: vi.fn().mockImplementation(() => false),
@@ -157,7 +157,10 @@ export function createMockPlayback(name = 'mock') {
157
157
  })
158
158
  }
159
159
 
160
- export function createMockContainer(options: Record<string, unknown> = {}, playback: any = createMockPlayback()) {
160
+ export function createMockContainer(
161
+ options: Record<string, unknown> = {},
162
+ playback: any = createMockPlayback(),
163
+ ) {
161
164
  const el = playback.el
162
165
  const emitter = new Events()
163
166
  return Object.assign(emitter, {
@@ -167,7 +170,7 @@ export function createMockContainer(options: Record<string, unknown> = {}, playb
167
170
  $el: $(el),
168
171
  getDuration: vi.fn().mockReturnValue(0),
169
172
  getPlugin: vi.fn(),
170
- getPlaybackType: vi.fn().mockReturnValue(Playback.LIVE),
173
+ getPlaybackType: vi.fn(),
171
174
  isDvrInUse: vi.fn().mockReturnValue(false),
172
175
  isDvrEnabled: vi.fn().mockReturnValue(false),
173
176
  isPlaying: vi.fn().mockReturnValue(false),
@@ -202,7 +205,10 @@ export function createMockBottomGear(core: any) {
202
205
  if (existing.length) {
203
206
  return existing
204
207
  }
205
- return $('<li></li>').attr(`data-${name}`, '').append($el).appendTo(plugin.$el)
208
+ return $('<li></li>')
209
+ .attr(`data-${name}`, '')
210
+ .append($el)
211
+ .appendTo(plugin.$el)
206
212
  })
207
213
  plugin.refresh = vi.fn()
208
214
  return plugin
package/src/types.ts CHANGED
@@ -163,7 +163,7 @@ export interface PlayerConfig extends Record<string, unknown> {
163
163
 
164
164
  /**
165
165
  * Stream type.
166
- * @remark
166
+ * @remarks
167
167
  * Should only be set if known in advance, as it should not change once determined.
168
168
  * Otherwise it might cause inconsistencies in the UI plugins behavior, for instance, glitches with rendering of the DVR controls or seek bar.
169
169
  */