@gcorevideo/player 2.20.12 → 2.20.13

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 (48) hide show
  1. package/dist/core.js +26 -2
  2. package/dist/index.css +1197 -1197
  3. package/dist/index.js +33 -19
  4. package/dist/player.d.ts +8 -10
  5. package/dist/plugins/index.css +1619 -1619
  6. package/dist/plugins/index.js +8 -13
  7. package/docs/api/player.md +1 -1
  8. package/docs/api/player.mediacontrol.md +2 -11
  9. package/docs/api/player.playbackerror.md +2 -2
  10. package/docs/api/player.playbackerror.origin.md +1 -1
  11. package/docs/api/player.playbackerror.scope.md +1 -1
  12. package/docs/api/player.poster.md +1 -1
  13. package/docs/api/player.sourcecontroller.md +2 -33
  14. package/lib/Player.js +1 -1
  15. package/lib/playback/HTML5Video.d.ts +5 -0
  16. package/lib/playback/HTML5Video.d.ts.map +1 -1
  17. package/lib/playback/HTML5Video.js +21 -0
  18. package/lib/playback/hls-playback/HlsPlayback.d.ts +2 -2
  19. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  20. package/lib/playback/hls-playback/HlsPlayback.js +4 -0
  21. package/lib/playback.types.d.ts +2 -2
  22. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  23. package/lib/plugins/click-to-pause/ClickToPause.js +0 -4
  24. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  25. package/lib/plugins/dvr-controls/DvrControls.js +0 -1
  26. package/lib/plugins/media-control/MediaControl.d.ts +1 -8
  27. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  28. package/lib/plugins/media-control/MediaControl.js +2 -9
  29. package/lib/plugins/poster/Poster.d.ts +2 -0
  30. package/lib/plugins/poster/Poster.d.ts.map +1 -1
  31. package/lib/plugins/poster/Poster.js +3 -3
  32. package/lib/plugins/source-controller/SourceController.d.ts +3 -0
  33. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  34. package/lib/plugins/source-controller/SourceController.js +3 -0
  35. package/package.json +1 -1
  36. package/src/Player.ts +1 -1
  37. package/src/playback/HTML5Video.ts +29 -1
  38. package/src/playback/__tests__/HTML5Video.test.ts +47 -0
  39. package/src/playback/hls-playback/HlsPlayback.ts +5 -1
  40. package/src/playback.types.ts +2 -2
  41. package/src/plugins/click-to-pause/ClickToPause.ts +0 -5
  42. package/src/plugins/dvr-controls/DvrControls.ts +0 -1
  43. package/src/plugins/media-control/MediaControl.ts +2 -9
  44. package/src/plugins/poster/Poster.ts +4 -3
  45. package/src/plugins/source-controller/SourceController.ts +3 -0
  46. package/temp/player.api.json +6 -40
  47. package/tsconfig.tsbuildinfo +1 -1
  48. package/docs/api/player.sourcecontroller._constructor_.md +0 -50
