@gcorevideo/player 2.20.7 → 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 (218) hide show
  1. package/dist/core.js +54 -25
  2. package/dist/index.css +1184 -1184
  3. package/dist/index.js +298 -267
  4. package/dist/player.d.ts +178 -126
  5. package/dist/plugins/index.css +841 -841
  6. package/dist/plugins/index.js +192 -192
  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.errorscreen.bindevents.md → player.containerpluginconstructor.md} +7 -6
  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.hide.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.container.md → player.mediacontrol.currentseekpos.md} +3 -3
  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/BasePlayback.d.ts +5 -0
  89. package/lib/playback/BasePlayback.d.ts.map +1 -1
  90. package/lib/playback/BasePlayback.js +8 -0
  91. package/lib/playback/HTML5Video.d.ts +4 -0
  92. package/lib/playback/HTML5Video.d.ts.map +1 -0
  93. package/lib/playback/HTML5Video.js +3 -0
  94. package/lib/playback/dash-playback/DashPlayback.d.ts +1 -0
  95. package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
  96. package/lib/playback/dash-playback/DashPlayback.js +6 -2
  97. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  98. package/lib/playback/hls-playback/HlsPlayback.js +1 -1
  99. package/lib/playback/index.d.ts.map +1 -1
  100. package/lib/playback/index.js +2 -0
  101. package/lib/playback/types.d.ts +9 -0
  102. package/lib/playback/types.d.ts.map +1 -0
  103. package/lib/playback/types.js +9 -0
  104. package/lib/plugins/bottom-gear/BottomGear.d.ts +7 -12
  105. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  106. package/lib/plugins/bottom-gear/BottomGear.js +5 -14
  107. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +1 -1
  108. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +3 -3
  109. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -1
  110. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +8 -8
  111. package/lib/plugins/clappr-stats/ClapprStats.d.ts +4 -5
  112. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  113. package/lib/plugins/clappr-stats/ClapprStats.js +4 -3
  114. package/lib/plugins/clips/Clips.d.ts +3 -2
  115. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  116. package/lib/plugins/clips/Clips.js +1 -1
  117. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  118. package/lib/plugins/dvr-controls/DvrControls.d.ts +4 -3
  119. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  120. package/lib/plugins/dvr-controls/DvrControls.js +30 -18
  121. package/lib/plugins/error-screen/ErrorScreen.d.ts +12 -1
  122. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  123. package/lib/plugins/error-screen/ErrorScreen.js +1 -1
  124. package/lib/plugins/index.d.ts +0 -1
  125. package/lib/plugins/index.d.ts.map +1 -1
  126. package/lib/plugins/index.js +0 -1
  127. package/lib/plugins/kibo/index.d.ts +0 -3
  128. package/lib/plugins/kibo/index.d.ts.map +1 -1
  129. package/lib/plugins/kibo/index.js +0 -3
  130. package/lib/plugins/level-selector/LevelSelector.d.ts +8 -4
  131. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  132. package/lib/plugins/level-selector/LevelSelector.js +16 -7
  133. package/lib/plugins/media-control/MediaControl.d.ts +5 -4
  134. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  135. package/lib/plugins/media-control/MediaControl.js +8 -6
  136. package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -11
  137. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  138. package/lib/plugins/multi-camera/MultiCamera.js +1 -1
  139. package/lib/plugins/playback-rate/PlaybackRate.d.ts +11 -10
  140. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
  141. package/lib/plugins/playback-rate/PlaybackRate.js +83 -91
  142. package/lib/plugins/poster/Poster.js +2 -2
  143. package/lib/plugins/share/Share.d.ts +2 -1
  144. package/lib/plugins/share/Share.d.ts.map +1 -1
  145. package/lib/plugins/share/Share.js +2 -1
  146. package/lib/plugins/skip-time/SkipTime.d.ts +2 -1
  147. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
  148. package/lib/plugins/skip-time/SkipTime.js +2 -1
  149. package/lib/plugins/source-controller/SourceController.js +3 -3
  150. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +6 -3
  151. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  152. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +6 -3
  153. package/lib/plugins/telemetry/Telemetry.d.ts +2 -3
  154. package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
  155. package/lib/plugins/telemetry/Telemetry.js +1 -1
  156. package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
  157. package/lib/plugins/vast-ads/VastAds.js +3 -3
  158. package/lib/plugins/vast-ads/roll.d.ts +1 -1
  159. package/lib/plugins/vast-ads/roll.d.ts.map +1 -1
  160. package/lib/plugins/vast-ads/rollmanager.d.ts +1 -1
  161. package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -1
  162. package/lib/plugins/vast-ads/rollmanager.js +2 -2
  163. package/lib/types.d.ts +21 -5
  164. package/lib/types.d.ts.map +1 -1
  165. package/lib/utils/types.d.ts +0 -6
  166. package/lib/utils/types.d.ts.map +1 -1
  167. package/package.json +1 -1
  168. package/src/Player.ts +18 -16
  169. package/src/index.core.ts +0 -1
  170. package/src/index.plugins.ts +0 -1
  171. package/src/playback/BasePlayback.ts +12 -4
  172. package/src/playback/HTML5Video.ts +3 -0
  173. package/src/playback/dash-playback/DashPlayback.ts +15 -11
  174. package/src/playback/hls-playback/HlsPlayback.ts +7 -11
  175. package/src/playback/index.ts +2 -1
  176. package/src/playback/types.ts +9 -0
  177. package/src/plugins/audio-selector/AudioSelector.ts +1 -1
  178. package/src/plugins/big-mute-button/BigMuteButton.ts +1 -1
  179. package/src/plugins/bottom-gear/BottomGear.ts +7 -16
  180. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +5 -5
  181. package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +184 -187
  182. package/src/plugins/clappr-stats/ClapprStats.ts +5 -4
  183. package/src/plugins/clips/Clips.ts +4 -3
  184. package/src/plugins/context-menu/ContextMenu.ts +0 -2
  185. package/src/plugins/dvr-controls/DvrControls.ts +90 -56
  186. package/src/plugins/error-screen/ErrorScreen.ts +12 -1
  187. package/src/plugins/favicon/Favicon.ts +1 -1
  188. package/src/plugins/index.ts +0 -1
  189. package/src/plugins/kibo/index.ts +0 -3
  190. package/src/plugins/level-selector/LevelSelector.ts +24 -10
  191. package/src/plugins/logo/Logo.ts +1 -1
  192. package/src/plugins/media-control/MediaControl.ts +13 -10
  193. package/src/plugins/multi-camera/MultiCamera.ts +4 -4
  194. package/src/plugins/playback-rate/PlaybackRate.ts +90 -106
  195. package/src/plugins/poster/Poster.ts +3 -3
  196. package/src/plugins/seek-time/SeekTime.ts +1 -1
  197. package/src/plugins/share/Share.ts +2 -1
  198. package/src/plugins/skip-time/SkipTime.ts +2 -1
  199. package/src/plugins/source-controller/SourceController.ts +3 -3
  200. package/src/plugins/source-controller/__tests__/SourceController.test.ts +2 -2
  201. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +6 -3
  202. package/src/plugins/subtitles/Subtitles.ts +1 -1
  203. package/src/plugins/telemetry/Telemetry.ts +2 -2
  204. package/src/plugins/thumbnails/Thumbnails.ts +1 -1
  205. package/src/plugins/vast-ads/VastAds.ts +5 -4
  206. package/src/plugins/vast-ads/roll.ts +2 -1
  207. package/src/plugins/vast-ads/rollmanager.ts +3 -3
  208. package/src/types.ts +24 -5
  209. package/src/utils/types.ts +0 -8
  210. package/temp/player.api.json +540 -576
  211. package/tsconfig.tsbuildinfo +1 -1
  212. package/assets/playback-rate/playback-rate-selector.ejs +0 -9
  213. package/docs/api/player.clapprstats.onbitrate.md +0 -52
  214. package/docs/api/player.errorscreen.attributes.md +0 -17
  215. package/docs/api/player.errorscreen.name.md +0 -14
  216. package/docs/api/player.errorscreen.template.md +0 -14
  217. package/docs/api/player.multicamera.getcameraslist.md +0 -18
  218. package/docs/api/player.multicamera.getcurrentcamera.md +0 -18
