@gcorevideo/player 2.20.9 → 2.20.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.
Files changed (236) hide show
  1. package/assets/dvr-controls/dvr_controls.scss +0 -2
  2. package/dist/core.js +5 -5
  3. package/dist/index.css +1521 -1524
  4. package/dist/index.js +101 -106
  5. package/dist/player.d.ts +141 -100
  6. package/dist/plugins/index.css +1376 -1379
  7. package/dist/plugins/index.js +96 -102
  8. package/docs/api/player.audioselector.md +1 -1
  9. package/docs/api/player.bigmutebutton.md +1 -1
  10. package/docs/api/player.bottomgear.md +1 -1
  11. package/docs/api/player.clapprnerdstats.md +1 -1
  12. package/docs/api/player.clapprstats.md +1 -1
  13. package/docs/api/player.clicktopause.md +1 -1
  14. package/docs/api/player.clipsplugin.md +1 -1
  15. package/docs/api/player.containerpluginconstructor.md +3 -5
  16. package/docs/api/player.containersize.md +0 -3
  17. package/docs/api/player.contextmenu.md +1 -1
  18. package/docs/api/player.contextmenupluginsettings.md +1 -1
  19. package/docs/api/player.corepluginconstructor.md +3 -5
  20. package/docs/api/player.dashsettings.md +0 -3
  21. package/docs/api/player.dvrcontrols.md +2 -35
  22. package/docs/api/player.errorlevel.md +0 -3
  23. package/docs/api/player.errorscreen.md +1 -1
  24. package/docs/api/player.favicon.md +4 -174
  25. package/docs/api/{player.favicon.disable.md → player.faviconpluginsettings.faviconcolor.md} +5 -7
  26. package/docs/api/{player.dvrcontrols._constructor_.md → player.faviconpluginsettings.md} +17 -8
  27. package/docs/api/player.googleanalytics.md +1 -1
  28. package/docs/api/player.langtag.md +0 -3
  29. package/docs/api/player.levelselector.md +1 -1
  30. package/docs/api/player.logo.md +1 -1
  31. package/docs/api/player.md +82 -82
  32. package/docs/api/{player.favicon.configure.md → player.mediacontrol.getcenterpanel.md} +4 -4
  33. package/docs/api/{player.favicon.destroy.md → player.mediacontrol.getleftpanel.md} +8 -4
  34. package/docs/api/player.mediacontrol.md +30 -2
  35. package/docs/api/player.multicamera.md +1 -1
  36. package/docs/api/player.pictureinpicture.md +1 -1
  37. package/docs/api/player.playbackerror.code.md +0 -3
  38. package/docs/api/player.playbackerror.description.md +0 -3
  39. package/docs/api/player.playbackerror.level.md +0 -3
  40. package/docs/api/player.playbackerror.md +8 -11
  41. package/docs/api/player.playbackerror.message.md +0 -3
  42. package/docs/api/player.playbackerror.origin.md +0 -3
  43. package/docs/api/player.playbackerror.scope.md +0 -3
  44. package/docs/api/player.playbackerror.ui.md +1 -3
  45. package/docs/api/player.playbackerrorcode.md +3 -6
  46. package/docs/api/player.playbackmodule.md +0 -3
  47. package/docs/api/player.playbackrate.md +1 -1
  48. package/docs/api/player.playbacktype.md +1 -4
  49. package/docs/api/player.player._constructor_.md +0 -3
  50. package/docs/api/player.player.attachto.md +0 -3
  51. package/docs/api/player.player.configure.md +0 -3
  52. package/docs/api/player.player.destroy.md +0 -3
  53. package/docs/api/player.player.getcurrenttime.md +0 -3
  54. package/docs/api/player.player.getduration.md +0 -3
  55. package/docs/api/player.player.getvolume.md +0 -3
  56. package/docs/api/player.player.isdvrenabled.md +0 -3
  57. package/docs/api/player.player.isdvrinuse.md +0 -3
  58. package/docs/api/player.player.ismuted.md +0 -3
  59. package/docs/api/player.player.isplaying.md +0 -3
  60. package/docs/api/player.player.md +25 -28
  61. package/docs/api/player.player.mute.md +0 -3
  62. package/docs/api/player.player.off.md +0 -3
  63. package/docs/api/player.player.on.md +0 -3
  64. package/docs/api/player.player.pause.md +0 -3
  65. package/docs/api/player.player.play.md +0 -3
  66. package/docs/api/player.player.registerplugin.md +0 -3
  67. package/docs/api/player.player.resize.md +0 -3
  68. package/docs/api/player.player.seek.md +0 -3
  69. package/docs/api/player.player.setvolume.md +0 -3
  70. package/docs/api/player.player.stop.md +0 -3
  71. package/docs/api/player.player.unmute.md +0 -3
  72. package/docs/api/player.player.unregisterplugin.md +14 -7
  73. package/docs/api/player.playercomponenttype.md +0 -3
  74. package/docs/api/player.playerconfig.autoplay.md +0 -3
  75. package/docs/api/player.playerconfig.dash.md +0 -3
  76. package/docs/api/player.playerconfig.debug.md +0 -3
  77. package/docs/api/player.playerconfig.language.md +0 -3
  78. package/docs/api/player.playerconfig.loop.md +0 -3
  79. package/docs/api/player.playerconfig.md +10 -13
  80. package/docs/api/player.playerconfig.mute.md +0 -3
  81. package/docs/api/player.playerconfig.playbacktype.md +0 -3
  82. package/docs/api/player.playerconfig.prioritytransport.md +0 -3
  83. package/docs/api/player.playerconfig.sources.md +0 -3
  84. package/docs/api/player.playerconfig.strings.md +0 -3
  85. package/docs/api/player.playerdebugsettings.md +0 -3
  86. package/docs/api/player.playerdebugtag.md +0 -3
  87. package/docs/api/player.playerevent.md +11 -14
  88. package/docs/api/player.playereventhandler.md +0 -3
  89. package/docs/api/player.playereventparams.md +0 -3
  90. package/docs/api/player.playermediasource.md +0 -3
  91. package/docs/api/player.playermediasourcedesc.md +2 -5
  92. package/docs/api/player.playermediasourcedesc.mimetype.md +0 -3
  93. package/docs/api/player.playermediasourcedesc.source.md +0 -3
  94. package/docs/api/player.playerplugin.md +0 -4
  95. package/docs/api/player.playerpluginconstructor.md +0 -3
  96. package/docs/api/player.poster.md +1 -1
  97. package/docs/api/player.qualitylevel.bitrate.md +0 -3
  98. package/docs/api/player.qualitylevel.height.md +0 -3
  99. package/docs/api/player.qualitylevel.level.md +0 -3
  100. package/docs/api/player.qualitylevel.md +4 -7
  101. package/docs/api/player.qualitylevel.width.md +0 -3
  102. package/docs/api/player.seektime.md +1 -1
  103. package/docs/api/player.share.md +1 -1
  104. package/docs/api/player.skiptime.md +1 -1
  105. package/docs/api/player.sourcecontroller.md +1 -1
  106. package/docs/api/player.spinnerthreebounce.md +1 -1
  107. package/docs/api/player.subtitles.md +1 -1
  108. package/docs/api/player.telemetry.md +1 -1
  109. package/docs/api/player.thumbnails.md +1 -1
  110. package/docs/api/player.timeposition.current.md +0 -3
  111. package/docs/api/player.timeposition.md +2 -5
  112. package/docs/api/player.timeposition.total.md +0 -3
  113. package/docs/api/player.timevalue.md +0 -3
  114. package/docs/api/player.translationkey.md +0 -3
  115. package/docs/api/player.translationsettings.md +0 -3
  116. package/docs/api/player.transportpreference.md +2 -7
  117. package/docs/api/player.volumefade.md +1 -1
  118. package/lib/Player.d.ts +5 -5
  119. package/lib/Player.js +2 -2
  120. package/lib/index.d.ts +18 -1
  121. package/lib/index.d.ts.map +1 -1
  122. package/lib/index.js +18 -1
  123. package/lib/playback.types.d.ts +8 -7
  124. package/lib/playback.types.d.ts.map +1 -1
  125. package/lib/playback.types.js +1 -1
  126. package/lib/plugins/audio-selector/AudioSelector.d.ts +1 -1
  127. package/lib/plugins/audio-selector/AudioSelector.js +1 -1
  128. package/lib/plugins/big-mute-button/BigMuteButton.d.ts +1 -1
  129. package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
  130. package/lib/plugins/big-mute-button/BigMuteButton.js +1 -2
  131. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
  132. package/lib/plugins/bottom-gear/BottomGear.js +1 -1
  133. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +1 -1
  134. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +1 -1
  135. package/lib/plugins/clappr-stats/ClapprStats.d.ts +1 -1
  136. package/lib/plugins/clappr-stats/ClapprStats.js +1 -1
  137. package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
  138. package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
  139. package/lib/plugins/clips/Clips.d.ts +1 -1
  140. package/lib/plugins/clips/Clips.js +1 -1
  141. package/lib/plugins/context-menu/ContextMenu.d.ts +2 -2
  142. package/lib/plugins/context-menu/ContextMenu.js +1 -1
  143. package/lib/plugins/dvr-controls/DvrControls.d.ts +6 -4
  144. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  145. package/lib/plugins/dvr-controls/DvrControls.js +28 -36
  146. package/lib/plugins/error-screen/ErrorScreen.d.ts +1 -18
  147. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  148. package/lib/plugins/error-screen/ErrorScreen.js +1 -2
  149. package/lib/plugins/favicon/Favicon.d.ts +30 -3
  150. package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
  151. package/lib/plugins/favicon/Favicon.js +28 -35
  152. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +1 -1
  153. package/lib/plugins/google-analytics/GoogleAnalytics.js +1 -1
  154. package/lib/plugins/level-selector/LevelSelector.d.ts +1 -1
  155. package/lib/plugins/level-selector/LevelSelector.js +1 -1
  156. package/lib/plugins/logo/Logo.d.ts +1 -1
  157. package/lib/plugins/logo/Logo.js +1 -1
  158. package/lib/plugins/media-control/MediaControl.d.ts +8 -2
  159. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  160. package/lib/plugins/media-control/MediaControl.js +15 -3
  161. package/lib/plugins/multi-camera/MultiCamera.d.ts +1 -1
  162. package/lib/plugins/multi-camera/MultiCamera.js +1 -1
  163. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +1 -1
  164. package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
  165. package/lib/plugins/playback-rate/PlaybackRate.d.ts +1 -1
  166. package/lib/plugins/playback-rate/PlaybackRate.js +1 -1
  167. package/lib/plugins/poster/Poster.d.ts +1 -1
  168. package/lib/plugins/poster/Poster.js +1 -1
  169. package/lib/plugins/seek-time/SeekTime.d.ts +1 -1
  170. package/lib/plugins/seek-time/SeekTime.js +1 -1
  171. package/lib/plugins/share/Share.d.ts +1 -1
  172. package/lib/plugins/share/Share.js +1 -1
  173. package/lib/plugins/skip-time/SkipTime.d.ts +1 -1
  174. package/lib/plugins/skip-time/SkipTime.js +1 -1
  175. package/lib/plugins/source-controller/SourceController.d.ts +1 -1
  176. package/lib/plugins/source-controller/SourceController.js +1 -1
  177. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +1 -1
  178. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +1 -1
  179. package/lib/plugins/subtitles/Subtitles.d.ts +1 -1
  180. package/lib/plugins/subtitles/Subtitles.js +1 -1
  181. package/lib/plugins/telemetry/Telemetry.d.ts +1 -1
  182. package/lib/plugins/telemetry/Telemetry.js +1 -1
  183. package/lib/plugins/thumbnails/Thumbnails.d.ts +1 -1
  184. package/lib/plugins/thumbnails/Thumbnails.js +1 -1
  185. package/lib/plugins/volume-fade/VolumeFade.d.ts +1 -1
  186. package/lib/plugins/volume-fade/VolumeFade.js +1 -1
  187. package/lib/testUtils.d.ts +11 -2
  188. package/lib/testUtils.d.ts.map +1 -1
  189. package/lib/testUtils.js +22 -3
  190. package/lib/types.d.ts +20 -25
  191. package/lib/types.d.ts.map +1 -1
  192. package/lib/types.js +1 -1
  193. package/package.json +1 -1
  194. package/src/Player.ts +5 -5
  195. package/src/index.ts +18 -1
  196. package/src/playback.types.ts +8 -7
  197. package/src/plugins/audio-selector/AudioSelector.ts +1 -1
  198. package/src/plugins/big-mute-button/BigMuteButton.ts +1 -2
  199. package/src/plugins/bottom-gear/BottomGear.ts +1 -1
  200. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +1 -1
  201. package/src/plugins/clappr-stats/ClapprStats.ts +1 -1
  202. package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
  203. package/src/plugins/clips/Clips.ts +1 -1
  204. package/src/plugins/context-menu/ContextMenu.ts +2 -2
  205. package/src/plugins/dvr-controls/DvrControls.ts +33 -45
  206. package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +91 -0
  207. package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +43 -0
  208. package/src/plugins/error-screen/ErrorScreen.ts +3 -22
  209. package/src/plugins/favicon/Favicon.ts +38 -41
  210. package/src/plugins/google-analytics/GoogleAnalytics.ts +1 -1
  211. package/src/plugins/level-selector/LevelSelector.ts +1 -1
  212. package/src/plugins/logo/Logo.ts +1 -1
  213. package/src/plugins/media-control/MediaControl.ts +17 -3
  214. package/src/plugins/multi-camera/MultiCamera.ts +1 -1
  215. package/src/plugins/picture-in-picture/PictureInPicture.ts +1 -1
  216. package/src/plugins/playback-rate/PlaybackRate.ts +1 -1
  217. package/src/plugins/poster/Poster.ts +1 -1
  218. package/src/plugins/seek-time/SeekTime.ts +1 -1
  219. package/src/plugins/share/Share.ts +1 -1
  220. package/src/plugins/skip-time/SkipTime.ts +1 -1
  221. package/src/plugins/source-controller/SourceController.ts +1 -1
  222. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +1 -1
  223. package/src/plugins/subtitles/Subtitles.ts +1 -1
  224. package/src/plugins/telemetry/Telemetry.ts +1 -1
  225. package/src/plugins/thumbnails/Thumbnails.ts +1 -1
  226. package/src/plugins/volume-fade/VolumeFade.ts +1 -1
  227. package/src/testUtils.ts +28 -4
  228. package/src/types.ts +20 -26
  229. package/temp/player.api.json +274 -455
  230. package/tsconfig.tsbuildinfo +1 -1
  231. package/docs/api/player.errordesc.md +0 -28
  232. package/docs/api/player.favicon._constructor_.md +0 -50
  233. package/docs/api/player.favicon.bindevents.md +0 -18
  234. package/docs/api/player.favicon.name.md +0 -14
  235. package/docs/api/player.favicon.supportedversion.md +0 -16
  236. package/docs/api/player.mediatransport.md +0 -16
