@gcorevideo/player 2.20.8 → 2.20.9

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 (195) hide show
  1. package/dist/core.js +18 -13
  2. package/dist/index.css +1541 -1541
  3. package/dist/index.js +59 -52
  4. package/dist/player.d.ts +178 -126
  5. package/dist/plugins/index.css +665 -665
  6. package/dist/plugins/index.js +42 -40
  7. package/docs/api/player.bottomgear.md +14 -0
  8. package/docs/api/player.bottomgear.refresh.md +20 -0
  9. package/docs/api/player.clapprnerdstats.md +1 -1
  10. package/docs/api/player.clapprstats.exportmetrics.md +1 -1
  11. package/docs/api/player.clapprstats.md +1 -15
  12. package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
  13. package/docs/api/player.clipsplugin.md +1 -1
  14. package/docs/api/player.clipspluginsettings.md +5 -2
  15. package/docs/api/player.clipspluginsettings.text.md +3 -0
  16. package/docs/api/player.containerpluginconstructor.md +19 -0
  17. package/docs/api/{player.errorscreen.render.md → player.corepluginconstructor.md} +7 -6
  18. package/docs/api/player.errordesc.md +28 -0
  19. package/docs/api/player.errorscreen.md +1 -220
  20. package/docs/api/{player.errorscreen.bindevents.md → player.errorscreenpluginsettings.md} +7 -7
  21. package/docs/api/player.levelselector.md +3 -9
  22. package/docs/api/player.levelselectorpluginsettings.labels.md +24 -0
  23. package/docs/api/player.levelselectorpluginsettings.md +79 -0
  24. package/docs/api/player.levelselectorpluginsettings.restrictresolution.md +16 -0
  25. package/docs/api/player.md +93 -16
  26. package/docs/api/{player.errorscreen.hide.md → player.mediacontrol.currentseekpos.md} +3 -7
  27. package/docs/api/player.mediacontrol.disable.md +1 -1
  28. package/docs/api/player.mediacontrol.md +23 -2
  29. package/docs/api/{player.gearevents.md → player.mediacontrolevents.md} +4 -4
  30. package/docs/api/player.multicamera.md +1 -29
  31. package/docs/api/player.playbackerror.md +19 -0
  32. package/docs/api/{player.errorscreen.supportedversion.md → player.playbackerror.ui.md} +7 -4
  33. package/docs/api/player.playbackerrorcode.md +3 -3
  34. package/docs/api/{player.errorscreen.show.md → player.playbackrate._constructor_.md} +7 -11
  35. package/docs/api/player.playbackrate.md +35 -2
  36. package/docs/api/player.player.registerplugin.md +2 -2
  37. package/docs/api/player.player.unregisterplugin.md +2 -2
  38. package/docs/api/player.playerpluginconstructor.md +17 -0
  39. package/docs/api/player.share.attributes.md +3 -0
  40. package/docs/api/player.share.bindevents.md +3 -0
  41. package/docs/api/player.share.canshowshare.md +3 -0
  42. package/docs/api/player.share.events.md +3 -0
  43. package/docs/api/player.share.hideshare.md +3 -0
  44. package/docs/api/player.share.initializeicons.md +3 -0
  45. package/docs/api/player.share.md +40 -1
  46. package/docs/api/player.share.name.md +3 -0
  47. package/docs/api/player.share.onshareembedclick.md +3 -0
  48. package/docs/api/player.share.onsharefb.md +3 -0
  49. package/docs/api/player.share.onsharehide.md +3 -0
  50. package/docs/api/player.share.onsharelinkclick.md +3 -0
  51. package/docs/api/player.share.onshareshow.md +3 -0
  52. package/docs/api/player.share.onsharetw.md +3 -0
  53. package/docs/api/player.share.render.md +3 -0
  54. package/docs/api/player.share.showshare.md +3 -0
  55. package/docs/api/player.share.supportedversion.md +3 -0
  56. package/docs/api/player.share.template.md +3 -0
  57. package/docs/api/player.share.unbindevents.md +3 -0
  58. package/docs/api/player.skiptime.attributes.md +3 -0
  59. package/docs/api/player.skiptime.bindevents.md +3 -0
  60. package/docs/api/player.skiptime.container.md +3 -0
  61. package/docs/api/player.skiptime.events.md +3 -0
  62. package/docs/api/player.skiptime.handlerewindclicks.md +3 -0
  63. package/docs/api/player.skiptime.md +30 -1
  64. package/docs/api/player.skiptime.name.md +3 -0
  65. package/docs/api/player.skiptime.render.md +3 -0
  66. package/docs/api/player.skiptime.setback.md +3 -0
  67. package/docs/api/player.skiptime.setforward.md +3 -0
  68. package/docs/api/player.skiptime.setmidclick.md +3 -0
  69. package/docs/api/player.skiptime.supportedversion.md +3 -0
  70. package/docs/api/player.skiptime.template.md +3 -0
  71. package/docs/api/player.skiptime.togglefullscreen.md +3 -0
  72. package/docs/api/player.spinnerevents.md +4 -1
  73. package/docs/api/player.spinnerthreebounce.hide.md +1 -1
  74. package/docs/api/player.spinnerthreebounce.md +7 -5
  75. package/docs/api/player.spinnerthreebounce.show.md +40 -2
  76. package/docs/api/player.telemetry.md +1 -1
  77. package/docs/api/player.telemetrypluginsettings.md +1 -1
  78. package/docs/api/{player.errorscreen.unbindevents.md → player.telemetrysendfn.md} +6 -6
  79. package/lib/Player.d.ts +13 -4
  80. package/lib/Player.d.ts.map +1 -1
  81. package/lib/Player.js +17 -12
  82. package/lib/index.core.d.ts +0 -1
  83. package/lib/index.core.d.ts.map +1 -1
  84. package/lib/index.core.js +0 -1
  85. package/lib/index.plugins.d.ts +0 -1
  86. package/lib/index.plugins.d.ts.map +1 -1
  87. package/lib/index.plugins.js +0 -1
  88. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  89. package/lib/playback/hls-playback/HlsPlayback.js +1 -1
  90. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
  91. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  92. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +1 -1
  93. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +1 -1
  94. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -1
  95. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +8 -8
  96. package/lib/plugins/clappr-stats/ClapprStats.d.ts +4 -5
  97. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  98. package/lib/plugins/clappr-stats/ClapprStats.js +4 -3
  99. package/lib/plugins/clips/Clips.d.ts +3 -2
  100. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  101. package/lib/plugins/clips/Clips.js +1 -1
  102. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  103. package/lib/plugins/dvr-controls/DvrControls.d.ts +3 -2
  104. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  105. package/lib/plugins/dvr-controls/DvrControls.js +3 -2
  106. package/lib/plugins/error-screen/ErrorScreen.d.ts +12 -1
  107. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  108. package/lib/plugins/error-screen/ErrorScreen.js +1 -1
  109. package/lib/plugins/index.d.ts +0 -1
  110. package/lib/plugins/index.d.ts.map +1 -1
  111. package/lib/plugins/index.js +0 -1
  112. package/lib/plugins/kibo/index.d.ts +0 -3
  113. package/lib/plugins/kibo/index.d.ts.map +1 -1
  114. package/lib/plugins/kibo/index.js +0 -3
  115. package/lib/plugins/level-selector/LevelSelector.d.ts +6 -4
  116. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  117. package/lib/plugins/level-selector/LevelSelector.js +2 -4
  118. package/lib/plugins/media-control/MediaControl.d.ts +4 -4
  119. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  120. package/lib/plugins/media-control/MediaControl.js +3 -3
  121. package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -11
  122. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  123. package/lib/plugins/multi-camera/MultiCamera.js +1 -1
  124. package/lib/plugins/poster/Poster.js +2 -2
  125. package/lib/plugins/share/Share.d.ts +2 -1
  126. package/lib/plugins/share/Share.d.ts.map +1 -1
  127. package/lib/plugins/share/Share.js +2 -1
  128. package/lib/plugins/skip-time/SkipTime.d.ts +2 -1
  129. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
  130. package/lib/plugins/skip-time/SkipTime.js +2 -1
  131. package/lib/plugins/source-controller/SourceController.js +3 -3
  132. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +6 -3
  133. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  134. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +6 -3
  135. package/lib/plugins/telemetry/Telemetry.d.ts +2 -3
  136. package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
  137. package/lib/plugins/telemetry/Telemetry.js +1 -1
  138. package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
  139. package/lib/plugins/vast-ads/VastAds.js +3 -3
  140. package/lib/plugins/vast-ads/roll.d.ts +1 -1
  141. package/lib/plugins/vast-ads/roll.d.ts.map +1 -1
  142. package/lib/plugins/vast-ads/rollmanager.d.ts +1 -1
  143. package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -1
  144. package/lib/plugins/vast-ads/rollmanager.js +2 -2
  145. package/lib/types.d.ts +21 -5
  146. package/lib/types.d.ts.map +1 -1
  147. package/lib/utils/types.d.ts +0 -6
  148. package/lib/utils/types.d.ts.map +1 -1
  149. package/package.json +1 -1
  150. package/src/Player.ts +18 -16
  151. package/src/index.core.ts +0 -1
  152. package/src/index.plugins.ts +0 -1
  153. package/src/playback/hls-playback/HlsPlayback.ts +7 -11
  154. package/src/plugins/audio-selector/AudioSelector.ts +1 -1
  155. package/src/plugins/big-mute-button/BigMuteButton.ts +1 -1
  156. package/src/plugins/bottom-gear/BottomGear.ts +1 -1
  157. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +2 -2
  158. package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +184 -187
  159. package/src/plugins/clappr-stats/ClapprStats.ts +5 -4
  160. package/src/plugins/clips/Clips.ts +4 -3
  161. package/src/plugins/context-menu/ContextMenu.ts +0 -2
  162. package/src/plugins/dvr-controls/DvrControls.ts +3 -2
  163. package/src/plugins/error-screen/ErrorScreen.ts +12 -1
  164. package/src/plugins/favicon/Favicon.ts +1 -1
  165. package/src/plugins/index.ts +0 -1
  166. package/src/plugins/kibo/index.ts +0 -3
  167. package/src/plugins/level-selector/LevelSelector.ts +7 -5
  168. package/src/plugins/logo/Logo.ts +1 -1
  169. package/src/plugins/media-control/MediaControl.ts +4 -4
  170. package/src/plugins/multi-camera/MultiCamera.ts +4 -4
  171. package/src/plugins/playback-rate/PlaybackRate.ts +1 -1
  172. package/src/plugins/poster/Poster.ts +3 -3
  173. package/src/plugins/seek-time/SeekTime.ts +1 -1
  174. package/src/plugins/share/Share.ts +2 -1
  175. package/src/plugins/skip-time/SkipTime.ts +2 -1
  176. package/src/plugins/source-controller/SourceController.ts +3 -3
  177. package/src/plugins/source-controller/__tests__/SourceController.test.ts +2 -2
  178. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +6 -3
  179. package/src/plugins/subtitles/Subtitles.ts +1 -1
  180. package/src/plugins/telemetry/Telemetry.ts +2 -2
  181. package/src/plugins/thumbnails/Thumbnails.ts +1 -1
  182. package/src/plugins/vast-ads/VastAds.ts +5 -4
  183. package/src/plugins/vast-ads/roll.ts +2 -1
  184. package/src/plugins/vast-ads/rollmanager.ts +3 -3
  185. package/src/types.ts +24 -5
  186. package/src/utils/types.ts +0 -8
  187. package/temp/player.api.json +540 -576
  188. package/tsconfig.tsbuildinfo +1 -1
  189. package/docs/api/player.clapprstats.onbitrate.md +0 -52
  190. package/docs/api/player.errorscreen.attributes.md +0 -17
  191. package/docs/api/player.errorscreen.container.md +0 -14
  192. package/docs/api/player.errorscreen.name.md +0 -14
  193. package/docs/api/player.errorscreen.template.md +0 -14
  194. package/docs/api/player.multicamera.getcameraslist.md +0 -18
  195. package/docs/api/player.multicamera.getcurrentcamera.md +0 -18
