@gcorevideo/player 2.19.14 → 2.20.1

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 (196) hide show
  1. package/assets/level-selector/list.ejs +2 -2
  2. package/dist/core.js +2 -2
  3. package/dist/index.css +780 -780
  4. package/dist/index.js +1720 -1473
  5. package/dist/player.d.ts +425 -94
  6. package/dist/plugins/index.css +1466 -1466
  7. package/dist/plugins/index.js +1501 -1252
  8. package/docs/api/player.bottomgear.getelement.md +56 -0
  9. package/docs/api/player.bottomgear.md +51 -0
  10. package/docs/api/player.bottomgear.setcontent.md +56 -0
  11. package/docs/api/player.clapprnerdstats.md +12 -259
  12. package/docs/api/player.dvrcontrols.md +5 -1
  13. package/docs/api/player.errorscreen.attributes.md +3 -0
  14. package/docs/api/player.errorscreen.bindevents.md +3 -0
  15. package/docs/api/player.errorscreen.container.md +3 -0
  16. package/docs/api/player.errorscreen.hide.md +3 -0
  17. package/docs/api/player.errorscreen.md +27 -0
  18. package/docs/api/player.errorscreen.name.md +3 -0
  19. package/docs/api/player.errorscreen.render.md +3 -0
  20. package/docs/api/player.errorscreen.show.md +3 -0
  21. package/docs/api/player.errorscreen.supportedversion.md +3 -0
  22. package/docs/api/player.errorscreen.template.md +3 -0
  23. package/docs/api/player.errorscreen.unbindevents.md +3 -0
  24. package/docs/api/player.gearevents.md +49 -0
  25. package/docs/api/{player.sourcecontroller.name.md → player.gearitemelement.md} +5 -3
  26. package/docs/api/{player.playbackrate.template.md → player.initeventdata.event.md} +3 -3
  27. package/docs/api/{player.playbackrate.updateplaybackrate.md → player.initeventdata.md} +15 -11
  28. package/docs/api/player.levelselector.md +9 -1
  29. package/docs/api/player.md +124 -4
  30. package/docs/api/{player.clapprnerdstats.render.md → player.mediacontrol.getrightpanel.md} +8 -4
  31. package/docs/api/player.mediacontrol.md +14 -0
  32. package/docs/api/player.mediacontrolelement.md +1 -1
  33. package/docs/api/player.pictureinpicture.md +9 -197
  34. package/docs/api/player.playbackrate.md +10 -314
  35. package/docs/api/player.sourcecontroller.md +0 -90
  36. package/docs/api/player.spinnerevents.md +49 -0
  37. package/docs/api/player.spinnerthreebounce._constructor_.md +3 -0
  38. package/docs/api/player.spinnerthreebounce.hide.md +5 -0
  39. package/docs/api/player.spinnerthreebounce.md +14 -95
  40. package/docs/api/player.spinnerthreebounce.show.md +6 -37
  41. package/docs/api/{player.playbackrate.onplay.md → player.stalleventdata.count.md} +5 -7
  42. package/docs/api/{player.playbackrate.name.md → player.stalleventdata.event.md} +3 -3
  43. package/docs/api/player.stalleventdata.md +112 -0
  44. package/docs/api/player.stalleventdata.time.md +13 -0
  45. package/docs/api/player.stalleventdata.total_ms.md +13 -0
  46. package/docs/api/{player.pluginsettings.md → player.starteventdata.event.md} +3 -5
  47. package/docs/api/{player.playbackrate.onrateselect.md → player.starteventdata.md} +15 -11
  48. package/docs/api/player.subtitles.hide.md +5 -0
  49. package/docs/api/player.subtitles.md +23 -275
  50. package/docs/api/player.subtitles.show.md +5 -0
  51. package/docs/api/{player.statistics._constructor_.md → player.telemetry._constructor_.md} +6 -3
  52. package/docs/api/player.telemetry.md +146 -0
  53. package/docs/api/{player.volumefade.name.md → player.telemetry.name.md} +4 -2
  54. package/docs/api/{player.sourcecontroller.supportedversion.md → player.telemetry.supportedversion.md} +4 -2
  55. package/docs/api/player.telemetryevent.md +89 -0
  56. package/docs/api/player.telemetryeventdata.md +15 -0
  57. package/docs/api/player.telemetrypluginsettings.md +57 -0
  58. package/docs/api/player.telemetrypluginsettings.send.md +13 -0
  59. package/docs/api/player.telemetryrecord.md +17 -0
  60. package/docs/api/player.volumefade.md +0 -93
  61. package/docs/api/{player.pictureinpicture.name.md → player.watcheventdata.event.md} +3 -3
  62. package/docs/api/{player.playbackrate.setselectedrate.md → player.watcheventdata.md} +15 -11
  63. package/lib/index.plugins.d.ts +2 -2
  64. package/lib/index.plugins.d.ts.map +1 -1
  65. package/lib/index.plugins.js +2 -2
  66. package/lib/playback/hls-playback/HlsPlayback.js +1 -1
  67. package/lib/plugins/bottom-gear/BottomGear.d.ts +20 -1
  68. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  69. package/lib/plugins/bottom-gear/BottomGear.js +28 -7
  70. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +38 -5
  71. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
  72. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +67 -21
  73. package/lib/plugins/dvr-controls/DvrControls.d.ts +5 -2
  74. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  75. package/lib/plugins/dvr-controls/DvrControls.js +5 -2
  76. package/lib/plugins/error-screen/ErrorScreen.d.ts +5 -0
  77. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  78. package/lib/plugins/error-screen/ErrorScreen.js +5 -0
  79. package/lib/plugins/index.d.ts +2 -3
  80. package/lib/plugins/index.d.ts.map +1 -1
  81. package/lib/plugins/index.js +2 -3
  82. package/lib/plugins/level-selector/LevelSelector.d.ts +10 -3
  83. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  84. package/lib/plugins/level-selector/LevelSelector.js +20 -19
  85. package/lib/plugins/media-control/MediaControl.d.ts +6 -2
  86. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  87. package/lib/plugins/media-control/MediaControl.js +40 -39
  88. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +32 -4
  89. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
  90. package/lib/plugins/picture-in-picture/PictureInPicture.js +30 -2
  91. package/lib/plugins/playback-rate/PlaybackRate.d.ts +47 -14
  92. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
  93. package/lib/plugins/playback-rate/PlaybackRate.js +38 -9
  94. package/lib/plugins/source-controller/SourceController.d.ts +9 -0
  95. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  96. package/lib/plugins/source-controller/SourceController.js +11 -1
  97. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +35 -1
  98. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  99. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +46 -23
  100. package/lib/plugins/statistics/Statistics.d.ts +38 -3
  101. package/lib/plugins/statistics/Statistics.d.ts.map +1 -1
  102. package/lib/plugins/statistics/Statistics.js +51 -9
  103. package/lib/plugins/subtitles/Subtitles.d.ts +65 -16
  104. package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -1
  105. package/lib/plugins/subtitles/Subtitles.js +131 -109
  106. package/lib/plugins/telemetry/Telemetry.d.ts +135 -0
  107. package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -0
  108. package/lib/plugins/telemetry/Telemetry.js +180 -0
  109. package/lib/plugins/volume-fade/VolumeFade.d.ts +7 -1
  110. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  111. package/lib/plugins/volume-fade/VolumeFade.js +8 -1
  112. package/package.json +1 -1
  113. package/src/index.plugins.ts +2 -2
  114. package/src/playback/hls-playback/HlsPlayback.ts +1 -1
  115. package/src/plugins/bottom-gear/BottomGear.ts +26 -4
  116. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +240 -173
  117. package/src/plugins/dvr-controls/DvrControls.ts +5 -2
  118. package/src/plugins/error-screen/ErrorScreen.ts +5 -0
  119. package/src/plugins/index.ts +2 -3
  120. package/src/plugins/level-selector/LevelSelector.ts +22 -19
  121. package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +47 -26
  122. package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +18 -18
  123. package/src/plugins/media-control/MediaControl.ts +43 -41
  124. package/src/plugins/picture-in-picture/PictureInPicture.ts +35 -7
  125. package/src/plugins/playback-rate/PlaybackRate.ts +53 -24
  126. package/src/plugins/source-controller/SourceController.ts +11 -1
  127. package/src/plugins/source-controller/__tests__/SourceController.test.ts +1 -1
  128. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +46 -22
  129. package/src/plugins/subtitles/Subtitles.ts +146 -155
  130. package/src/plugins/telemetry/Telemetry.ts +299 -0
  131. package/src/plugins/volume-fade/VolumeFade.ts +9 -2
  132. package/temp/player.api.json +3384 -4872
  133. package/tsconfig.tsbuildinfo +1 -1
  134. package/docs/api/player.clapprnerdstats.attributes.md +0 -17
  135. package/docs/api/player.clapprnerdstats.bindevents.md +0 -18
  136. package/docs/api/player.clapprnerdstats.events.md +0 -18
  137. package/docs/api/player.clapprnerdstats.name.md +0 -14
  138. package/docs/api/player.clapprnerdstats.playerheight.md +0 -14
  139. package/docs/api/player.clapprnerdstats.playerwidth.md +0 -14
  140. package/docs/api/player.clapprnerdstats.statsboxelem.md +0 -14
  141. package/docs/api/player.clapprnerdstats.statsboxwidththreshold.md +0 -14
  142. package/docs/api/player.clapprnerdstats.supportedversion.md +0 -16
  143. package/docs/api/player.clapprnerdstats.template.md +0 -14
  144. package/docs/api/player.pictureinpicture.bindevents.md +0 -15
  145. package/docs/api/player.pictureinpicture.events.md +0 -13
  146. package/docs/api/player.pictureinpicture.exitpictureinpicture.md +0 -15
  147. package/docs/api/player.pictureinpicture.render.md +0 -15
  148. package/docs/api/player.pictureinpicture.requestpictureinpicture.md +0 -15
  149. package/docs/api/player.pictureinpicture.supportedversion.md +0 -13
  150. package/docs/api/player.pictureinpicture.togglepictureinpicture.md +0 -15
  151. package/docs/api/player.pictureinpicture.version.md +0 -11
  152. package/docs/api/player.pictureinpicture.videoelement.md +0 -11
  153. package/docs/api/player.playbackrate.attributes.md +0 -14
  154. package/docs/api/player.playbackrate.bindevents.md +0 -15
  155. package/docs/api/player.playbackrate.events.md +0 -15
  156. package/docs/api/player.playbackrate.gettitle.md +0 -15
  157. package/docs/api/player.playbackrate.goback.md +0 -15
  158. package/docs/api/player.playbackrate.highlightcurrentrate.md +0 -15
  159. package/docs/api/player.playbackrate.onfinishad.md +0 -15
  160. package/docs/api/player.playbackrate.onshowmenu.md +0 -15
  161. package/docs/api/player.playbackrate.onstartad.md +0 -15
  162. package/docs/api/player.playbackrate.onstop.md +0 -15
  163. package/docs/api/player.playbackrate.reload.md +0 -15
  164. package/docs/api/player.playbackrate.render.md +0 -15
  165. package/docs/api/player.playbackrate.supportedversion.md +0 -13
  166. package/docs/api/player.playbackrate.unbindevents.md +0 -15
  167. package/docs/api/player.sourcecontroller.version.md +0 -14
  168. package/docs/api/player.spinnerthreebounce.attributes.md +0 -14
  169. package/docs/api/player.spinnerthreebounce.name.md +0 -11
  170. package/docs/api/player.spinnerthreebounce.render.md +0 -15
  171. package/docs/api/player.spinnerthreebounce.supportedversion.md +0 -13
  172. package/docs/api/player.statistics.bindevents.md +0 -15
  173. package/docs/api/player.statistics.md +0 -141
  174. package/docs/api/player.statistics.name.md +0 -11
  175. package/docs/api/player.statistics.supportedversion.md +0 -13
  176. package/docs/api/player.subtitles.attributes.md +0 -14
  177. package/docs/api/player.subtitles.bindevents.md +0 -15
  178. package/docs/api/player.subtitles.buttonelement.md +0 -15
  179. package/docs/api/player.subtitles.events.md +0 -14
  180. package/docs/api/player.subtitles.levelelement.md +0 -51
  181. package/docs/api/player.subtitles.name.md +0 -11
  182. package/docs/api/player.subtitles.preselectedlanguage.md +0 -11
  183. package/docs/api/player.subtitles.reload.md +0 -15
  184. package/docs/api/player.subtitles.render.md +0 -15
  185. package/docs/api/player.subtitles.selectsubtitles.md +0 -15
  186. package/docs/api/player.subtitles.startlevelswitch.md +0 -15
  187. package/docs/api/player.subtitles.stoplevelswitch.md +0 -15
  188. package/docs/api/player.subtitles.supportedversion.md +0 -13
  189. package/docs/api/player.subtitles.template.md +0 -11
  190. package/docs/api/player.subtitles.templatestring.md +0 -11
  191. package/docs/api/player.subtitles.unbindevents.md +0 -15
  192. package/docs/api/player.subtitles.version.md +0 -11
  193. package/docs/api/player.volumefade.bindevents.md +0 -18
  194. package/docs/api/player.volumefade.unbindevents.md +0 -18
  195. package/src/plugins/statistics/Statistics.ts +0 -207
  196. /package/src/plugins/{statistics → telemetry}/Statistics copy.xts +0 -0