@@ -7,7 +7,7 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- PLUGIN that collects and reports the performance statistics.
10
+ `PLUGIN` that collects and reports the performance statistics.
11
11
 
12
12
  **Signature:**
13
13
 
@@ -7,7 +7,7 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Displays the thumbnails of the video when available.
10
+ `PLUGIN` that displays the thumbnails of the video when available.
11
11
 
12
12
  **Signature:**
13
13
 
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## TimePosition.current property
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  Current playback time, 0..duration, seconds.
11
8
 
12
9
  **Signature:**
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## TimePosition interface
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  Current playback time and total duration of the media.
11
8
 
12
9
  **Signature:**
@@ -53,7 +50,7 @@ Description
53
50
 
54
51
  </td><td>
55
52
 
56
- **_(BETA)_** Current playback time, 0..duration, seconds.
53
+ Current playback time, 0..duration, seconds.
57
54
 
58
55
 
59
56
  </td></tr>
@@ -72,7 +69,7 @@ Description
72
69
 
73
70
  </td><td>
74
71
 
75
- **_(BETA)_** Total duration of the media, seconds.
72
+ Total duration of the media, seconds.
76
73
 
77
74
 
78
75
  </td></tr>
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## TimePosition.total property
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  Total duration of the media, seconds.
11
8
 