@@ -10,7 +10,8 @@ import { trace } from '@gcorevideo/utils'
10
10
  const T = 'plugins.dvr_controls'
11
11
 
12
12
  /**
13
- * Adds the DVR controls to the media control UI
13
+ * PLUGIN that adds the DVR controls to the media control UI
14
+ *
14
15
  * @beta
15
16
  *
16
17
  * @remarks
@@ -18,7 +19,7 @@ const T = 'plugins.dvr_controls'
18
19
  *
19
20
  * - {@link MediaControl}
20
21
  *
21
- * The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
22
+ * The plugin renders live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
22
23
  */
23
24
  export class DvrControls extends UICorePlugin {
24
25
  private static readonly template = template(dvrHTML)
@@ -8,6 +8,10 @@ import templateHtml from '../../../assets/error-screen/error_screen.ejs'
8
8
  import '../../../assets/error-screen/error_screen.scss'
9
9
  import { PlaybackErrorCode } from '../../playback.types.js'
10
10
 
11
+ /**
12
+ * An error fired in the player and plugins code to be handled in the UI
13
+ * @beta
14
+ */
11
15
  export type ErrorDesc = {
12
16
  description: string
13
17
  level: string
@@ -29,14 +33,21 @@ type ErrorScreenDesc = {
29
33
  icon?: string
30
34
  }
31
35
 
36
+ /**
37
+ * Configuration options for the {@link ErrorScreen | error screen} plugin.
38
+ * @beta
39
+ */
32
40
  export type ErrorScreenPluginSettings = {
41
+ /**
42
+ * Whether to hide the reload button.
43
+ */
33
44
  noReload?: boolean
34
45
  }
35
46
 
36
47
  const T = 'plugins.error_screen'
37
48
 
38
49
  /**
39
- * Displays an error nicely in the overlay on top of the player.
50
+ * PLUGIN that displays errors nicely in the overlay on top of the player.
40
51
  * @beta
41
52
  */
42
53
  export class ErrorScreen extends UICorePlugin {
@@ -1,7 +1,7 @@
1
1
  import { CorePlugin, Events, $, Core, Container } from '@clappr/core';
2
2
 
3
3
  import { CLAPPR_VERSION } from '../../build.js';
4
- import { ZeptoResult } from '../../utils/types.js';
4
+ import { ZeptoResult } from '../../types.js';
5
5
 
6
6
  import playIcon from '../../../assets/icons/new/play.svg';
7
7
  import pauseIcon from '../../../assets/icons/new/pause.svg';
@@ -19,7 +19,6 @@ export * from "./error-screen/ErrorScreen.js";
19
19
  export * from "./favicon/Favicon.js";
20
20
  // _ ga-events
21
21
  export * from "./google-analytics/GoogleAnalytics.js";
22
- export * from "./kibo/index.js";
23
22
  export * from "./level-selector/LevelSelector.js";
24
23
  export * from "./logo/Logo.js";
25
24
  export * from "./media-control/MediaControl.js";
@@ -11,9 +11,6 @@ type KeyboardEventBindings = {
11
11
 
12
12
  type UpDown = 'up' | 'down';
13
13
 
14
- /**
15
- * @internal
16
- */
17
14
  export class Kibo {
18
15
  private lastKeyCode = -1;
19
16
 
@@ -4,7 +4,7 @@ import assert from 'assert'
4
4
 
5
5
  import { type QualityLevel } from '../../playback.types.js'
6
6
  import { CLAPPR_VERSION } from '../../build.js'
7
- import { ZeptoResult } from '../../utils/types.js'
7
+ import { ZeptoResult } from '../../types.js'
8
8
  import { TemplateFunction } from '../types.js'
9
9
  import { BottomGear } from '../bottom-gear/BottomGear.js'
10
10
 
@@ -20,6 +20,10 @@ import { MediaControl, MediaControlEvents } from '../media-control/MediaControl.
20
20
  const T = 'plugins.level_selector'
21
21
  const VERSION = '2.19.4'
22
22
 
23
+ /**
24
+ * Configuration options for the {@link LevelSelector | level selector} plugin.
25
+ * @beta
26
+ */
23
27
  export interface LevelSelectorPluginSettings {
24
28
  /**
25
29
  * The maximum resolution to allow in the level selector.
@@ -36,7 +40,7 @@ export interface LevelSelectorPluginSettings {
36
40
  }
37
41
 
38
42
  /**
39
- * A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
43
+ * PLUGIN that provides a UI to select the desired quality level of the playback.
40
44
  * @beta
41
45
  *
42
46
  * @remarks
@@ -46,9 +50,7 @@ export interface LevelSelectorPluginSettings {
46
50
  *
47
51
  * - {@link BottomGear}
48
52
  *
49
- * The plugin is rendered as an item in the gear menu.
50
- *
51
- * When clicked, it shows a list of quality levels to choose from.
53
+ * The plugin is rendered as an item in the gear menu, which, when clicked, shows a list of quality levels to choose from.
52
54
  *
53
55
  * Configuration options - {@link LevelSelectorPluginSettings}
54
56
  *
@@ -2,7 +2,7 @@ import { UIContainerPlugin, Events, template as t, Container } from '@clappr/cor
2
2
 
3
3
  import { CLAPPR_VERSION } from '../../build.js';
4
4
  import { calculateSize } from './utils/index.js';
5
- import { ZeptoResult } from '../../utils/types.js';
5
+ import { ZeptoResult } from '../../types.js';
6
6
 
7
7
  import logoHTML from '../../../assets/logo/templates/logo.ejs';
8
8
  import '../../../assets/logo/styles/logo.scss';
@@ -20,7 +20,7 @@ import { type TimeProgress } from '../../playback.types.js'
20
20
  import { Kibo } from '../kibo/index.js'
21
21
 
22
22
  import { CLAPPR_VERSION } from '../../build.js'
23
- import { ZeptoResult } from '../../utils/types.js'
23
+ import { ZeptoResult } from '../../types.js'
24
24
  import { getPageX, isFullscreen } from '../utils.js'
25
25
 
26
26
  import '../../../assets/media-control/media-control.scss'
@@ -88,7 +88,7 @@ type DisabledClickable = {
88
88
  }
89
89
 
90
90
  /**
91
- * The MediaControl provides a foundation for developing custom media controls UI.
91
+ * PLUGIN that provides a foundation for developing custom media controls UI.
92
92
  * @beta
93
93
  * @remarks
94
94
  * The methods exposed are to be used by the other plugins that extend the media control UI.
@@ -218,7 +218,7 @@ export class MediaControl extends UICorePlugin {
218
218
 
219
219
  /**
220
220
  * @internal
221
- * @deprecated
221
+ * @deprecated Use core.activeContainer directly
222
222
  */
223
223
  get container() {
224
224
  return this.core.activeContainer
@@ -226,7 +226,7 @@ export class MediaControl extends UICorePlugin {
226
226
 
227
227
  /**
228
228
  * @internal
229
- * @deprecated
229
+ * @deprecated Use core.activePlayback directly
230
230
  */
231
231
  get playback() {
232
232
  return this.core.activePlayback
@@ -9,7 +9,7 @@ import '../../../assets/multi-camera/style.scss';
9
9
  import streamsIcon from '../../../assets/icons/old/streams.svg';
10
10
  import streamsMomentoIcon from '../../../assets/icons/old/language.svg';
11
11
  import streamsWhiteNightsIcon from '../../../assets/icons/old/wn.svg';
12
- import { ZeptoResult } from '../../utils/types.js';
12
+ import { ZeptoResult } from '../../types.js';
13
13
 
14
14
  type MultisourcesMode = 'one_first' | 'only_live' | 'show_all';
15
15
 
@@ -26,7 +26,7 @@ const VERSION = '0.0.1';
26
26
  const T = 'plugins.multicamera';
27
27
 
28
28
  /**
29
- * The plugin adds support for loading multiple streams and switching between them using the media control UI.
29
+ * PLUGIN that adds support for loading multiple streams and switching between them using the media control UI.
30
30
  * @beta
31
31
  */
32
32
  export class MultiCamera extends UICorePlugin {
@@ -381,11 +381,11 @@ export class MultiCamera extends UICorePlugin {
381
381
  this.toggleContextMenu();
382
382
  }
383
383
 
384
- getCamerasList() {
384
+ private getCamerasList() {
385
385
  return this.multicamera;
386
386
  }
387
387
 
388
- getCurrentCamera() {
388
+ private getCurrentCamera() {
389
389
  return this.currentCamera;
390
390
  }
391
391
 
@@ -3,7 +3,7 @@ import { trace } from '@gcorevideo/utils';
3
3
  import assert from 'assert';
4
4
 
5
5
  import { CLAPPR_VERSION } from '../../build.js';
6
- import type { ZeptoResult } from '../../utils/types.js';
6
+ import type { ZeptoResult } from '../../types.js';
7
7
 
8
8
  import buttonHtml from '../../../assets/playback-rate/button.ejs';
9
9
  import listHtml from '../../../assets/playback-rate/list.ejs';
@@ -14,14 +14,14 @@ import {
14
14
  import { trace } from '@gcorevideo/utils'
15
15
 
16
16
  import { CLAPPR_VERSION } from '../../build.js'
17
- import type { ZeptoResult } from '../../utils/types.js'
17
+ import type { ZeptoResult } from '../../types.js'
18
18
 
19
19
  import '../../../assets/poster/poster.scss'
20
20
  import posterHTML from '../../../assets/poster/poster.ejs'
21
21
  import playIcon from '../../../assets/icons/new/play.svg'
22
22
  import { PlaybackError } from '../../playback.types.js'
23
23
 
24
- const T = 'plugins.poster_custom'
24
+ const T = 'plugins.poster'
25
25
 
26
26
  /**
27
27
  * Displays a poster image in the background and a big play button on top when playback is stopped
@@ -65,7 +65,7 @@ export class Poster extends UIContainerPlugin {
65
65
  * @internal
66
66
  */
67
67
  get name() {
68
- return 'poster_custom'
68
+ return 'poster'
69
69
  }
70
70
 
71
71
  /**
@@ -9,7 +9,7 @@ import { CLAPPR_VERSION } from '../../build.js';
9
9
 
10
10
  import seekTimeHTML from '../../../assets/seek-time/seek-time.html';
11
11
  import '../../../assets/seek-time/seek-time.scss';
12
- import { ZeptoResult } from '../../utils/types.js';
12
+ import { ZeptoResult } from '../../types.js';
13
13
 
14
14
  const { formatTime } = Utils;
15
15
 
@@ -10,7 +10,8 @@ import fbIcon from '../../../assets/icons/old/fb.svg';
10
10
  import twIcon from '../../../assets/icons/old/twitter.svg';
11
11
 
12
12
  /**
13
- * The plugin adds a share button to the media control UI.
13
+ * PLUGIN that adds a share button to the media control UI.
14
+ * @beta
14
15
  */
15
16
  export class Share extends UICorePlugin {
16
17
  private hide = false;
@@ -8,7 +8,8 @@ import '../../../assets/skip-time/style.scss';
8
8
  type Position = 'mid' | 'left' | 'right';
9
9
 
10
10
  /**
11
- * The plugin adds skip controls to the media control UI.
11
+ * PLUGIN that adds skip controls to the media control UI.
12
+ * @beta
12
13
  */
13
14
  export class SkipTime extends UICorePluginOriginal {
14
15
  get name() {
@@ -153,7 +153,7 @@ export class SourceController extends CorePlugin {
153
153
  }
154
154
  this.bindContainerEventListeners()
155
155
  if (this.active) {
156
- this.core.activeContainer?.getPlugin('poster_custom')?.disable()
156
+ this.core.activeContainer?.getPlugin('poster')?.disable()
157
157
  spinner?.show(0)
158
158
  }
159
159
  }
@@ -177,7 +177,7 @@ export class SourceController extends CorePlugin {
177
177
  }
178
178
  switch (error.code) {
179
179
  case PlaybackErrorCode.MediaSourceUnavailable:
180
- this.core.activeContainer?.getPlugin('poster_custom')?.disable()
180
+ this.core.activeContainer?.getPlugin('poster')?.disable()
181
181
  this.retryPlayback()
182
182
  break
183
183
  default:
@@ -192,7 +192,7 @@ export class SourceController extends CorePlugin {
192
192
  })
193
193
  if (this.active) {
194
194
  this.reset()
195
- this.core.activeContainer?.getPlugin('poster_custom')?.enable()
195
+ this.core.activeContainer?.getPlugin('poster')?.enable()
196
196
  this.core.activeContainer?.getPlugin('spinner')?.hide()
197
197
  }
198
198
  })
@@ -116,7 +116,7 @@ describe('SourceController', () => {
116
116
  poster = createMockPlugin()
117
117
  spinner = createSpinnerPlugin()
118
118
  core.activeContainer.getPlugin.mockImplementation((name: string) => {
119
- if (name === 'poster_custom') {
119
+ if (name === 'poster') {
120
120
  return poster
121
121
  }
122
122
  if (name === 'spinner') {
@@ -183,7 +183,7 @@ describe('SourceController', () => {
183
183
  poster = createMockPlugin()
184
184
  spinner = createSpinnerPlugin()
185
185
  core.activeContainer.getPlugin.mockImplementation((name: string) => {
186
- if (name === 'poster_custom') {
186
+ if (name === 'poster') {
187
187
  return poster
188
188
  }
189
189
  if (name === 'spinner') {
@@ -20,6 +20,7 @@ const T = 'plugins.spinner'
20
20
 
21
21
  /**
22
22
  * Custom events emitted by the plugin
23
+ * @beta
23
24
  */
24
25
  export enum SpinnerEvents {
25
26
  /**
@@ -30,10 +31,12 @@ export enum SpinnerEvents {
30
31
  }
31
32
 
32
33
  /**
33
- * Shows a pending operation indicator when playback is buffering or in other appropriate cases
34
+ * PLUGIN that shows a pending operation indicator when playback is buffering or in a similar state
34
35
  * @beta
35
36
  * @remarks
36
- * The plugin emits
37
+ * Events emitted- {@link SpinnerEvents}
38
+ * Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
39
+ * implement custom pending/progress indication scenarios.
37
40
  */
38
41
  export class SpinnerThreeBounce extends UIContainerPlugin {
39
42
  private userShown = false
@@ -134,7 +137,7 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
134
137
  /**
135
138
  * Shows the spinner.
136
139
  *
137
- * When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce#hide} is called
140
+ * When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce.hide} is called
138
141
  */
139
142
  show(delay = 300) {
140
143
  trace(`${T} show`)
@@ -17,7 +17,7 @@ import comboboxHTML from '../../../assets/subtitles/combobox.ejs'
17
17
  import stringHTML from '../../../assets/subtitles/string.ejs'
18
18
 
19
19
  import { isFullscreen } from '../utils.js'
20
- import type { ZeptoResult } from '../../utils/types.js'
20
+ import type { ZeptoResult } from '../../types.js'
21
21
 
22
22
  const VERSION: string = '2.19.14'
23
23
 
@@ -77,7 +77,7 @@ export type TelemetryRecord = {
77
77
  * @param data - The telemetry record to send.
78
78
  * @beta
79
79
  */
80
- type TelemetrySendFn = (data: TelemetryRecord) => void
80
+ export type TelemetrySendFn = (data: TelemetryRecord) => void
81
81
 
82
82
  /**
83
83
  * Plugin settings
@@ -103,7 +103,7 @@ export enum TelemetryEvent {
103
103
  }
104
104
 
105
105
  /**
106
- * Collects and reports the performance statistics.
106
+ * PLUGIN that collects and reports the performance statistics.
107
107
  * @beta
108
108
  * @remarks
109
109
  * This plugin is experimental and its API is likely to change.
@@ -8,7 +8,7 @@ import { CLAPPR_VERSION } from '../../build.js'
8
8
 
9
9
  import pluginHtml from '../../../assets/thumbnails/scrub-thumbnails.ejs'
10
10
  import '../../../assets/thumbnails/style.scss'
11
- import { ZeptoResult } from '../../utils/types.js'
11
+ import { ZeptoResult } from '../../types.js'
12
12
  import { getPageX } from '../utils.js'
13
13
 
14
14
  /**
@@ -16,7 +16,8 @@ import assert from 'assert'
16
16
  import { TimePosition } from '../../playback.types.js'
17
17
 
18
18
  import { CLAPPR_VERSION } from '../../build.js'
19
- import { TimerId, ZeptoResult } from '../../utils/types.js'
19
+ import { ZeptoResult } from '../../types.js'
20
+ import { TimerId } from '../../utils/types.js'
20
21
  import RollManager from './rollmanager.js'
21
22
  import SCTEManager from './sctemanager.js'
22
23
  import { VolumeFadeEvents } from '../volume-fade/VolumeFade.js'
@@ -286,7 +287,7 @@ export class VastAds extends UICorePlugin {
286
287
 
287
288
  private onPlaybackPlay() {
288
289
  setTimeout(() => {
289
- const posterPlugin = this.container?.getPlugin('poster_custom')
290
+ const posterPlugin = this.container?.getPlugin('poster')
290
291
 
291
292
  posterPlugin?.enable()
292
293
  posterPlugin?.$el.hide()
@@ -618,7 +619,7 @@ export class VastAds extends UICorePlugin {
618
619
  this._pluginError('failed to get Clappr playback')
619
620
  }
620
621
  // Attempt to get poster plugin. (May interfere with media control)
621
- this._posterPlugin = this._container?.getPlugin('poster_custom')
622
+ this._posterPlugin = this._container?.getPlugin('poster')
622
623
 
623
624
  // Attempt to get click-to-pause plugin. (May interfere with advert click handling)
624
625
  this._clickToPausePlugin = this._container?.getPlugin(
@@ -721,7 +722,7 @@ export class VastAds extends UICorePlugin {
721
722
 
722
723
  private adsPlaying() {
723
724
  assert(this.container, 'container is not defined')
724
- const poster = this.container.getPlugin('poster_custom')
725
+ const poster = this.container.getPlugin('poster')
725
726
 
726
727
  poster && poster.disable()
727
728
  try {
@@ -3,7 +3,8 @@ import { $, Container, Core, Events, Log, Playback } from '@clappr/core';
3
3
  import { reportError } from '@gcorevideo/utils';
4
4
  import assert from 'assert';
5
5
 
6
- import type { TimerId, ZeptoResult } from '../../utils/types.js';
6
+ import type { ZeptoResult } from '../../types.js';
7
+ import type { TimerId } from '../../utils/types.js';
7
8
 
8
9
  type RollConstructorOptions = {
9
10
  core: Core;
@@ -4,7 +4,7 @@ import assert from 'assert';
4
4
 
5
5
  import LoaderXML from './loaderxml.js';
6
6
  import Roll from './roll.js';
7
- import { ZeptoResult } from '../../utils/types.js';
7
+ import { ZeptoResult } from '../../types.js';
8
8
  import { AdRollDesc, AdRollItem, AdRollType, VastAdsOptions } from './types.js';
9
9
 
10
10
  type CoreOptions = Record<string, unknown>;
@@ -71,7 +71,7 @@ export default class RollManager extends Events {
71
71
  this.$areaClick = $areaClick;
72
72
  this._playback = this.core.activePlayback;
73
73
  this._contentElement = this._playback.el as HTMLMediaElement;
74
- this._posterPlugin = this._container.getPlugin('poster_custom');
74
+ this._posterPlugin = this._container.getPlugin('poster');
75
75
  this._clickToPausePlugin = this._container.getPlugin('click_to_pause_custom');
76
76
  this._adContainer = _adContainer;
77
77
  this._events = {};
@@ -210,7 +210,7 @@ export default class RollManager extends Events {
210
210
  //чтобы реклама шла одна за другой
211
211
  this._allURLRequest = !!roll.oneByOne;
212
212
  try {
213
- const customPosterPlugin = this.container.getPlugin('poster_custom');
213
+ const customPosterPlugin = this.container.getPlugin('poster');
214
214
 
215
215
  customPosterPlugin.hidePlayButton();
216
216
  } catch (error) {
package/src/types.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { $, Container, Core } from "@clappr/core";
2
+
1
3
  /**
2
4
  * Describes a media source with its MIME type and URL.
3
5
  *
@@ -61,17 +63,28 @@ export type TransportPreference = MediaTransport
61
63
  * {@link https://clappr.github.io/classes/ContainerPlugin.html}
62
64
  */
63
65
  export type PlayerPlugin = {
64
- new (...args: any[]): unknown
65
66
  name: string
66
67
  }
67
68
 
69
+ /**
70
+ * @beta
71
+ */
68
72
  export type PlayerPluginConstructor = CorePluginConstructor | ContainerPluginConstructor
69
- export type CorePluginConstructor = ((core: unknown) => PlayerPlugin) & {
70
- type: 'core'
73
+
74
+ /**
75
+ * @beta
76
+ */
77
+ export type CorePluginConstructor = {
78
+ new (core: Core): PlayerPlugin
79
+ type: string // 'core', but it's a nuisance to type it in the plugins definition
71
80
  }
72
81
 
73
- export type ContainerPluginConstructor = ((container: unknown) => PlayerPlugin) & {
74
- type: 'container'
82
+ /**
83
+ * @beta
84
+ */
85
+ export type ContainerPluginConstructor = {
86
+ new (container: Container): PlayerPlugin
87
+ type: string // 'container', but it's a nuisance to type it in the plugins definition
75
88
  }
76
89
 
77
90
  /**
@@ -289,3 +302,9 @@ export enum PlayerEvent {
289
302
  */
290
303
  VolumeUpdate = 'volumeupdate',
291
304
  }
305
+
306
+ /**
307
+ * {@link https://zeptojs.com/#$() | Zepto query result}
308
+ * @beta
309
+ */
310
+ export type ZeptoResult = ReturnType<typeof $>;
@@ -1,11 +1,3 @@
1
- import { $ } from "@clappr/core";
2
-
3
- /**
4
- * {@link https://zeptojs.com/#$() | Zepto query result}
5
- * @beta
6
- */
7
- export type ZeptoResult = ReturnType<typeof $>;
8
-
9
1
  /**
10
2
  * @internal
11
3
  */