@@ -1,13 +1,17 @@
1
- import { Core, Events, Playback, UICorePlugin, template } from '@clappr/core';
2
- import assert from 'assert';
1
+ import { Core, Events, Playback, UICorePlugin, template } from '@clappr/core'
2
+ import assert from 'assert'
3
3
 
4
- import { CLAPPR_VERSION } from '../../build.js';
4
+ import { CLAPPR_VERSION } from '../../build.js'
5
5
 
6
- import dvrHTML from '../../../assets/dvr-controls/index.ejs';
7
- import '../../../assets/dvr-controls/dvr_controls.scss';
6
+ import dvrHTML from '../../../assets/dvr-controls/index.ejs'
7
+ import '../../../assets/dvr-controls/dvr_controls.scss'
8
+ import { trace } from '@gcorevideo/utils'
9
+
10
+ const T = 'plugins.dvr_controls'
8
11
 
9
12
  /**
10
- * Adds the DVR controls to the media control UI
13
+ * PLUGIN that adds the DVR controls to the media control UI
14
+ *
11
15
  * @beta
12
16
  *
13
17
  * @remarks
@@ -15,23 +19,23 @@ import '../../../assets/dvr-controls/dvr_controls.scss';
15
19
  *
16
20
  * - {@link MediaControl}
17
21
  *
18
- * 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.
19
23
  */