package/dist/player.d.ts CHANGED
@@ -121,6 +121,10 @@ declare type BitrateTrackRecord = {
121
121
  * @beta
122
122
  * @remarks
123
123
  * The plugins provides a base for attaching custom settings UI in the gear menu
124
+ *
125
+ * Depends on:
126
+ *
127
+ * - {@link MediaControl | media_control}
124
128
  */
125
129
  export declare class BottomGear extends UICorePlugin {
126
130
  private isHd;
@@ -156,6 +160,16 @@ export declare class BottomGear extends UICorePlugin {
156
160
  * @internal
157
161
  */
158
162
  bindEvents(): void;
163
+ /**
164
+ * @param name - Name of a gear menu placeholder item to attach custom UI
165
+ * @returns Zepto result of the element
166
+ */
167
+ getElement(name: GearItemElement): ZeptoResult | null;
168
+ /**
169
+ * Replaces the content of the gear menu
170
+ * @param content - Zepto result of the element
171
+ */
172
+ setContent(content: ZeptoResult): void;
159
173
  private onActiveContainerChanged;
160
174
  private bindContainerEvents;
161
175
  private highDefinitionUpdate;
@@ -169,7 +183,22 @@ export declare class BottomGear extends UICorePlugin {
169
183
  }
170
184
 
171
185
  /**
186
+ * Displays useful network-related statistics.
172
187
  * @beta
188
+ *
189
+ * @remarks
190
+ * Depends on:
191
+ *
192
+ * - {@link MediaControl}
193
+ *
194
+ * - {@link BottomGear}
195
+ *
196
+ * - {@link ClapprStats}
197
+ *
198
+ * The plugin is rendered as an item in the gear menu.
199
+ *
200
+ * When clicked, it shows an overlay window with the information about the network speed, latency, etc,
201
+ * and recommended quality level.
173
202
  */
174
203
  export declare class ClapprNerdStats extends UICorePlugin {
175
204
  private container;
@@ -178,28 +207,43 @@ export declare class ClapprNerdStats extends UICorePlugin {
178
207
  private showing;
179
208
  private shortcut;
180
209
  private iconPosition;
210
+ /**
211
+ * @internal
212
+ */
181
213
  get name(): string;
214
+ /**
215
+ * @internal
216
+ */
182
217
  get supportedVersion(): {
183
218
  min: string;
184
219
  };
185
- get template(): any;
220
+ private static readonly template;
221
+ /**
222
+ * @internal
223
+ */
186
224
  get attributes(): {
187
225
  'data-clappr-nerd-stats': string;
188
226
  class: string;
189
227
  };
228
+ /**
229
+ * @internal
230
+ */
190
231
  get events(): {
191
232
  'click [data-show-stats-button]': string;
192
233
  'click [data-close-button]': string;
193
234
  'click [data-refresh-button]': string;
194
235
  };
195
- get statsBoxElem(): string;
196
- get statsBoxWidthThreshold(): number;
197
- get playerWidth(): any;
198
- get playerHeight(): any;
236
+ private get statsBoxElem();
237
+ private get statsBoxWidthThreshold();
238
+ private get playerWidth();
239
+ private get playerHeight();
199
240
  constructor(core: Core);
241
+ /**
242
+ * @internal
243
+ */
200
244
  bindEvents(): void;
201
245
  private init;
202
- private showOrHide;
246
+ private toggle;
203
247
  private show;
204
248
  private hide;
205
249
  private onPlayerResize;
@@ -207,6 +251,9 @@ export declare class ClapprNerdStats extends UICorePlugin {
207
251
  private addCustomMetrics;
208
252
  private updateMetrics;
209
253
  private setStatsBoxSize;
254
+ /**
255
+ * @internal
256
+ */
210
257
  render(): this;
211
258
  private addToBottomGear;
212
259
  private clearCustomMetrics;
@@ -377,8 +424,11 @@ export declare class DisableControls extends UICorePlugin {
377
424
  * @beta
378
425
  *
379
426
  * @remarks
380
- * The plugin is rendered in the {@link MediaControl | media control} UI.
381
- * It renders the live stream indicator and the DVR seek bar if DVR is enabled.
427
+ * Depends on:
428
+ *
429
+ * - {@link MediaControl | media_control}
430
+ *
431
+ * The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
382
432
  */
383
433
  export declare class DvrControls extends UICorePlugin {
384
434
  private static readonly template;
@@ -429,6 +479,11 @@ export declare class DvrControls extends UICorePlugin {
429
479
  */
430
480
  export declare type ErrorLevel = 'FATAL' | 'WARN' | 'INFO';
431
481
 
482
+ /**
483
+ * Displays a descriptive error in the overlay on top of the player.
484
+ * @beta
485
+ * TODO
486
+ */
432
487
  export declare class ErrorScreen extends UICorePlugin {
433
488
  private _retry;
434
489
  private err;
@@ -486,6 +541,22 @@ export declare class Favicon extends CorePlugin {
486
541
  private changeIcon;
487
542
  }
488
543
 
544
+ /**
545
+ * Custom events emitted by the plugin
546
+ */
547
+ export declare enum GearEvents {
548
+ /**
549
+ * Emitted when the gear menu is rendered
550
+ */
551
+ MEDIACONTROL_GEAR_RENDERED = "mediacontrol:gear:rendered"
552
+ }
553
+
554
+ /**
555
+ * An element inside the gear menu
556
+ * @beta
557
+ */
558
+ export declare type GearItemElement = 'quality' | 'rate' | 'nerd';
559
+
489
560
  export declare class GoogleAnalytics extends ContainerPlugin {
490
561
  private account;
491
562
  private trackerName;
@@ -515,6 +586,10 @@ export declare class GoogleAnalytics extends ContainerPlugin {
515
586
  push(array: string[]): void;
516
587
  }
517
588
 
589
+ export declare interface InitEventData {
590
+ event: TelemetryEvent.Init;
591
+ }
592
+
518
593
  declare type KeyboardEventHandler = (e: KeyboardEvent) => boolean | undefined;
519
594
 
520
595
  /**
@@ -552,7 +627,14 @@ export declare type LangTag = string;
552
627
  * @beta
553
628
  *
554
629
  * @remarks
555
- * The plugin is rendered as a button in the {@link BottomGear | gear menu}.
630
+ * Depends on:
631
+ *
632
+ * - {@link MediaControl}
633
+ *
634
+ * - {@link BottomGear}
635
+ *
636
+ * The plugin is rendered as an item in the gear menu.
637
+ *
556
638
  * When clicked, it shows a list of quality levels to choose from.
557
639
  *
558
640
  * Configuration options:
@@ -577,8 +659,8 @@ export declare class LevelSelector extends UICorePlugin {
577
659
  private removeAuto;
578
660
  private isHd;
579
661
  private isOpen;
580
- private buttonTemplate;
581
- private listTemplate;
662
+ private static readonly buttonTemplate;
663
+ private static readonly listTemplate;
582
664
  /**
583
665
  * @internal
584
666
  */
@@ -869,7 +951,6 @@ export declare class MediaControl extends UICorePlugin {
869
951
  private hide;
870
952
  private updateCursorStyle;
871
953
  private settingsUpdate;
872
- private getSettings;
873
954
  private highDefinitionUpdate;
874
955
  private createCachedElements;
875
956
  /**
@@ -891,6 +972,11 @@ export declare class MediaControl extends UICorePlugin {
891
972
  * ```
892
973
  */
893
974
  getElement(name: MediaControlElement): ZeptoResult | null;
975
+ /**
976
+ * Get the right panel area to append custom elements to
977
+ * @returns ZeptoSelector of the right panel element
978
+ */
979
+ getRightPanel(): any;
894
980
  private resetIndicators;
895
981
  private initializeIcons;
896
982
  private setSeekPercentage;
@@ -930,7 +1016,7 @@ export declare class MediaControl extends UICorePlugin {
930
1016
  * Media control elements, mount points for additional plugins
931
1017
  * @beta
932
1018
  */
933
- export declare type MediaControlElement = 'bottomGear' | 'clipText' | 'pip' | 'playbackRate' | 'seekBarContainer';
1019
+ export declare type MediaControlElement = 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer' | 'subtitlesSelector';
934
1020
 
935
1021
  declare type MediaSourceInfo = {
936
1022
  live: boolean;
@@ -1036,22 +1122,50 @@ export declare class MultiCamera extends UICorePlugin {
1036
1122
  private highlightCurrentLevel;
1037
1123
  }
1038
1124
 
1125
+ /**
1126
+ * Enables picture in picture mode.
1127
+ * @beta
1128
+ * @remarks
1129
+ * Depends on:
1130
+ *
1131
+ * - {@link MediaControl}
1132
+ *
1133
+ * It renders a button to toggle picture in picture mode in the media control UI.
1134
+ */
1039
1135
  export declare class PictureInPicture extends UICorePlugin {
1136
+ /**
1137
+ * @internal
1138
+ */
1040
1139
  get name(): string;
1140
+ /**
1141
+ * @internal
1142
+ */
1041
1143
  get supportedVersion(): {
1042
1144
  min: string;
1043
1145
  };
1146
+ /**
1147
+ * @internal
1148
+ */
1044
1149
  static get version(): string;
1150
+ /**
1151
+ * @internal
1152
+ */
1045
1153
  get events(): {
1046
1154
  'click button': string;
1047
1155
  };
1048
- get videoElement(): any;
1156
+ private get videoElement();
1157
+ /**
1158
+ * @internal
1159
+ */
1049
1160
  bindEvents(): void;
1050
1161
  private isPiPSupported;
1162
+ /**
1163
+ * @internal
1164
+ */
1051
1165
  render(): this;
1052
- togglePictureInPicture(): void;
1053
- requestPictureInPicture(): void;
1054
- exitPictureInPicture(): void;
1166
+ private togglePictureInPicture;
1167
+ private requestPictureInPicture;
1168
+ private exitPictureInPicture;
1055
1169
  }
1056
1170
 
1057
1171
  /**
@@ -1114,45 +1228,78 @@ export declare enum PlaybackErrorCode {
1114
1228
  */
1115
1229
  export declare type PlaybackModule = 'dash' | 'hls' | 'html5_video';
1116
1230
 
1231
+ /**
1232
+ * Allows changing the playback speed of the video.
1233
+ * @beta
1234
+ *
1235
+ * @remarks
1236
+ * Depends on:
1237
+ *
1238
+ * - {@link MediaControl | media_control}
1239
+ *
1240
+ * - {@link BottomGear | bottom_gear}
1241
+ *
1242
+ * It renders a button in the gear menu, which opens a dropdown with the available playback rates.
1243
+ */
1117
1244
  export declare class PlaybackRate extends UICorePlugin {
1118
1245
  private currentPlayback;
1119
1246
  private playbackRates;
1120
1247
  private prevSelectedRate;
1121
1248
  private selectedRate;
1249
+ /**
1250
+ * @internal
1251
+ */
1122
1252
  get name(): string;
1253
+ /**
1254
+ * @internal
1255
+ */
1123
1256
  get supportedVersion(): {
1124
1257
  min: string;
1125
1258
  };
1126
- get template(): any;
1259
+ private static readonly template;
1260
+ private static readonly buttonTemplate;
1261
+ private static readonly listTemplate;
1262
+ /**
1263
+ * @internal
1264
+ */
1127
1265
  get attributes(): {
1128
1266
  class: string;
1129
1267
  'data-playback-rate-select': string;
1130
1268
  };
1269
+ /**
1270
+ * @internal
1271
+ */
1131
1272
  get events(): {
1132
1273
  'click .gear-sub-menu_btn': string;
1133
1274
  'click .gear-option': string;
1134
1275
  'click .go-back': string;
1135
1276
  };
1277
+ /**
1278
+ * @internal
1279
+ */
1136
1280
  bindEvents(): void;
1137
- unBindEvents(): void;
1281
+ private unBindEvents;
1138
1282
  private allRateElements;
1139
1283
  private rateElement;
1140
1284
  private onDashRateChange;
1141
1285
  private updateLiveStatus;
1142
- reload(): void;
1286
+ private reload;
1143
1287
  private shouldRender;
1288
+ /**
1289
+ * @internal
1290
+ */
1144
1291
  render(): this;
1145
- onStartAd(): void;
1146
- onFinishAd(): void;
1147
- onPlay(): void;
1148
- onStop(): void;
1149
- onRateSelect(event: MouseEvent): boolean;
1150
- onShowMenu(): void;
1151
- goBack(): void;
1152
- updatePlaybackRate(rate: string): void;
1153
- setSelectedRate(rate: string): void;
1154
- getTitle(): string;
1155
- highlightCurrentRate(): void;
1292
+ private onStartAd;
1293
+ private onFinishAd;
1294
+ private onPlay;
1295
+ private onStop;
1296
+ private onRateSelect;
1297
+ private onShowMenu;
1298
+ private goBack;
1299
+ private updatePlaybackRate;
1300
+ private setSelectedRate;
1301
+ private getTitle;
1302
+ private highlightCurrentRate;
1156
1303
  }
1157
1304
 
1158
1305
  /**
@@ -1566,15 +1713,6 @@ export declare type PlayerPlugin = {
1566
1713
  name: string;
1567
1714
  };
1568
1715
 
1569
- export declare type PluginSettings = {
1570
- /**
1571
- * Sends the statistics record to the storage.
1572
- * The actual delivery is presumably async and batched.
1573
- * @param data - The statistics record to send.
1574
- */
1575
- send: (data: StatisticsRecord) => void;
1576
- };
1577
-
1578
1716
  /**
1579
1717
  * Displays a poster image in the background and a big play button on top when playback is stopped
1580
1718
  * @beta
@@ -1827,7 +1965,13 @@ export declare class SourceController extends CorePlugin {
1827
1965
  private sourcesDelay;
1828
1966
  private active;
1829
1967
  private sync;
1968
+ /**
1969
+ * @internal
1970
+ */
1830
1971
  get name(): string;
1972
+ /**
1973
+ * @internal
1974
+ */
1831
1975
  get supportedVersion(): {
1832
1976
  min: string;
1833
1977
  };
@@ -1841,14 +1985,43 @@ export declare class SourceController extends CorePlugin {
1841
1985
  private reset;
1842
1986
  private retryPlayback;
1843
1987
  private getNextMediaSource;
1988
+ /**
1989
+ * @internal
1990
+ */
1844
1991
  static get version(): string;
1845
1992
  }
1846
1993
 
1994
+ /**
1995
+ * Custom events emitted by the plugin
1996
+ */
1997
+ export declare enum SpinnerEvents {
1998
+ /**
1999
+ * Emitted at the end of the spinner animation cycle to facilitate smooth UI updates,
2000
+ * e.g. {@link SourceController} listens to this event to reload the source when the spinner is hidden
2001
+ */
2002
+ SYNC = "plugins:spinner:sync"
2003
+ }
2004
+
2005
+ /**
2006
+ * Shows a pending operation indicator when playback is buffering or in other appropriate cases
2007
+ * @beta
2008
+ * @remarks
2009
+ * The plugin emits
2010
+ */
1847
2011
  export declare class SpinnerThreeBounce extends UIContainerPlugin {
2012
+ /**
2013
+ * @internal
2014
+ */
1848
2015
  get name(): string;
2016
+ /**
2017
+ * @internal
2018
+ */
1849
2019
  get supportedVersion(): {
1850
2020
  min: string;
1851
2021
  };
2022
+ /**
2023
+ * @internal
2024
+ */
1852
2025
  get attributes(): {
1853
2026
  'data-spinner': string;
1854
2027
  class: string;
@@ -1863,94 +2036,132 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
1863
2036
  private onPlay;
1864
2037
  private onStop;
1865
2038
  private onError;
1866
- show(immediate?: boolean): void;
2039
+ /**
2040
+ * Shows the spinner
2041
+ */
2042
+ show(): void;
2043
+ /**
2044
+ * Hides the spinner
2045
+ */
1867
2046
  hide(): void;
2047
+ /**
2048
+ * @internal
2049
+ */
1868
2050
  render(): this;
1869
2051
  }
1870
2052
 
1871
- export declare class Statistics extends ContainerPlugin {
1872
- get name(): string;
1873
- get supportedVersion(): {
1874
- min: string;
1875
- };
1876
- private started;
1877
- private timeStart;
1878
- private heatmapSent;
1879
- private heatmapLastTime;
1880
- private watchSent;
1881
- private bufTracking;
1882
- private lags;
2053
+ /**
2054
+ * Playback stall event data
2055
+ */
2056
+ export declare interface StallEventData {
2057
+ event: TelemetryEvent.Stall;
1883
2058
  /**
1884
- * The time when buffering last started.
2059
+ * Accumulated buffering duration over the measurement interval, ms
1885
2060
  */
1886
- private bufLastStarted;
2061
+ total_ms: number;
1887
2062
  /**
1888
- * The accumulated buffering duration.
2063
+ * Number of stalls
1889
2064
  */
1890
- private bufAccDuration;
1891
- constructor(container: Container);
1892
- bindEvents(): void;
1893
- private startLevelSwitch;
1894
- private stopLevelSwitch;
1895
- private onBuffering;
1896
- private onBufferFull;
1897
- private onReady;
1898
- private initEvent;
1899
- private sendMessage;
1900
- private send;
1901
- private sendHeatmap;
1902
- private onTimeUpdateLive;
1903
- private onStart;
2065
+ count: number;
2066
+ /**
2067
+ * Playback time when the stall is reported at the end of a stall measurement interval, s
2068
+ */
2069
+ time: number;
1904
2070
  }
1905
2071
 
1906
- declare type StatisticsEvent = 'init' | 'start' | 'watch' | 'heatmap';
1907
-
1908
- declare type StatisticsEventData = Record<string, string | number | boolean>;
1909
-
1910
- declare type StatisticsRecord = {
1911
- event: StatisticsEvent;
1912
- type: PlaybackType;
1913
- } & StatisticsEventData;
2072
+ export declare interface StartEventData {
2073
+ event: TelemetryEvent.Start;
2074
+ }
1914
2075
 
2076
+ /**
2077
+ * A {@link MediaControl | media control} plugin that provides a UI to select the subtitles when available.
2078
+ * @beta
2079
+ *
2080
+ * @remarks
2081
+ * Depends on:
2082
+ *
2083
+ * - {@link MediaControl}
2084
+ *
2085
+ * Configuration options:
2086
+ *
2087
+ * - subtitles.language - The language of the subtitles to select by default.
2088
+ *
2089
+ * @example
2090
+ * ```ts
2091
+ * import { Subtitles } from '@gcorevideo/player'
2092
+ *
2093
+ * Player.registerPlugin(Subtitles)
2094
+ *
2095
+ * new Player({
2096
+ * ...
2097
+ * subtitles: {
2098
+ * language: 'en',
2099
+ * },
2100
+ * })
2101
+ * ```
2102
+ */
1915
2103
  export declare class Subtitles extends UICorePlugin {
1916
- private currentContainer;
1917
2104
  private currentLevel;
1918
- private currentPlayback;
2105
+ private isPreselectedApplied;
1919
2106
  private isShowing;
2107
+ private track;
1920
2108
  private tracks;
1921
2109
  private $string;
2110
+ /**
2111
+ * @internal
2112
+ */
1922
2113
  get name(): string;
2114
+ /**
2115
+ * @internal
2116
+ */
1923
2117
  get supportedVersion(): {
1924
2118
  min: string;
1925
2119
  };
2120
+ /**
2121
+ * @internal
2122
+ */
1926
2123
  static get version(): string;
1927
- get template(): any;
1928
- get templateString(): any;
2124
+ private static readonly template;
2125
+ private static readonly templateString;
2126
+ /**
2127
+ * @internal
2128
+ */
1929
2129
  get attributes(): {
1930
2130
  class: string;
1931
2131
  'data-subtitles': string;
1932
2132
  };
2133
+ /**
2134
+ * @internal
2135
+ */
1933
2136
  get events(): {
1934
2137
  'click [data-subtitles-select]': string;
1935
2138
  'click [data-subtitles-button]': string;
1936
2139
  };
1937
- private isPreselectedApplied;
1938
- private track;
1939
- get preselectedLanguage(): string;
2140
+ private get preselectedLanguage();
2141
+ /**
2142
+ * @internal
2143
+ */
1940
2144
  bindEvents(): void;
1941
- unBindEvents(): void;
1942
2145
  private bindPlaybackEvents;
1943
2146
  private getTracks;
1944
2147
  private onStartAd;
1945
2148
  private onFinishAd;
1946
- reload(): void;
1947
2149
  private playerResize;
2150
+ /**
2151
+ * Hides the subtitles menu and the subtitles.
2152
+ */
1948
2153
  hide(): void;
2154
+ /**
2155
+ * Shows the subtitles menu and the subtitles.
2156
+ */
1949
2157
  show(): void;
1950
2158
  private shouldRender;
1951
2159
  private resizeFont;
2160
+ /**
2161
+ * @internal
2162
+ */
1952
2163
  render(): this;
1953
- private fillLevels;
2164
+ private setTracks;
1954
2165
  private findLevelBy;
1955
2166
  private selectLevel;
1956
2167
  private onLevelSelect;
@@ -1958,11 +2169,11 @@ export declare class Subtitles extends UICorePlugin {
1958
2169
  private onShowLevelSelectMenu;
1959
2170
  private hideSelectLevelMenu;
1960
2171
  private toggleContextMenu;
1961
- buttonElement(): ZeptoResult;
1962
- levelElement(id?: string): ZeptoResult;
1963
- startLevelSwitch(): void;
1964
- stopLevelSwitch(): void;
1965
- selectSubtitles(): void;
2172
+ private buttonElement;
2173
+ private levelElement;
2174
+ private startLevelSwitch;
2175
+ private stopLevelSwitch;
2176
+ private selectSubtitles;
1966
2177
  private setSubtitleText;
1967
2178
  private clearSubtitleText;
1968
2179
  private updateCurrentLevel;
@@ -1970,6 +2181,116 @@ export declare class Subtitles extends UICorePlugin {
1970
2181
  private renderIcon;
1971
2182
  }
1972
2183
 
2184
+ /**
2185
+ * Collects and reports the performance statistics.
2186
+ * @beta
2187
+ * @remarks
2188
+ * This plugin is experimental and its API is likely to change.
2189
+ *
2190
+ * Configuration options {@link TelemetryPluginSettings}
2191
+ *
2192
+ * @example
2193
+ * ```ts
2194
+ * import { Statistics } from '@gcorevideo/player'
2195
+ *
2196
+ * Player.registerPlugin(Statistics)
2197
+ *
2198
+ * const player = new Player({
2199
+ * statistics: {
2200
+ * send: (data) => {
2201
+ * fetch('/stats', {
2202
+ * method: 'POST',
2203
+ * body: JSON.stringify(data),
2204
+ * headers: { 'content-type': 'application/json' },
2205
+ * })
2206
+ * },
2207
+ * },
2208
+ * ...
2209
+ * })
2210
+ * ```
2211
+ */
2212
+ export declare class Telemetry extends ContainerPlugin {
2213
+ /**
2214
+ * The name of the plugin.
2215
+ */
2216
+ get name(): string;
2217
+ /**
2218
+ * The supported version of the plugin.
2219
+ */
2220
+ get supportedVersion(): {
2221
+ min: string;
2222
+ };
2223
+ private started;
2224
+ private timeStart;
2225
+ private stallSent;
2226
+ private stallLastTime;
2227
+ private watchSent;
2228
+ private bufTracking;
2229
+ private numStalls;
2230
+ /**
2231
+ * The time when buffering last started.
2232
+ */
2233
+ private bufLastStarted;
2234
+ /**
2235
+ * The accumulated buffering duration.
2236
+ */
2237
+ private stallAcc;
2238
+ constructor(container: Container);
2239
+ /**
2240
+ * @internal
2241
+ */
2242
+ bindEvents(): void;
2243
+ private startLevelSwitch;
2244
+ private endLevelSwitch;
2245
+ private onBuffering;
2246
+ private onBufferFull;
2247
+ private onReady;
2248
+ private sendInit;
2249
+ private send;
2250
+ private sendStall;
2251
+ private onTimeUpdate;
2252
+ private onStart;
2253
+ }
2254
+
2255
+ /**
2256
+ * Telemetry event type
2257
+ */
2258
+ export declare enum TelemetryEvent {
2259
+ Init = 1,
2260
+ Start = 2,
2261
+ Watch = 3,
2262
+ Stall = 4
2263
+ }
2264
+
2265
+ /**
2266
+ * Telemetry event data
2267
+ */
2268
+ export declare type TelemetryEventData = StallEventData | InitEventData | StartEventData | WatchEventData;
2269
+
2270
+ /**
2271
+ * Plugin settings
2272
+ */
2273
+ export declare interface TelemetryPluginSettings {
2274
+ /**
2275
+ * Sends the statistics record to the storage.
2276
+ * The actual delivery is presumably async and batched.
2277
+ */
2278
+ send: TelemetrySendFn;
2279
+ }
2280
+
2281
+ /**
2282
+ * Telemetry record
2283
+ */
2284
+ export declare type TelemetryRecord = {
2285
+ type: PlaybackType;
2286
+ } & TelemetryEventData;
2287
+
2288
+ /**
2289
+ * Callback to send the telemetry record to the storage.
2290
+ * @param data - The telemetry record to send.
2291
+ */
2292
+ declare type TelemetrySendFn = (data: TelemetryRecord) => void;
2293
+
1973
2294
  export declare class Thumbnails extends UICorePlugin {
1974
2295
  private _$spotlight;
1975
2296
  private _$backdrop;
@@ -2117,9 +2438,15 @@ export declare class VolumeFade extends UICorePlugin {
2117
2438
  private container;
2118
2439
  private delay;
2119
2440
  private interval;
2441
+ /**
2442
+ * @internal
2443
+ */
2120
2444
  get name(): string;
2445
+ /**
2446
+ * @internal
2447
+ */
2121
2448
  bindEvents(): void;
2122
- unBindEvents(): void;
2449
+ private unBindEvents;
2123
2450
  private _onUserChangeVolume;
2124
2451
  private _onVolumeConfig;
2125
2452
  private onCoreReady;
@@ -2133,6 +2460,10 @@ export declare enum VolumeFadeEvents {
2133
2460
  FADE = "core:volume:fade"
2134
2461
  }
2135
2462
 
2463
+ export declare interface WatchEventData {
2464
+ event: TelemetryEvent.Watch;
2465
+ }
2466
+
2136
2467
  /**
2137
2468
  * @beta
2138
2469
  */