@gcorevideo/player 2.22.1 → 2.22.3
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.
- package/dist/core.js +1 -1
- package/dist/index.css +1427 -1427
- package/dist/index.js +111 -33
- package/dist/player.d.ts +243 -95
- package/dist/plugins/index.css +350 -350
- package/dist/plugins/index.js +111 -33
- package/docs/api/player.bottomgear.additem.md +95 -0
- package/docs/api/player.bottomgear.md +63 -19
- package/docs/api/player.bottomgear.refresh.md +5 -1
- package/docs/api/player.clapprnerdstats.md +0 -2
- package/docs/api/player.clicktopause.md +1 -1
- package/docs/api/player.closedcaptions.md +2 -2
- package/docs/api/player.closedcaptionspluginsettings.md +5 -0
- package/docs/api/player.errorscreen.md +18 -4
- package/docs/api/player.errorscreenpluginsettings.md +1 -4
- package/docs/api/player.errorscreensettings.md +15 -0
- package/docs/api/{player.mediacontrolevents.md → player.gearevents.md} +7 -7
- package/docs/api/player.levelselector.events.md +0 -1
- package/docs/api/player.levelselector.md +1 -1
- package/docs/api/player.md +33 -36
- package/docs/api/{player.bottomgear.setcontent.md → player.mediacontrol.handlecustomarea.md} +5 -9
- package/docs/api/player.mediacontrol.md +15 -1
- package/docs/api/player.mediacontrol.putelement.md +2 -2
- package/docs/api/player.mediacontrol.toggleelement.md +2 -4
- package/docs/api/player.mediacontrolelement.md +1 -1
- package/docs/api/player.playbackrate.md +22 -3
- package/docs/api/{player.gearoptionsitem.md → player.playbackrateoption.md} +6 -4
- package/docs/api/player.playbackratesettings.md +20 -0
- package/docs/api/player.sourcecontroller._constructor_.md +49 -0
- package/docs/api/player.sourcecontroller.md +70 -7
- package/docs/api/player.spinnerevents.md +1 -4
- package/docs/api/player.spinnerthreebounce._constructor_.md +0 -3
- package/docs/api/player.spinnerthreebounce.hide.md +0 -3
- package/docs/api/player.spinnerthreebounce.md +6 -9
- package/docs/api/player.spinnerthreebounce.show.md +2 -5
- package/lib/index.plugins.d.ts +1 -0
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +1 -0
- package/lib/internal.types.d.ts +5 -0
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/playback.types.d.ts +0 -5
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts +35 -13
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +35 -3
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +3 -2
- package/lib/plugins/error-screen/ErrorScreen.d.ts +29 -4
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +17 -2
- package/lib/plugins/media-control/MediaControl.d.ts +0 -11
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +0 -12
- package/lib/plugins/source-controller/SourceController.d.ts +40 -4
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +41 -4
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +9 -6
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +11 -6
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +7 -7
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +2 -2
- package/package.json +1 -1
- package/src/index.plugins.ts +1 -0
- package/src/internal.types.ts +6 -0
- package/src/playback.types.ts +0 -5
- package/src/plugins/bottom-gear/BottomGear.ts +35 -16
- package/src/plugins/click-to-pause/ClickToPause.ts +3 -2
- package/src/plugins/error-screen/ErrorScreen.ts +30 -4
- package/src/plugins/media-control/MediaControl.ts +0 -12
- package/src/plugins/source-controller/SourceController.ts +41 -4
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +11 -6
- package/src/plugins/subtitles/ClosedCaptions.ts +8 -9
- package/temp/player.api.json +260 -299
- package/tsconfig.tsbuildinfo +1 -1
- package/assets/bottom-gear/bottomgear copy.ejs +0 -10
- package/docs/api/player.bottomgear.getelement.md +0 -56
- package/docs/api/player.gearitemelement.md +0 -18
- package/docs/api/player.subtitlespluginsettings.md +0 -18
- package/docs/api/player.texttrackitem.id.md +0 -11
- package/docs/api/player.texttrackitem.md +0 -87
- package/docs/api/player.texttrackitem.name.md +0 -11
- package/docs/api/player.texttrackitem.track.md +0 -11
package/dist/player.d.ts
CHANGED
|
@@ -173,14 +173,72 @@ declare type BitrateTrackRecord = {
|
|
|
173
173
|
};
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
|
-
* `PLUGIN` that adds
|
|
176
|
+
* `PLUGIN` that adds a button to extend the media controls UI with extra options.
|
|
177
177
|
* @beta
|
|
178
178
|
* @remarks
|
|
179
|
-
* The
|
|
179
|
+
* The plugin renders small gear icon to the right of the media controls.
|
|
180
|
+
* It provides a base for attaching custom settings UI in the gear menu
|
|
180
181
|
*
|
|
181
182
|
* Depends on:
|
|
182
183
|
*
|
|
183
184
|
* - {@link MediaControl}
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* You can use bottom gear to add custom settings UI to the gear menu.
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* import { BottomGear } from '@gcorevideo/player/plugins/bottom-gear';
|
|
191
|
+
*
|
|
192
|
+
* class CustomOptionsPlugin extends UICorePlugin {
|
|
193
|
+
* // ...
|
|
194
|
+
*
|
|
195
|
+
* override get events() {
|
|
196
|
+
* return {
|
|
197
|
+
* 'click #my-button': 'doMyAction',
|
|
198
|
+
* }
|
|
199
|
+
* }
|
|
200
|
+
*
|
|
201
|
+
* private doMyAction() {
|
|
202
|
+
* // ...
|
|
203
|
+
* }
|
|
204
|
+
*
|
|
205
|
+
* override render() {
|
|
206
|
+
* const bottomGear = this.core.getPlugin('bottom_gear');
|
|
207
|
+
* if (!bottomGear) {
|
|
208
|
+
* return this;
|
|
209
|
+
* }
|
|
210
|
+
* this.$el.html('<button class="custom-option">Custom option</button>');
|
|
211
|
+
* // Put rendered element into the gear menu
|
|
212
|
+
* bottomGear.addItem('custom').html(this.$el)
|
|
213
|
+
* return this;
|
|
214
|
+
* }
|
|
215
|
+
*
|
|
216
|
+
* // alternatively, add an option with a submenu
|
|
217
|
+
* override render() {
|
|
218
|
+
* this.$el.html(template(templateHtml)({
|
|
219
|
+
* // ...
|
|
220
|
+
* })));
|
|
221
|
+
* return this;
|
|
222
|
+
* }
|
|
223
|
+
*
|
|
224
|
+
* private addGearOption() {
|
|
225
|
+
* this.core.getPlugin('bottom_gear')
|
|
226
|
+
* .addItem('custom', this.$el)
|
|
227
|
+
* .html($('<button class="custom-option">Custom option</button>'))
|
|
228
|
+
* }
|
|
229
|
+
*
|
|
230
|
+
* override bindEvents() {
|
|
231
|
+
* this.listenToOnce(this.core, ClapprEvents.CORE_READY, () => {
|
|
232
|
+
* const bottomGear = this.core.getPlugin('bottom_gear');
|
|
233
|
+
* assert(bottomGear, 'bottom_gear plugin is required');
|
|
234
|
+
* // simple case
|
|
235
|
+
* this.listenTo(bottomGear, GearEvents.RENDERED, this.render);
|
|
236
|
+
* // or with a submenu
|
|
237
|
+
* this.listenTo(bottomGear, GearEvents.RENDERED, this.addGearOption);
|
|
238
|
+
* });
|
|
239
|
+
* }
|
|
240
|
+
* }
|
|
241
|
+
* ```
|
|
184
242
|
*/
|
|
185
243
|
export declare class BottomGear extends UICorePlugin {
|
|
186
244
|
private isHd;
|
|
@@ -209,22 +267,35 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
209
267
|
* @internal
|
|
210
268
|
*/
|
|
211
269
|
get events(): {
|
|
212
|
-
'click
|
|
270
|
+
'click #gear-button': string;
|
|
213
271
|
};
|
|
214
272
|
/**
|
|
215
273
|
* @internal
|
|
216
274
|
*/
|
|
217
275
|
bindEvents(): void;
|
|
218
276
|
/**
|
|
219
|
-
*
|
|
220
|
-
* @
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
*
|
|
225
|
-
*
|
|
277
|
+
* Adds a custom option to the gear menu
|
|
278
|
+
* @param name - A unique name of the option
|
|
279
|
+
* @param $subMenu - The submenu to attach to the option
|
|
280
|
+
* @returns The added item placeholder to attach custom markup
|
|
281
|
+
* @remarks
|
|
282
|
+
* When called with $submenu param, a click on the added item will toggle the submenu visibility.
|
|
283
|
+
*
|
|
284
|
+
* When added without submenu, it's responsibility of the caller to handle the click event however needed.
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* class MyPlugin extends UICorePlugin {
|
|
288
|
+
* override render() {
|
|
289
|
+
* this.$el.html('<div class="my-awesome-settings">...</div>')
|
|
290
|
+
* this.core.getPlugin('bottom_gear')
|
|
291
|
+
* ?.addItem('custom', this.$el)
|
|
292
|
+
* .html($('<button>Custom settings</button>'))
|
|
293
|
+
* return this
|
|
294
|
+
* }
|
|
295
|
+
* }
|
|
296
|
+
* ```
|
|
226
297
|
*/
|
|
227
|
-
|
|
298
|
+
addItem(name: string, $subMenu?: ZeptoResult): ZeptoResult;
|
|
228
299
|
private onActiveContainerChanged;
|
|
229
300
|
private bindContainerEvents;
|
|
230
301
|
private highDefinitionUpdate;
|
|
@@ -233,14 +304,15 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
233
304
|
*/
|
|
234
305
|
render(): this;
|
|
235
306
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
307
|
+
* Collapses any submenu open back to the gear menu.
|
|
308
|
+
* @remarks
|
|
309
|
+
* Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
|
|
239
310
|
*/
|
|
240
311
|
refresh(): void;
|
|
241
312
|
private toggleGearMenu;
|
|
242
313
|
private hide;
|
|
243
314
|
private onCoreReady;
|
|
315
|
+
private onMediaControlRendered;
|
|
244
316
|
}
|
|
245
317
|
|
|
246
318
|
/**
|
|
@@ -250,8 +322,6 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
250
322
|
* @remarks
|
|
251
323
|
* Depends on:
|
|
252
324
|
*
|
|
253
|
-
* - {@link MediaControl}
|
|
254
|
-
*
|
|
255
325
|
* - {@link BottomGear}
|
|
256
326
|
*
|
|
257
327
|
* - {@link ClapprStats}
|
|
@@ -268,6 +338,7 @@ export declare class ClapprNerdStats extends UICorePlugin {
|
|
|
268
338
|
private showing;
|
|
269
339
|
private shortcut;
|
|
270
340
|
private iconPosition;
|
|
341
|
+
private static readonly buttonTemplate;
|
|
271
342
|
/**
|
|
272
343
|
* @internal
|
|
273
344
|
*/
|
|
@@ -303,7 +374,7 @@ export declare class ClapprNerdStats extends UICorePlugin {
|
|
|
303
374
|
* @internal
|
|
304
375
|
*/
|
|
305
376
|
bindEvents(): void;
|
|
306
|
-
private
|
|
377
|
+
private onCoreReady;
|
|
307
378
|
private toggle;
|
|
308
379
|
private show;
|
|
309
380
|
private hide;
|
|
@@ -401,7 +472,7 @@ export declare class ClapprStats extends ContainerPlugin {
|
|
|
401
472
|
}
|
|
402
473
|
|
|
403
474
|
/**
|
|
404
|
-
* `PLUGIN` that
|
|
475
|
+
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
405
476
|
* @beta
|
|
406
477
|
*/
|
|
407
478
|
export declare class ClickToPause extends ContainerPlugin {
|
|
@@ -490,7 +561,7 @@ export declare interface ClipsPluginSettings {
|
|
|
490
561
|
* @beta
|
|
491
562
|
*
|
|
492
563
|
* @remarks
|
|
493
|
-
* The plugin is activated when closed captions tracks are
|
|
564
|
+
* The plugin is activated when closed captions tracks are detected in the media source.
|
|
494
565
|
* It shows a familiar "CC" button with a dropdown menu to select the subtitles language.
|
|
495
566
|
*
|
|
496
567
|
* Depends on:
|
|
@@ -507,7 +578,7 @@ export declare interface ClipsPluginSettings {
|
|
|
507
578
|
* new Player({
|
|
508
579
|
* ...
|
|
509
580
|
* cc: {
|
|
510
|
-
* language: '
|
|
581
|
+
* language: 'pt-BR',
|
|
511
582
|
* },
|
|
512
583
|
* })
|
|
513
584
|
* ```
|
|
@@ -593,9 +664,13 @@ declare class ClosedCaptions extends UICorePlugin {
|
|
|
593
664
|
export { ClosedCaptions }
|
|
594
665
|
export { ClosedCaptions as Subtitles }
|
|
595
666
|
|
|
667
|
+
/**
|
|
668
|
+
* Configuration options for the {@link ClosedCaptions} plugin.
|
|
669
|
+
* @beta
|
|
670
|
+
*/
|
|
596
671
|
export declare type ClosedCaptionsPluginSettings = {
|
|
597
672
|
/**
|
|
598
|
-
* Initially selected subtitles language
|
|
673
|
+
* Initially selected subtitles language.
|
|
599
674
|
*/
|
|
600
675
|
language?: string;
|
|
601
676
|
};
|
|
@@ -757,8 +832,23 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
757
832
|
export declare type ErrorLevel = 'FATAL' | 'WARN' | 'INFO';
|
|
758
833
|
|
|
759
834
|
/**
|
|
760
|
-
* `PLUGIN` that displays errors nicely in the overlay on top of the player.
|
|
761
|
-
* @
|
|
835
|
+
* `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
|
|
836
|
+
* @public
|
|
837
|
+
* @remarks
|
|
838
|
+
* A fatal error is an error that prevents the player from playing the content.
|
|
839
|
+
* It's usually a network error that persists after multiple retries.
|
|
840
|
+
*
|
|
841
|
+
* The error screen should not be confused with the content stub that is shown when no media sources are available.
|
|
842
|
+
* This can happen due to the lack of the support of the given sources type or because the sources are misconfigured (e.g., omitted).
|
|
843
|
+
*
|
|
844
|
+
* Configuration options - {@link ErrorScreenPluginSettings}
|
|
845
|
+
*
|
|
846
|
+
* @example
|
|
847
|
+
* ```ts
|
|
848
|
+
* import { ErrorScreen, Player } from '@gcorevideo/player'
|
|
849
|
+
*
|
|
850
|
+
* Player.registerPlugin(ErrorScreen)
|
|
851
|
+
* ```
|
|
762
852
|
*/
|
|
763
853
|
export declare class ErrorScreen extends UICorePlugin {
|
|
764
854
|
private err;
|
|
@@ -802,8 +892,8 @@ export declare class ErrorScreen extends UICorePlugin {
|
|
|
802
892
|
}
|
|
803
893
|
|
|
804
894
|
/**
|
|
805
|
-
* Configuration options for the {@link ErrorScreen
|
|
806
|
-
* @
|
|
895
|
+
* Configuration options for the {@link ErrorScreen} plugin.
|
|
896
|
+
* @public
|
|
807
897
|
*/
|
|
808
898
|
export declare type ErrorScreenPluginSettings = {
|
|
809
899
|
/**
|
|
@@ -812,6 +902,17 @@ export declare type ErrorScreenPluginSettings = {
|
|
|
812
902
|
noReload?: boolean;
|
|
813
903
|
};
|
|
814
904
|
|
|
905
|
+
/**
|
|
906
|
+
* Settings for the {@link ErrorScreen} plugin.
|
|
907
|
+
* @public
|
|
908
|
+
*/
|
|
909
|
+
export declare type ErrorScreenSettings = {
|
|
910
|
+
/**
|
|
911
|
+
* Whether to hide the reload button. The reload button triggers reload of the current source.
|
|
912
|
+
*/
|
|
913
|
+
noReload?: boolean;
|
|
914
|
+
};
|
|
915
|
+
|
|
815
916
|
/**
|
|
816
917
|
* `PLUGIN` that changes the favicon according to the player's state.
|
|
817
918
|
* @beta
|
|
@@ -868,15 +969,15 @@ export declare interface FaviconPluginSettings {
|
|
|
868
969
|
}
|
|
869
970
|
|
|
870
971
|
/**
|
|
871
|
-
*
|
|
872
|
-
*/
|
|
873
|
-
export declare type GearItemElement = GearOptionsItem;
|
|
874
|
-
|
|
875
|
-
/**
|
|
876
|
-
* An element inside the gear menu
|
|
972
|
+
* Events triggered by the plugin
|
|
877
973
|
* @beta
|
|
878
974
|
*/
|
|
879
|
-
export declare
|
|
975
|
+
export declare enum GearEvents {
|
|
976
|
+
/**
|
|
977
|
+
* Use this event to accurately attach an item to the gear menu
|
|
978
|
+
*/
|
|
979
|
+
RENDERED = "rendered"
|
|
980
|
+
}
|
|
880
981
|
|
|
881
982
|
/**
|
|
882
983
|
* `PLUGIN` that integrates with Google Analytics
|
|
@@ -956,7 +1057,8 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
956
1057
|
private levelLabels;
|
|
957
1058
|
private removeAuto;
|
|
958
1059
|
private isHd;
|
|
959
|
-
private
|
|
1060
|
+
private currentText;
|
|
1061
|
+
private selectedLevelId;
|
|
960
1062
|
private static readonly buttonTemplate;
|
|
961
1063
|
private static readonly listTemplate;
|
|
962
1064
|
/**
|
|
@@ -980,11 +1082,8 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
980
1082
|
class: string;
|
|
981
1083
|
'data-level-selector': string;
|
|
982
1084
|
};
|
|
983
|
-
private currentText;
|
|
984
|
-
private selectedLevelId;
|
|
985
1085
|
get events(): {
|
|
986
1086
|
'click .gear-sub-menu_btn': string;
|
|
987
|
-
'click .gear-option': string;
|
|
988
1087
|
'click .go-back': string;
|
|
989
1088
|
};
|
|
990
1089
|
/**
|
|
@@ -993,31 +1092,30 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
993
1092
|
bindEvents(): void;
|
|
994
1093
|
private onCoreReady;
|
|
995
1094
|
private onGearRendered;
|
|
996
|
-
private
|
|
1095
|
+
private onActiveContainerChange;
|
|
1096
|
+
private updateHd;
|
|
997
1097
|
private onStop;
|
|
998
1098
|
private shouldRender;
|
|
999
1099
|
/**
|
|
1000
1100
|
* @internal
|
|
1001
1101
|
*/
|
|
1002
1102
|
render(): this;
|
|
1003
|
-
private renderButton;
|
|
1004
1103
|
private renderDropdown;
|
|
1104
|
+
private updateButton;
|
|
1005
1105
|
private get maxLevel();
|
|
1006
|
-
private
|
|
1106
|
+
private onLevelsAvailable;
|
|
1007
1107
|
private makeLevelsLabels;
|
|
1008
|
-
private
|
|
1108
|
+
private onSelect;
|
|
1009
1109
|
private goBack;
|
|
1010
1110
|
private setLevel;
|
|
1011
|
-
private onShowLevelSelectMenu;
|
|
1012
1111
|
private allLevelElements;
|
|
1013
1112
|
private levelElement;
|
|
1014
1113
|
private onLevelSwitchStart;
|
|
1015
1114
|
private onLevelSwitchEnd;
|
|
1016
1115
|
private updateText;
|
|
1017
1116
|
private getLevelLabel;
|
|
1018
|
-
private
|
|
1117
|
+
private onBitrate;
|
|
1019
1118
|
private highlightCurrentLevel;
|
|
1020
|
-
private deferRender;
|
|
1021
1119
|
}
|
|
1022
1120
|
|
|
1023
1121
|
/**
|
|
@@ -1081,6 +1179,8 @@ export { LogTracer }
|
|
|
1081
1179
|
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
1082
1180
|
*/
|
|
1083
1181
|
export declare class MediaControl extends UICorePlugin {
|
|
1182
|
+
private customAreaElements;
|
|
1183
|
+
private customAreaHandler?;
|
|
1084
1184
|
private buttonsColor;
|
|
1085
1185
|
private currentDurationValue;
|
|
1086
1186
|
private currentPositionValue;
|
|
@@ -1105,13 +1205,11 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1105
1205
|
private userDisabled;
|
|
1106
1206
|
private userKeepVisible;
|
|
1107
1207
|
private verticalVolume;
|
|
1108
|
-
private $audioTracksSelector;
|
|
1109
1208
|
private $clipText;
|
|
1110
1209
|
private $clipTextContainer;
|
|
1111
1210
|
private $duration;
|
|
1112
1211
|
private $fullscreenToggle;
|
|
1113
1212
|
private $multiCameraSelector;
|
|
1114
|
-
private $pip;
|
|
1115
1213
|
private $playPauseToggle;
|
|
1116
1214
|
private $playStopToggle;
|
|
1117
1215
|
private $playbackRate;
|
|
@@ -1284,13 +1382,14 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1284
1382
|
* ```
|
|
1285
1383
|
*/
|
|
1286
1384
|
getElement(name: MediaControlElement): ZeptoResult | null;
|
|
1287
|
-
putElement(name: MediaControlElement, element:
|
|
1385
|
+
putElement(name: MediaControlElement, element: ZeptoResult): void;
|
|
1386
|
+
handleCustomArea(handler: (name: string, content: HTMLElement) => void): void;
|
|
1288
1387
|
/**
|
|
1289
1388
|
* Toggle the visibility of a media control element
|
|
1290
1389
|
* @param name - The name of the media control element
|
|
1291
1390
|
* @param show - Whether to show or hide the element
|
|
1292
1391
|
*/
|
|
1293
|
-
toggleElement(
|
|
1392
|
+
toggleElement(area: MediaControlElement, show: boolean): void;
|
|
1294
1393
|
private getRightPanel;
|
|
1295
1394
|
private getLeftPanel;
|
|
1296
1395
|
private getCenterPanel;
|
|
@@ -1335,18 +1434,7 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1335
1434
|
* Media control elements, mount points for additional plugins
|
|
1336
1435
|
* @beta
|
|
1337
1436
|
*/
|
|
1338
|
-
export declare type MediaControlElement = 'audiotracks' | 'cc' | 'clipText' | 'dvr' | 'duration' | 'gear' | 'pip' | 'playbackRate' | 'position' | 'seekBarContainer';
|
|
1339
|
-
|
|
1340
|
-
/**
|
|
1341
|
-
* Custom events emitted by the plugins to communicate with one another
|
|
1342
|
-
* @beta
|
|
1343
|
-
*/
|
|
1344
|
-
export declare enum MediaControlEvents {
|
|
1345
|
-
/**
|
|
1346
|
-
* Emitted when the gear menu is rendered
|
|
1347
|
-
*/
|
|
1348
|
-
MEDIACONTROL_GEAR_RENDERED = "mediacontrol:gear:rendered"
|
|
1349
|
-
}
|
|
1437
|
+
export declare type MediaControlElement = 'audiotracks' | 'cc' | 'clipText' | 'dvr' | 'duration' | 'fullscreen' | 'gear' | 'multicamera' | 'pip' | 'playbackRate' | 'position' | 'seekBarContainer' | 'vr' | 'volume';
|
|
1350
1438
|
|
|
1351
1439
|
/**
|
|
1352
1440
|
* @beta
|
|
@@ -1573,17 +1661,32 @@ export declare type PlaybackModule = 'dash' | 'hls' | 'html5_video';
|
|
|
1573
1661
|
* @remarks
|
|
1574
1662
|
* Depends on:
|
|
1575
1663
|
*
|
|
1576
|
-
* - {@link MediaControl
|
|
1664
|
+
* - {@link MediaControl}
|
|
1577
1665
|
*
|
|
1578
|
-
* - {@link BottomGear
|
|
1666
|
+
* - {@link BottomGear}
|
|
1667
|
+
*
|
|
1668
|
+
* It renders an option in the gear menu, which opens a dropdown with the options to change the playback rate.
|
|
1669
|
+
* Note that the playback rate change is supported only for VOD or DVR-enabled live streams.
|
|
1579
1670
|
*
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1671
|
+
* Plugin settings - {@link PlaybackRateSettings}
|
|
1672
|
+
*
|
|
1673
|
+
* @example
|
|
1674
|
+
* ```ts
|
|
1675
|
+
* import { Player, PlaybackRateSettings } from '@gcorevideo/player'
|
|
1676
|
+
* Player.registerPlugin(PlaybackRate)
|
|
1677
|
+
* const player = new Player({
|
|
1678
|
+
* playbackRate: {
|
|
1679
|
+
* options: [
|
|
1680
|
+
* { value: 0.5, label: '0.5x' },
|
|
1681
|
+
* { value: 1, label: '1x' },
|
|
1682
|
+
* ],
|
|
1683
|
+
* defaultValue: 1,
|
|
1684
|
+
* } as PlaybackRateSettings,
|
|
1685
|
+
* })
|
|
1686
|
+
* ```
|
|
1582
1687
|
*/
|
|
1583
1688
|
export declare class PlaybackRate extends UICorePlugin {
|
|
1584
1689
|
private playbackRates;
|
|
1585
|
-
private prevSelectedRate;
|
|
1586
|
-
private rendered;
|
|
1587
1690
|
private selectedRate;
|
|
1588
1691
|
/**
|
|
1589
1692
|
* @internal
|
|
@@ -1608,9 +1711,8 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
1608
1711
|
* @internal
|
|
1609
1712
|
*/
|
|
1610
1713
|
get events(): {
|
|
1611
|
-
'click
|
|
1612
|
-
'click
|
|
1613
|
-
'click .go-back': string;
|
|
1714
|
+
'click [data-rate]': string;
|
|
1715
|
+
'click #playback-rate-back-button': string;
|
|
1614
1716
|
};
|
|
1615
1717
|
/**
|
|
1616
1718
|
* @internal
|
|
@@ -1618,8 +1720,10 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
1618
1720
|
bindEvents(): void;
|
|
1619
1721
|
private onCoreReady;
|
|
1620
1722
|
private onActiveContainerChange;
|
|
1723
|
+
private onMediaControlRendered;
|
|
1621
1724
|
private onGearRendered;
|
|
1622
|
-
private
|
|
1725
|
+
private addGearItem;
|
|
1726
|
+
private onMetaDataLoaded;
|
|
1623
1727
|
private allRateElements;
|
|
1624
1728
|
private rateElement;
|
|
1625
1729
|
private onPlaybackRateChange;
|
|
@@ -1628,19 +1732,33 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
1628
1732
|
* @internal
|
|
1629
1733
|
*/
|
|
1630
1734
|
render(): this;
|
|
1631
|
-
private onStartAd;
|
|
1632
|
-
private onFinishAd;
|
|
1633
1735
|
private onPlay;
|
|
1634
1736
|
private resetPlaybackRate;
|
|
1635
1737
|
private onStop;
|
|
1636
|
-
private
|
|
1637
|
-
private onShowMenu;
|
|
1738
|
+
private onSelect;
|
|
1638
1739
|
private goBack;
|
|
1639
1740
|
private setSelectedRate;
|
|
1640
1741
|
private getTitle;
|
|
1641
1742
|
private highlightCurrentRate;
|
|
1743
|
+
private updateGearOptionLabel;
|
|
1642
1744
|
}
|
|
1643
1745
|
|
|
1746
|
+
/**
|
|
1747
|
+
* @beta
|
|
1748
|
+
*/
|
|
1749
|
+
export declare type PlaybackRateOption = {
|
|
1750
|
+
value: number;
|
|
1751
|
+
label: string;
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* @beta
|
|
1756
|
+
*/
|
|
1757
|
+
export declare type PlaybackRateSettings = {
|
|
1758
|
+
options?: PlaybackRateOption[];
|
|
1759
|
+
defaultValue?: number;
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1644
1762
|
/**
|
|
1645
1763
|
* Type of a stream
|
|
1646
1764
|
* @public
|
|
@@ -2304,11 +2422,47 @@ export declare class SkipTime extends UICorePlugin {
|
|
|
2304
2422
|
}
|
|
2305
2423
|
|
|
2306
2424
|
/**
|
|
2307
|
-
* `PLUGIN` that is
|
|
2308
|
-
* @
|
|
2425
|
+
* `PLUGIN` that is managing the automatic failover between media sources.
|
|
2426
|
+
* @public
|
|
2309
2427
|
* @remarks
|
|
2310
2428
|
* Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details
|
|
2311
|
-
* on how sources ordering and selection works.
|
|
2429
|
+
* on how sources ordering and selection works. Below is a simplified diagram:
|
|
2430
|
+
*
|
|
2431
|
+
* ```markdown
|
|
2432
|
+
* sources_list:
|
|
2433
|
+
* - a.mpd | +--------------------+
|
|
2434
|
+
* - b.m3u8 |--->| init |
|
|
2435
|
+
* - ... | |--------------------|
|
|
2436
|
+
* | current_source = 0 |
|
|
2437
|
+
* +--------------------+
|
|
2438
|
+
* |
|
|
2439
|
+
* | source = a.mpd
|
|
2440
|
+
* | playback = dash.js
|
|
2441
|
+
* v
|
|
2442
|
+
* +------------------+
|
|
2443
|
+
* +-->| load source |
|
|
2444
|
+
* | +---------|--------+
|
|
2445
|
+
* | v
|
|
2446
|
+
* | +------------------+
|
|
2447
|
+
* | | play |
|
|
2448
|
+
* | +---------|--------+
|
|
2449
|
+
* | |
|
|
2450
|
+
* | v
|
|
2451
|
+
* | +-----------------------+
|
|
2452
|
+
* | | on playback_error |
|
|
2453
|
+
* | |-----------------------|
|
|
2454
|
+
* | | current_source = |
|
|
2455
|
+
* | | (current_source + 1) |
|
|
2456
|
+
* | | % len sources_list |
|
|
2457
|
+
* | | |
|
|
2458
|
+
* | | delay 1..3s |
|
|
2459
|
+
* | +---------------|-------+
|
|
2460
|
+
* | |
|
|
2461
|
+
* | source=b.m3u8 |
|
|
2462
|
+
* | playback=hls.js |
|
|
2463
|
+
* +-------------------+
|
|
2464
|
+
*
|
|
2465
|
+
* ```
|
|
2312
2466
|
*
|
|
2313
2467
|
* This plugin does not expose any public methods apart from required by the Clappr plugin interface.
|
|
2314
2468
|
* It is supposed to work autonomously.
|
|
@@ -2338,7 +2492,7 @@ export declare class SourceController extends CorePlugin {
|
|
|
2338
2492
|
min: string;
|
|
2339
2493
|
};
|
|
2340
2494
|
/**
|
|
2341
|
-
* @
|
|
2495
|
+
* @param core - The Clappr core instance.
|
|
2342
2496
|
*/
|
|
2343
2497
|
constructor(core: Core);
|
|
2344
2498
|
/**
|
|
@@ -2359,25 +2513,26 @@ export declare class SourceController extends CorePlugin {
|
|
|
2359
2513
|
|
|
2360
2514
|
/**
|
|
2361
2515
|
* Custom events emitted by the plugin
|
|
2362
|
-
* @
|
|
2516
|
+
* @public
|
|
2363
2517
|
*/
|
|
2364
2518
|
export declare enum SpinnerEvents {
|
|
2365
2519
|
/**
|
|
2366
2520
|
* Emitted at the end of the spinner animation cycle to facilitate smooth UI updates,
|
|
2367
|
-
*
|
|
2521
|
+
* for instance, {@link SourceController} listens to this event to reload the source when the spinner is hidden
|
|
2368
2522
|
*/
|
|
2369
2523
|
SYNC = "plugins:spinner:sync"
|
|
2370
2524
|
}
|
|
2371
2525
|
|
|
2372
2526
|
/**
|
|
2373
|
-
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state
|
|
2374
|
-
* @
|
|
2527
|
+
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state.
|
|
2528
|
+
* @public
|
|
2375
2529
|
* @remarks
|
|
2376
|
-
*
|
|
2530
|
+
* It is aliased as `Spinner` for convenience.
|
|
2531
|
+
* Events emitted - {@link SpinnerEvents}
|
|
2377
2532
|
* Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
|
|
2378
2533
|
* implement custom pending/progress indication scenarios.
|
|
2379
2534
|
*/
|
|
2380
|
-
|
|
2535
|
+
declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
2381
2536
|
private userShown;
|
|
2382
2537
|
/**
|
|
2383
2538
|
* @internal
|
|
@@ -2409,7 +2564,9 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
2409
2564
|
/**
|
|
2410
2565
|
* Shows the spinner.
|
|
2411
2566
|
*
|
|
2412
|
-
*
|
|
2567
|
+
* The method call prevents spinner's built-in logic from automatically hiding it until {@link SpinnerThreeBounce.hide} is called
|
|
2568
|
+
*
|
|
2569
|
+
* @param delay - The delay in milliseconds before the spinner is shown.
|
|
2413
2570
|
*/
|
|
2414
2571
|
show(delay?: number): void;
|
|
2415
2572
|
/**
|
|
@@ -2423,6 +2580,8 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
2423
2580
|
*/
|
|
2424
2581
|
render(): this;
|
|
2425
2582
|
}
|
|
2583
|
+
export { SpinnerThreeBounce as Spinner }
|
|
2584
|
+
export { SpinnerThreeBounce }
|
|
2426
2585
|
|
|
2427
2586
|
/**
|
|
2428
2587
|
* Playback stall event data
|
|
@@ -2452,11 +2611,6 @@ export declare interface StartEventData {
|
|
|
2452
2611
|
event: TelemetryEvent.Start;
|
|
2453
2612
|
}
|
|
2454
2613
|
|
|
2455
|
-
/**
|
|
2456
|
-
* @deprecated Use {@link ClosedCaptionsPluginSettings} instead.
|
|
2457
|
-
*/
|
|
2458
|
-
export declare type SubtitlesPluginSettings = ClosedCaptionsPluginSettings;
|
|
2459
|
-
|
|
2460
2614
|
/**
|
|
2461
2615
|
* `PLUGIN` that collects and reports the performance statistics.
|
|
2462
2616
|
* @beta
|
|
@@ -2572,12 +2726,6 @@ export declare type TelemetryRecord = {
|
|
|
2572
2726
|
*/
|
|
2573
2727
|
export declare type TelemetrySendFn = (data: TelemetryRecord) => void;
|
|
2574
2728
|
|
|
2575
|
-
export declare interface TextTrackItem {
|
|
2576
|
-
id: number;
|
|
2577
|
-
name: string;
|
|
2578
|
-
track: TextTrack;
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2581
2729
|
/**
|
|
2582
2730
|
* `PLUGIN` that displays the thumbnails of the video when available.
|
|
2583
2731
|
* @beta
|