12
9
  **Signature:**
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## TimeValue type
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  Playback time in seconds since the beginning of the stream (or a segment for the live streams)
11
8
 
12
9
  **Signature:**
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## TranslationKey type
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
 
11
8
  **Signature:**
12
9
 
@@ -4,9 +4,6 @@
4
4
 
5
5
  ## TranslationSettings type
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
7
  Localization strings for the player UI.
11
8
 
12
9
  **Signature:**
@@ -4,15 +4,10 @@
4
4
 
5
5
  ## TransportPreference type
6
6
 
7
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
- >
9
-
10
- Preferred media delivery protocol
7
+ Preferred streaming media delivery protocol
11
8
 
12
9
  **Signature:**
13
10
 
14
11
  ```typescript
15
- export type TransportPreference = MediaTransport;
12
+ export type TransportPreference = 'dash' | 'hls';
16
13
  ```
17
- **References:** [MediaTransport](./player.mediatransport.md)
18
-
@@ -7,7 +7,7 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Applies fade effect to the player's volume change.
10
+ `PLUGIN` that applies fade effect to the player's volume change.
11
11
 
12
12
  **Signature:**
13
13
 
package/lib/Player.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { ContainerSize, PlayerPluginConstructor } from './types.js';
2
2
  import { PlayerConfig, PlayerEvent } from './types.js';