20
24
  export class DvrControls extends UICorePlugin {
21
- private static readonly template = template(dvrHTML);
25
+ private static readonly template = template(dvrHTML)
22
26
 
23
27
  /**
24
28
  * @internal
25
29
  */
26
30
  get name() {
27
- return 'dvr_controls';
31
+ return 'dvr_controls'
28
32
  }
29
33
 
30
34
  /**
31
35
  * @internal
32
36
  */
33
37
  get supportedVersion() {
34
- return { min: CLAPPR_VERSION };
38
+ return { min: CLAPPR_VERSION }
35
39
  }
36
40
 
37
41
  /**
@@ -39,8 +43,8 @@ export class DvrControls extends UICorePlugin {
39
43
  */
40
44
  override get events() {
41
45
  return {
42
- 'click .live-button': 'click'
43
- };
46
+ 'click .live-button': 'click',
47
+ }
44
48
  }
45
49
 
46
50
  /**
@@ -48,96 +52,126 @@ export class DvrControls extends UICorePlugin {
48
52
  */
49
53
  override get attributes() {
50
54
  return {
51
- 'class': 'dvr-controls',
52
- 'data-dvr-controls': ''
53
- };
55
+ class: 'dvr-controls',
56
+ 'data-dvr-controls': '',
57
+ }
54
58
  }
55
59
 
56
60
  constructor(core: Core) {
57
- super(core);
58
- this.settingsUpdate();
61
+ super(core)
62
+ this.settingsUpdate()
59
63
  }
60
64
 
61
65
  /**
62
66
  * @internal
63
67
  */
64
68
  override bindEvents() {
65
- const mediaControl = this.core.getPlugin('media_control');
66
- assert(mediaControl, 'media_control plugin is required');
67
- this.listenTo(mediaControl, Events.MEDIACONTROL_RENDERED, this.settingsUpdate);
68
- this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.render);
69
- this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.bindContainerEvents);
69
+ const mediaControl = this.core.getPlugin('media_control')
70
+ assert(mediaControl, 'media_control plugin is required')
71
+ this.listenTo(
72
+ mediaControl,
73
+ Events.MEDIACONTROL_RENDERED,
74
+ this.settingsUpdate,
75
+ )
76
+ this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.render)
77
+ this.listenTo(
78
+ this.core,
79
+ Events.CORE_ACTIVE_CONTAINER_CHANGED,
80
+ this.bindContainerEvents,
81
+ )
70
82
  }
71
83
 