@@ -70,11 +70,6 @@ export class ClickToPause extends ContainerPlugin {
70
70
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE
71
71
  const pointerEnabled = !isLivePlayback || this.container.isDvrEnabled()
72
72
 
73
- trace(`${T} settingsUpdate`, {
74
- isLivePlayback,
75
- pointerEnabled,
76
- })
77
-
78
73
  if (pointerEnabled === this.pointerEnabled) {
79
74
  return
80
75
  }
@@ -129,7 +129,6 @@ export class DvrControls extends UICorePlugin {
129
129
  }
130
130
 
131
131
  private settingsUpdate() {
132
- trace(`${T} settingsUpdate`)
133
132
  this.core.getPlugin('media_control').$el.removeClass('live')
134
133
  this.render()
135
134
  }
@@ -19,6 +19,7 @@ import { reportError, trace } from '@gcorevideo/utils'
19
19
 
20
20
  import { type TimeProgress } from '../../playback.types.js'
21
21
 
22
+ // TODO replace Kibo with mousetrap
22
23
  import { Kibo } from '../kibo/index.js'
23
24
 
24
25
  import { CLAPPR_VERSION } from '../../build.js'
@@ -90,17 +91,10 @@ type DisabledClickable = {
90
91
  }
91
92
 
92
93
  /**
93
- * `PLUGIN` that provides a foundation for developing custom media controls UI.
94
+ * `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.
94
95
  * @beta
95
96
  * @remarks
96
97
  * The methods exposed are to be used by the other plugins that extend the media control UI.
97
- * The plugin registration should be arranged so that MediaControl is initialized before every other `PLUGIN` that depends on it.
98
- * @example
99
- * ```ts
100
- * Player.registerPlugin(MediaControl) // <--- This must go first
101
- * Player.registerPlugin(LevelSelector) // a media control plugin
102
- * Player.registerPlugin(NerdStats) // another media control plugin
103
- * ```
104
98
  */
105
99
  export class MediaControl extends UICorePlugin {
106
100
  private advertisementPlaying = false
@@ -1316,7 +1310,6 @@ export class MediaControl extends UICorePlugin {
1316
1310
  }
1317
1311
 
1318
1312
  private configure() {
1319
- // this.advertisementPlaying ? this.disable() : this.enable()
1320
1313
  this.trigger(Events.MEDIACONTROL_OPTIONS_CHANGE)
1321
1314
  }
1322
1315
 
@@ -9,7 +9,6 @@ import {
9
9
  UIContainerPlugin,
10
10
  template,
11
11
  $,
12
- Container,
13
12
  } from '@clappr/core'
14
13
  import { trace } from '@gcorevideo/utils'
15
14
 
@@ -28,6 +27,8 @@ const T = 'plugins.poster'
28
27
  * @beta
29
28
  * @remarks
30
29
  * When the playback is stopped, media control UI is disabled.
30
+ * Note that the poster image, if specified via the player config, will be used to update video element's poster attribute by the
31
+ * HTML5-video-based playback module.
31
32
  *
32
33
  * Configuration options:
33
34
  *
@@ -51,6 +52,8 @@ const T = 'plugins.poster'
51
52
  * ```
52
53
  */
53
54
  export class Poster extends UIContainerPlugin {
55
+ // TODO merge non-poster related functionality into the ClickToPause plugin
56
+
54
57
  private hasFatalError = false
55
58
 
56
59
  private hasStartedPlaying = false
@@ -236,8 +239,6 @@ export class Poster extends UIContainerPlugin {
236
239
  this.container.playback.consent()
237
240
  this.container.playback.play()
238
241
  }
239
- } else {
240
- this.container.trigger('container:start')
241
242
  }
242
243
 
243
244
  return false
@@ -108,6 +108,9 @@ export class SourceController extends CorePlugin {
108
108
  return { min: CLAPPR_VERSION }
109
109
  }
110
110
 
111
+ /**
112
+ * @internal
113
+ */
111
114
  constructor(core: ClapprCore) {
112
115
  super(core)
113
116
  this.sourcesList = this.core.options.sources
@@ -2594,7 +2594,7 @@
2594
2594
  {
2595
2595
  "kind": "Class",
2596
2596
  "canonicalReference": "@gcorevideo/player!MediaControl:class",
2597
- "docComment": "/**\n * `PLUGIN` that provides a foundation for developing custom media controls UI.\n *\n * @remarks\n *\n * The methods exposed are to be used by the other plugins that extend the media control UI. The plugin registration should be arranged so that MediaControl is initialized before every other `PLUGIN` that depends on it.\n *\n * @example\n * ```ts\n * Player.registerPlugin(MediaControl) // <--- This must go first\n * Player.registerPlugin(LevelSelector) // a media control plugin\n * Player.registerPlugin(NerdStats) // another media control plugin\n * ```\n *\n * @beta\n */\n",
2597
+ "docComment": "/**\n * `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.\n *\n * @remarks\n *\n * The methods exposed are to be used by the other plugins that extend the media control UI.\n *\n * @beta\n */\n",
2598
2598
  "excerptTokens": [
2599
2599
  {
2600
2600
  "kind": "Content",
@@ -3737,7 +3737,7 @@
3737
3737
  {
3738
3738
  "kind": "PropertySignature",
3739
3739
  "canonicalReference": "@gcorevideo/player!PlaybackError#origin:member",
3740
- "docComment": "/**\n * Exact component that originated the error.\n *\n * @example\n *\n * - 'core' - 'dash' - 'media_control'\n */\n",
3740
+ "docComment": "/**\n * Name of the component that originated the error.\n *\n * @example\n *\n * - 'core' - 'dash' - 'media_control'\n */\n",
3741
3741
  "excerptTokens": [
3742
3742
  {
3743
3743
  "kind": "Content",
@@ -3764,7 +3764,7 @@
3764
3764
  {
3765
3765
  "kind": "PropertySignature",
3766
3766
  "canonicalReference": "@gcorevideo/player!PlaybackError#scope:member",
3767
- "docComment": "/**\n * Component subsystem of the error origin\n */\n",
3767
+ "docComment": "/**\n * Component subsystem of the error origin, together with the `origin` uniquely identifies the originating component.\n */\n",
3768
3768
  "excerptTokens": [
3769
3769
  {
3770
3770
  "kind": "Content",
@@ -5998,7 +5998,7 @@
5998
5998
  {
5999
5999
  "kind": "Class",
6000
6000
  "canonicalReference": "@gcorevideo/player!Poster:class",
6001
- "docComment": "/**\n * `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped\n *\n * @remarks\n *\n * When the playback is stopped, media control UI is disabled.\n *\n * Configuration options:\n *\n * - `poster.custom` - custom CSS background\n *\n * - `poster.showForNoOp` - whether to show the poster when the playback is not started\n *\n * - `poster.url` - the URL of the poster image\n *\n * - `poster.showOnVideoEnd` - whether to show the poster when the playback is ended\n *\n * @example\n * ```ts\n * new Player({\n * ...\n * poster: {\n * showForNoOp: true,\n * url: 'https://via.placeholder.com/150.png',\n * }\n * })\n * ```\n *\n * @beta\n */\n",
6001
+ "docComment": "/**\n * `PLUGIN` that displays a poster image in the background and a big play button on top when playback is stopped\n *\n * @remarks\n *\n * When the playback is stopped, media control UI is disabled. Note that the poster image, if specified via the player config, will be used to update video element's poster attribute by the HTML5-video-based playback module.\n *\n * Configuration options:\n *\n * - `poster.custom` - custom CSS background\n *\n * - `poster.showForNoOp` - whether to show the poster when the playback is not started\n *\n * - `poster.url` - the URL of the poster image\n *\n * - `poster.showOnVideoEnd` - whether to show the poster when the playback is ended\n *\n * @example\n * ```ts\n * new Player({\n * ...\n * poster: {\n * showForNoOp: true,\n * url: 'https://via.placeholder.com/150.png',\n * }\n * })\n * ```\n *\n * @beta\n */\n",
6002
6002
  "excerptTokens": [
6003
6003
  {
6004
6004
  "kind": "Content",
@@ -7659,7 +7659,7 @@
7659
7659
  {
7660
7660
  "kind": "Class",
7661
7661
  "canonicalReference": "@gcorevideo/player!SourceController:class",
7662
- "docComment": "/**\n * `PLUGIN` that is responsible for managing the automatic failover between sources.\n *\n * @remarks\n *\n * Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details on how sources ordering and selection works.\n *\n * This plugin does not expose any public methods apart from required by the Clappr plugin interface. It is supposed to work autonomously.\n *\n * @example\n * ```ts\n * import { SourceController } from '@gcorevideo/player'\n *\n * Player.registerPlugin(SourceController)\n * ```\n *\n * @beta\n */\n",
7662
+ "docComment": "/**\n * `PLUGIN` that is responsible for managing the automatic failover between sources.\n *\n * @remarks\n *\n * Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details on how sources ordering and selection works.\n *\n * This plugin does not expose any public methods apart from required by the Clappr plugin interface. It is supposed to work autonomously.\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `SourceController` class.\n *\n * @example\n * ```ts\n * import { SourceController } from '@gcorevideo/player'\n *\n * Player.registerPlugin(SourceController)\n * ```\n *\n * @beta\n */\n",
7663
7663
  "excerptTokens": [
7664
7664
  {
7665
7665
  "kind": "Content",
@@ -7680,41 +7680,7 @@
7680
7680
  "isAbstract": false,
7681
7681
  "name": "SourceController",
7682
7682
  "preserveMemberOrder": false,
7683
- "members": [
7684
- {
7685
- "kind": "Constructor",
7686
- "canonicalReference": "@gcorevideo/player!SourceController:constructor(1)",
7687
- "docComment": "/**\n * Constructs a new instance of the `SourceController` class\n */\n",
7688
- "excerptTokens": [
7689
- {
7690
- "kind": "Content",
7691
- "text": "constructor(core: "
7692
- },
7693
- {
7694
- "kind": "Reference",
7695
- "text": "ClapprCore",
7696
- "canonicalReference": "@clappr/core!default:class"
7697
- },
7698
- {
7699
- "kind": "Content",
7700
- "text": ");"
7701
- }
7702
- ],
7703
- "releaseTag": "Beta",
7704
- "isProtected": false,
7705
- "overloadIndex": 1,
7706
- "parameters": [
7707
- {
7708
- "parameterName": "core",
7709
- "parameterTypeTokenRange": {
7710
- "startIndex": 1,
7711
- "endIndex": 2
7712
- },
7713
- "isOptional": false
7714
- }
7715
- ]
7716
- }
7717
- ],
7683
+ "members": [],
7718
7684
  "extendsTokenRange": {
7719
7685
  "startIndex": 1,
7720
7686
  "endIndex": 2