3
3
  import { PlaybackError, TimePosition } from './playback.types.js';
4
4
  /**
5
- * @beta
5
+ * @public
6
6
  */
7
7
  export type PlayerEventParams<E extends PlayerEvent> = E extends PlayerEvent.Seek ? [number] : E extends PlayerEvent.VolumeUpdate ? [number] : E extends PlayerEvent.TimeUpdate ? [TimePosition] : E extends PlayerEvent.Resize ? [{
8
8
  width: number;
@@ -11,17 +11,17 @@ export type PlayerEventParams<E extends PlayerEvent> = E extends PlayerEvent.See
11
11
  /**
12
12
  * Type of a listener callback function for a player event.
13
13
  * See the description of the event parameters in {@link PlayerEvent}.
14
- * @beta
14
+ * @public
15
15
  */
16
16
  export type PlayerEventHandler<E extends PlayerEvent> = (...args: PlayerEventParams<E>) => void;
17
17
  /**
18
18
  * Module to perform the playback.
19
- * @beta
19
+ * @public
20
20
  */
21
21
  export type PlaybackModule = 'dash' | 'hls' | 'html5_video';
22
22
  /**
23
- * The main component to use in the application code.
24
- * @beta
23
+ * `MAIN` component to use in the application code.
24
+ * @public
25
25
  * @remarks
26
26
  * The Player object provides very basic API to control playback.
27
27
  * To build a sophisticated UI, use the plugins framework to tap into the Clappr core.
package/lib/Player.js CHANGED
@@ -17,8 +17,8 @@ const DEFAULT_OPTIONS = {
17
17
  strings: {},
18
18
  };
19
19
  /**
20
- * The main component to use in the application code.
21
- * @beta
20
+ * `MAIN` component to use in the application code.
21
+ * @public
22
22
  * @remarks
23
23
  * The Player object provides very basic API to control playback.
24
24
  * To build a sophisticated UI, use the plugins framework to tap into the Clappr core.
package/lib/index.d.ts CHANGED
@@ -3,9 +3,26 @@
3
3
  *
4
4
  * @remarks
5
5
  * This package provides a video player for the Gcore streaming platform.
6
- * It is built on top of the Clappr library and provides a framework for building custom integrations.
6
+ * It is built on top of the {@link https://github.com/clappr/clappr | Clappr} library and provides a framework for building custom integrations.
7
7
  * Start with {@link Player} for more information.
8
8
  *
9
+ * Various plugins (marked with `PLUGIN` keyword) are available to extend the player with additional features.
10
+ * @example
11
+ * ```ts
12
+ * import { Player, MediaControl, ErrorScreen } from '@gcorevideo/player'
13
+ *
14
+ * Player.registerPlugin(MediaControl)
15
+ * Player.registerPlugin(ErrorScreen)
16
+ *
17
+ * const player = new Player({
18
+ * autoPlay: true,
19
+ * mute: true,
20
+ * sources: [{ source: 'https://example.com/a.mpd', mimeType: 'application/dash+xml' }],
21
+ * })
22
+ *
23
+ * player.attachTo(document.getElementById('container'))
24
+ * ```
25
+ *
9
26
  * @packageDocumentation
10
27
  */
11
28
  export * from './index.core.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA"}
package/lib/index.js CHANGED
@@ -3,9 +3,26 @@
3
3
  *
4
4
  * @remarks
5
5
  * This package provides a video player for the Gcore streaming platform.
6
- * It is built on top of the Clappr library and provides a framework for building custom integrations.
6
+ * It is built on top of the {@link https://github.com/clappr/clappr | Clappr} library and provides a framework for building custom integrations.
7
7
  * Start with {@link Player} for more information.
8
8
  *
9
+ * Various plugins (marked with `PLUGIN` keyword) are available to extend the player with additional features.
10
+ * @example
11
+ * ```ts
12
+ * import { Player, MediaControl, ErrorScreen } from '@gcorevideo/player'
13
+ *
14
+ * Player.registerPlugin(MediaControl)
15
+ * Player.registerPlugin(ErrorScreen)
16
+ *
17
+ * const player = new Player({
18
+ * autoPlay: true,
19
+ * mute: true,
20
+ * sources: [{ source: 'https://example.com/a.mpd', mimeType: 'application/dash+xml' }],
21
+ * })
22
+ *
23
+ * player.attachTo(document.getElementById('container'))
24
+ * ```
25
+ *
9
26
  * @packageDocumentation
10
27
  */
11
28
  export * from './index.core.js';
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Playback time in seconds since the beginning of the stream (or a segment for the live streams)
3
- * @beta
3
+ * @public
4
4
  */
5
5
  export type TimeValue = number;
6
6
  /**
7
7
  * Current playback time and total duration of the media.
8
- * @beta
8
+ * @public
9
9
  */
10
10
  export interface TimePosition {
11
11
  /**
@@ -33,7 +33,7 @@ export type TimeUpdate = TimePosition & {
33
33
  };
34
34
  /**
35
35
  * A level of quality within a media source.
36
- * @beta
36
+ * @public
37
37
  */
38
38
  export interface QualityLevel {
39
39
  /**
@@ -55,7 +55,7 @@ export interface QualityLevel {
55
55
  }
56
56
  /**
57
57
  * Codes of errors occurring within the playback component.
58
- * @beta
58
+ * @public
59
59
  */
60
60
  export declare enum PlaybackErrorCode {
61
61
  /**
@@ -73,17 +73,17 @@ export declare enum PlaybackErrorCode {
73
73
  }
74
74
  /**
75
75
  * Levels of severity of errors. Non-fatal errors usually can be ignored.
76
- * @beta
76
+ * @public
77
77
  */
78
78
  export type ErrorLevel = 'FATAL' | 'WARN' | 'INFO';
79
79
  /**
80
80
  * Subsystems of a player component.
81
- * @beta
81
+ * @public
82
82
  */
83
83
  export type PlayerComponentType = 'container' | 'core' | 'playback';
84
84
  /**
85
85
  * An error occurred during the playback.
86
- * @beta
86
+ * @public
87
87
  */
88
88
  export interface PlaybackError {
89
89
  /**
@@ -120,6 +120,7 @@ export interface PlaybackError {
120
120
  UI?: {
121
121
  title: string;
122
122
  message: string;
123
+ icon?: string;
123
124
  };
124
125
  }
125
126
  //# sourceMappingURL=playback.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,EAAE,SAAS,CAAA;IAClB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,OAAO,kBAAkB;IACzB;;OAEG;IACH,sBAAsB,6BAA6B;IACnD;;OAEG;IACH,uBAAuB,+BAA+B;CACvD;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,CAAA;AAEnE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAA;IACvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,mBAAmB,CAAA;IAE1B;;OAEG;IACH,EAAE,CAAC,EAAE;QACH,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF"}
1
+ {"version":3,"file":"playback.types.d.ts","sourceRoot":"","sources":["../src/playback.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,EAAE,SAAS,CAAA;IAClB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG;IACtC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,OAAO,kBAAkB;IACzB;;OAEG;IACH,sBAAsB,6BAA6B;IACnD;;OAEG;IACH,uBAAuB,+BAA+B;CACvD;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,CAAA;AAEnE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAA;IACvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,mBAAmB,CAAA;IAE1B;;OAEG;IACH,EAAE,CAAC,EAAE;QACH,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Codes of errors occurring within the playback component.
3
- * @beta
3
+ * @public
4
4
  */
5
5
  export var PlaybackErrorCode;
6
6
  (function (PlaybackErrorCode) {
@@ -2,7 +2,7 @@ import { UICorePlugin } from '@clappr/core';
2
2
  import { AudioTrackLoadedData, AudioTrackSwitchedData, Events as HlsEvents } from 'hls.js';
3
3
  import '../../../assets/audio-selector/style.scss';
4
4
  /**
5
- * Adds an audio track selector to the media control UI.
5
+ * `PLUGIN` that adds an audio track selector to the media control UI.
6
6
  * @beta
7
7
  */
8
8
  export declare class AudioSelector extends UICorePlugin {
@@ -9,7 +9,7 @@ const VERSION = '0.0.1';
9
9
  // const T = 'plugins.audio_selector';
10
10
  const AUTO = 0;
11
11
  /**
12
- * Adds an audio track selector to the media control UI.
12
+ * `PLUGIN` that adds an audio track selector to the media control UI.
13
13
  * @beta
14
14
  */
15
15
  export class AudioSelector extends UICorePlugin {
@@ -1,7 +1,7 @@
1
1
  import { UICorePlugin } from '@clappr/core';
2
2
  import '../../../assets/big-mute-button/big-mute-button.scss';
3
3
  /**
4
- * Displays a big mute button over the video when it's muted.
4
+ * `PLUGIN` that displays a big mute button over the video when it's muted.
5
5
  * Once pressed, it unmutes the video.
6
6
  * @beta
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BigMuteButton.d.ts","sourceRoot":"","sources":["../../../src/plugins/big-mute-button/BigMuteButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,MAAM,cAAc,CAAA;AAQpE,OAAO,sDAAsD,CAAA;AAM7D;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,qBAAqB,CAAQ;IAErC,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,oBAAoB,CAA2B;IAEvD,OAAO,CAAC,cAAc,CAA2B;IAEjD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IAenB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,YAAY;IAmBpB;;OAEG;IACM,MAAM;IAuBf,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,qBAAqB;CAS9B"}
1
+ {"version":3,"file":"BigMuteButton.d.ts","sourceRoot":"","sources":["../../../src/plugins/big-mute-button/BigMuteButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,MAAM,cAAc,CAAA;AAQpE,OAAO,sDAAsD,CAAA;AAM7D;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,qBAAqB,CAAQ;IAErC,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,oBAAoB,CAA2B;IAEvD,OAAO,CAAC,cAAc,CAA2B;IAEjD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IAcnB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,YAAY;IAmBpB;;OAEG;IACM,MAAM;IAuBf,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,qBAAqB;CAS9B"}
@@ -7,7 +7,7 @@ import '../../../assets/big-mute-button/big-mute-button.scss';
7
7
  const T = 'plugins.big_mute_button';
8
8
  // TODO rewrite as a container plugin
9
9
  /**
10
- * Displays a big mute button over the video when it's muted.
10
+ * `PLUGIN` that displays a big mute button over the video when it's muted.
11
11
  * Once pressed, it unmutes the video.
12
12
  * @beta
13
13
  */
@@ -42,7 +42,6 @@ export class BigMuteButton extends UICorePlugin {
42
42
  * @internal
43
43
  */
44
44
  bindEvents() {
45
- super.bindEvents();
46
45
  this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
47
46
  this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
48
47
  this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
@@ -8,7 +8,7 @@ import { ZeptoResult } from '../../types.js';
8
8
  */
9
9
  export type GearItemElement = 'quality' | 'rate' | 'nerd';
10
10
  /**
11
- * Adds the gear button that triggers extra options menu on the right side of the {@link MediaControl | media control} UI
11
+ * `PLUGIN` that adds the gear button with an extra options menu on the right side of the {@link MediaControl | media control} UI
12
12
  * @beta
13
13
  * @remarks
14
14
  * The plugins provides a base for attaching custom settings UI in the gear menu
@@ -11,7 +11,7 @@ import { MediaControlEvents } from '../media-control/MediaControl';
11
11
  const VERSION = '2.19.12';
12
12
  const T = 'plugins.bottom_gear';
13
13
  /**
14
- * Adds the gear button that triggers extra options menu on the right side of the {@link MediaControl | media control} UI
14
+ * `PLUGIN` that adds the gear button with an extra options menu on the right side of the {@link MediaControl | media control} UI
15
15
  * @beta
16
16
  * @remarks
17
17
  * The plugins provides a base for attaching custom settings UI in the gear menu
@@ -1,7 +1,7 @@
1
1
  import { UICorePlugin, Core } from '@clappr/core';
2
2
  import '../../../assets/clappr-nerd-stats/clappr-nerd-stats.scss';
3
3
  /**
4
- * PLUGIN that displays useful network-related statistics.
4
+ * `PLUGIN` that displays useful network-related statistics.
5
5
  * @beta
6
6
  *
7
7
  * @remarks
@@ -81,7 +81,7 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
81
81
  };
82
82
  // const T = 'plugins.clappr_nerd_stats';
83
83
  /**
84
- * PLUGIN that displays useful network-related statistics.
84
+ * `PLUGIN` that displays useful network-related statistics.
85
85
  * @beta
86
86
  *
87
87
  * @remarks
@@ -1,7 +1,7 @@
1
1
  import { Container, ContainerPlugin } from '@clappr/core';
2
2
  import type { Metrics, MetricsUpdateFn } from './types.js';
3
3
  /**
4
- * PLIGIN that collects useful statistics about playback performance.
4
+ * `PLUGIN` that collects useful statistics about playback performance.
5
5
  * @beta
6
6
  * @remarks
7
7
  * This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
@@ -6,7 +6,7 @@ import { newMetrics } from './utils.js';
6
6
  // TODO: fix
7
7
  const updateMetrics = () => { };
8
8
  /**
9
- * PLIGIN that collects useful statistics about playback performance.
9
+ * `PLUGIN` that collects useful statistics about playback performance.
10
10
  * @beta
11
11
  * @remarks
12
12
  * This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
@@ -1,6 +1,6 @@
1
1
  import { ContainerPlugin } from '@clappr/core';
2
2
  /**
3
- * Adds a behavior of toggling the playback state on click over the container
3
+ * `PLUGIN` that adds a behavior of toggling the playback state on click over the container
4
4
  * @beta
5
5
  */
6
6
  export declare class ClickToPause extends ContainerPlugin {
@@ -6,7 +6,7 @@ import { trace } from '@gcorevideo/utils';
6
6
  import { CLAPPR_VERSION } from '../../build.js';
7
7
  const T = 'plugins.click_to_pause_custom';
8
8
  /**
9
- * Adds a behavior of toggling the playback state on click over the container
9
+ * `PLUGIN` that adds a behavior of toggling the playback state on click over the container
10
10
  * @beta
11
11
  */
12
12
  export class ClickToPause extends ContainerPlugin {
@@ -11,7 +11,7 @@ export interface ClipsPluginSettings {
11
11
  text: string;
12
12
  }
13
13
  /**
14
- * PLUGIN that shows text over the seekbar to indicate the current clip.
14
+ * `PLUGIN` that shows text over the seekbar to indicate the current clip.
15
15
  * @beta
16
16
  * @remarks
17
17
  * Depends on:
@@ -3,7 +3,7 @@ import { strtimeToMiliseconds } from '../utils.js';
3
3
  import '../../../assets/clips/clips.scss';
4
4
  import assert from 'assert';
5
5
  /**
6
- * PLUGIN that shows text over the seekbar to indicate the current clip.
6
+ * `PLUGIN` that shows text over the seekbar to indicate the current clip.
7
7
  * @beta
8
8
  * @remarks
9
9
  * Depends on:
@@ -1,7 +1,7 @@
1
1
  import { Container, UIContainerPlugin } from '@clappr/core';
2
2
  import '../../../assets/context-menu/context_menu.scss';
3
3
  /**
4
- * The plugin adds a context menu to the player.
4
+ * Context menu plugin settings
5
5
  * @beta
6
6
  */
7
7
  export interface ContextMenuPluginSettings {
@@ -10,7 +10,7 @@ export interface ContextMenuPluginSettings {
10
10
  preventShowContextMenu?: boolean;
11
11
  }
12
12
  /**
13
- * Displays a small context menu when clicked on the player container.
13
+ * `PLUGIN` that displays a small context menu when clicked on the player container.
14
14
  * @beta
15
15
  * @remarks
16
16
  * Configuration options - {@link ContextMenuPluginSettings}
@@ -4,7 +4,7 @@ import '../../../assets/context-menu/context_menu.scss';
4
4
  import templateHtml from '../../../assets/context-menu/context_menu.ejs';
5
5
  import { version } from '../../version.js';
6
6
  /**
7
- * Displays a small context menu when clicked on the player container.
7
+ * `PLUGIN` that displays a small context menu when clicked on the player container.
8
8
  * @beta
9
9
  * @remarks
10
10
  * Configuration options - {@link ContextMenuPluginSettings}
@@ -1,7 +1,7 @@
1
- import { Core, UICorePlugin } from '@clappr/core';
1
+ import { UICorePlugin } from '@clappr/core';
2
2
  import '../../../assets/dvr-controls/dvr_controls.scss';
3
3
  /**
4
- * PLUGIN that adds the DVR controls to the media control UI
4
+ * `PLUGIN` that adds the DVR controls to the media control UI
5
5
  *
6
6
  * @beta
7
7
  *
@@ -10,7 +10,9 @@ import '../../../assets/dvr-controls/dvr_controls.scss';
10
10
  *
11
11
  * - {@link MediaControl}
12
12
  *
13
- * The plugin renders live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
13
+ * The plugin renders live stream indicator.
14
+ * If DVR is enabled, the indicator shows whether the current position is at the live edge of the stream or not.
15
+ * In the latter case, the indicator can be clicked to seek to the live edge.
14
16
  */
15
17
  export declare class DvrControls extends UICorePlugin {
16
18
  private static readonly template;
@@ -37,11 +39,11 @@ export declare class DvrControls extends UICorePlugin {
37
39
  class: string;
38
40
  'data-dvr-controls': string;
39
41
  };
40
- constructor(core: Core);
41
42
  /**
42
43
  * @internal
43
44
  */
44
45
  bindEvents(): void;
46
+ private onCoreReady;
45
47
  private bindContainerEvents;
46
48
  private onDvrChanged;
47
49
  private click;
@@ -1 +1 @@
1
- {"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAA;AAM7E,OAAO,gDAAgD,CAAA;AAKvD;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAEpD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;gBAEW,IAAI,EAAE,IAAI;IAKtB;;OAEG;IACM,UAAU;IAgBnB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,YAAY;IAQpB;;OAEG;IACM,MAAM;CAuBhB"}
1
+ {"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAY,MAAM,cAAc,CAAA;AAM7E,OAAO,gDAAgD,CAAA;AAMvD;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAEpD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACM,UAAU;IAUnB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,KAAK;IAQb,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,YAAY;IAKpB;;OAEG;IACM,MAAM;CAoBhB"}