72
84
  private bindContainerEvents() {
73
- this.listenToOnce(this.core.activeContainer, Events.CONTAINER_TIMEUPDATE, this.render);
74
- this.listenTo(this.core.activeContainer, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
85
+ this.listenToOnce(
86
+ this.core.activeContainer,
87
+ Events.CONTAINER_TIMEUPDATE,
88
+ this.render,
89
+ )
90
+ this.listenTo(
91
+ this.core.activeContainer,
92
+ Events.CONTAINER_PLAYBACKDVRSTATECHANGED,
93
+ this.onDvrChanged,
94
+ )
75
95
  }
76
96
 
77
- private dvrChanged(dvrEnabled: boolean) {
97
+ private onDvrChanged(dvrEnabled: boolean) {
98
+ trace(`${T} onDvrChanged`, {
99
+ dvrEnabled,
100
+ })
78
101
  if (this.core.getPlaybackType() !== Playback.LIVE) {
79
- return;
102
+ return
80
103
  }
81
- this.settingsUpdate();
82
- this.core.mediaControl.$el.addClass('live');
104
+ this.settingsUpdate()
105
+ this.core.mediaControl.$el.addClass('live')
83
106
  if (dvrEnabled) {
84
- this.core.mediaControl.$playbackRate.removeClass('playbackrate-enable');
107
+ // TODO
85
108
  this.core.mediaControl.$el
86
109
  .addClass('dvr')
87
- .find('.media-control-indicator[data-position], .media-control-indicator[data-duration]')
88
- .hide();
110
+ .find(
111
+ '.media-control-indicator[data-position], .media-control-indicator[data-duration]',
112
+ )
113
+ .hide()
89
114
  } else {
90
- this.core.mediaControl.$playbackRate.addClass('playbackrate-enable');
91
- this.core.mediaControl.$el.removeClass('dvr');
115
+ this.core.mediaControl.$el.removeClass('dvr')
92
116
  }
93
117
  }
94
118
 
95
119
  private click() {
96
- const mediaControl = this.core.getPlugin('media_control');
97
- const container = this.core.activeContainer;
120
+ const mediaControl = this.core.getPlugin('media_control')
121
+ const container = this.core.activeContainer
98
122
 
99
123
  if (!container.isPlaying()) {
100
- container.play();
124
+ container.play()
101
125
  }
102
126
 
103
127
  if (mediaControl.$el.hasClass('dvr')) {
104
- container.seek(container.getDuration());
128
+ container.seek(container.getDuration())
105
129
  }
106
130
  }
107
131
 
108
132
  private settingsUpdate() {
109
133
  // @ts-ignore
110
- this.stopListening(); // TODO sort out
111
- this.core.getPlugin('media_control').$el.removeClass('live'); // TODO don't access directly
134
+ this.stopListening() // TODO sort out
135
+ this.core.getPlugin('media_control').$el.removeClass('live') // TODO don't access directly
112
136
  if (this.shouldRender()) {
113
- this.render();
114
- this.$el.click(() => this.click());
137
+ this.render()
138
+ this.$el.click(() => this.click())
115
139
  }
116
- this.bindEvents();
140
+ this.bindEvents()
117
141
  }
118
142
 
119
143
  private shouldRender() {
120
- const useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls;
144
+ const useDvrControls =
145
+ this.core.options.useDvrControls === undefined ||
146
+ !!this.core.options.useDvrControls
121
147
 
122
- return useDvrControls && this.core.getPlaybackType() === Playback.LIVE;
148
+ return useDvrControls && this.core.getPlaybackType() === Playback.LIVE
123
149
  }
124
150
 
125
151
  /**
126
152
  * @internal
127
153
  */
128
154
  override render() {
129
- this.$el.html(DvrControls.template({
130
- live: this.core.i18n.t('live'),
131
- backToLive: this.core.i18n.t('back_to_live')
132
- }));
133
- if (this.shouldRender()) {
134
- const mediaControl = this.core.getPlugin('media_control');
135
- assert(mediaControl, 'media_control plugin is required');
136
- // TODO don't tap into the $el directly
137
- mediaControl.$el.addClass('live');
138
- mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);
155
+ trace(`${T} render`, {
156
+ dvrEnabled: this.core.activePlayback?.dvrEnabled,
157
+ })
158
+ if (!this.shouldRender()) {
159
+ return this
139
160
  }
140
-
141
- return this;
161
+ this.$el.html(
162
+ DvrControls.template({
163
+ live: this.core.i18n.t('live'),
164
+ backToLive: this.core.i18n.t('back_to_live'),
165
+ }),
166
+ )
167
+ const mediaControl = this.core.getPlugin('media_control')
168
+ assert(mediaControl, 'media_control plugin is required')
169
+ // TODO don't tap into the $el directly
170
+ mediaControl.$el.addClass('live')
171
+ mediaControl
172
+ .$('.media-control-left-panel[data-media-control]')
173
+ .append(this.$el)
174
+
175
+ return this
142
176
  }
143
177
  }
@@ -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
 
@@ -15,11 +15,15 @@ import arrowRightIcon from '../../../assets/icons/new/arrow-right.svg'
15
15
  import arrowLeftIcon from '../../../assets/icons/new/arrow-left.svg'
16
16
  import checkIcon from '../../../assets/icons/new/check.svg'
17
17
  import '../../../assets/level-selector/style.scss'
18
- import { MediaControl } from '../media-control/MediaControl.js'
18
+ import { MediaControl, MediaControlEvents } from '../media-control/MediaControl.js'
19
19
 
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
  *
@@ -125,8 +127,7 @@ export class LevelSelector extends UICorePlugin {
125
127
  * @internal
126
128
  */
127
129
  override bindEvents() {
128
- const mediaControl = this.core.getPlugin('media_control') as MediaControl
129
- assert(mediaControl, 'media_control plugin is required')
130
+ this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
130
131
  this.listenTo(
131
132
  this.core,
132
133
  Events.CORE_ACTIVE_CONTAINER_CHANGED,
@@ -134,6 +135,18 @@ export class LevelSelector extends UICorePlugin {
134
135
  )
135
136
  }
136
137
 
138
+ private onCoreReady() {
139
+ trace(`${T} onCoreReady`);
140
+ const mediaControl = this.core.getPlugin('media_control') as MediaControl
141
+ assert(mediaControl, 'media_control plugin is required')
142
+ this.listenTo(mediaControl, MediaControlEvents.MEDIACONTROL_GEAR_RENDERED, this.onGearRendered);
143
+ }
144
+
145
+ private onGearRendered() {
146
+ trace(`${T} onGearRendered`);
147
+ this.deferRender();
148
+ }
149
+
137
150
  private bindPlaybackEvents() {
138
151
  this.removeAuto = false
139
152
  this.isHd = false
@@ -301,8 +314,9 @@ export class LevelSelector extends UICorePlugin {
301
314
  private goBack() {
302
315
  trace(`${T} goBack`)
303
316
  this.isOpen = false
304
- this.core.trigger('gear:refresh')
305
- this.deferRender()
317
+ setTimeout(() => {
318
+ this.core.getPlugin('bottom_gear').refresh()
319
+ }, 0);
306
320
  }
307
321
 
308
322
  private setLevel(index: number) {
@@ -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.
@@ -107,7 +107,7 @@ export class MediaControl extends UICorePlugin {
107
107
 
108
108
  private currentDurationValue: number = 0
109
109
  private currentPositionValue: number = 0
110
- private currentSeekBarPercentage: number | null = null
110
+ private currentSeekBarPercentage = 0
111
111
 
112
112
  private disabledClickableList: DisabledClickable[] = []
113
113
  private displayedDuration: string | null = null
@@ -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
@@ -275,6 +275,10 @@ export class MediaControl extends UICorePlugin {
275
275
  }
276
276
  }
277
277
 
278
+ get currentSeekPos() {
279
+ return this.currentSeekBarPercentage
280
+ }
281
+
278
282
  /**
279
283
  * Current volume [0..100]
280
284
  */
@@ -746,11 +750,10 @@ export class MediaControl extends UICorePlugin {
746
750
  this.changeTogglePlay()
747
751
  this.bindContainerEvents()
748
752
  this.settingsUpdate()
749
- this.core.activeContainer &&
750
- this.core.activeContainer.trigger(
751
- Events.CONTAINER_PLAYBACKDVRSTATECHANGED,
752
- this.core.activeContainer.isDvrInUse(),
753
- )
753
+ this.core.activeContainer.trigger(
754
+ Events.CONTAINER_PLAYBACKDVRSTATECHANGED,
755
+ this.core.activeContainer.isDvrInUse(),
756
+ )
754
757
  // TODO test
755
758
  if (this.core.activeContainer.mediaControlDisabled) {
756
759
  this.disable()
@@ -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