@gcorevideo/player 2.22.0 → 2.22.2
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/assets/bottom-gear/bottomgear copy.ejs +10 -0
- package/assets/bottom-gear/bottomgear.ejs +4 -8
- package/assets/bottom-gear/gear-sub-menu.scss +0 -1
- package/assets/bottom-gear/gear.scss +0 -1
- package/assets/clappr-nerd-stats/button.ejs +3 -3
- package/assets/level-selector/button.ejs +2 -4
- package/assets/level-selector/list.ejs +14 -10
- package/assets/level-selector/style.scss +9 -4
- package/assets/media-control/container.scss +1 -1
- package/assets/playback-rate/list.ejs +5 -5
- package/assets/spinner-three-bounce/spinner.scss +1 -1
- package/dist/core.js +1 -2
- package/dist/index.css +885 -884
- package/dist/index.js +3938 -3779
- package/dist/player.d.ts +246 -108
- package/dist/plugins/index.css +1230 -1229
- package/dist/plugins/index.js +4036 -3878
- 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 +10 -24
- package/docs/api/player.mediacontrol.putelement.md +2 -2
- package/docs/api/{player.bottomgear.getelement.md → player.mediacontrol.toggleelement.md} +23 -9
- 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.mediacontrol.getcenterpanel.md → player.playbackratesettings.md} +8 -6
- 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 +5 -8
- package/docs/api/player.spinnerthreebounce.show.md +2 -5
- package/lib/internal.types.d.ts +5 -0
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +0 -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 +93 -20
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +145 -37
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +2 -3
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +18 -15
- 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/dvr-controls/DvrControls.js +1 -1
- 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/level-selector/LevelSelector.d.ts +8 -11
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +66 -102
- package/lib/plugins/media-control/MediaControl.d.ts +6 -15
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +36 -30
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +7 -2
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +42 -14
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +101 -83
- 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 +8 -6
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +10 -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 +3 -3
- package/lib/testUtils.d.ts +1 -0
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +13 -0
- package/package.json +1 -1
- package/src/internal.types.ts +6 -0
- package/src/playback/dash-playback/DashPlayback.ts +0 -1
- package/src/playback.types.ts +0 -5
- package/src/plugins/bottom-gear/BottomGear.ts +186 -77
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +21 -5
- package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +5 -12
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +27 -25
- package/src/plugins/click-to-pause/ClickToPause.ts +3 -2
- package/src/plugins/dvr-controls/DvrControls.ts +1 -1
- package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +1 -1
- package/src/plugins/error-screen/ErrorScreen.ts +30 -4
- package/src/plugins/level-selector/LevelSelector.ts +80 -120
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +69 -79
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +38 -71
- package/src/plugins/media-control/MediaControl.ts +50 -36
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +4 -4
- package/src/plugins/picture-in-picture/PictureInPicture.ts +7 -2
- package/src/plugins/playback-rate/PlaybackRate.ts +136 -108
- package/src/plugins/playback-rate/__tests__/PlaybackRate.test.ts +84 -37
- package/src/plugins/playback-rate/__tests__/__snapshots__/PlaybackRate.test.ts.snap +55 -6
- package/src/plugins/source-controller/SourceController.ts +41 -4
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +10 -6
- package/src/plugins/subtitles/ClosedCaptions.ts +9 -10
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +1 -1
- package/src/testUtils.ts +14 -0
- package/src/typings/vitest.d.ts +1 -0
- package/temp/player.api.json +303 -370
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.gearitemelement.md +0 -18
- package/docs/api/player.mediacontrol.getleftpanel.md +0 -22
- package/docs/api/player.mediacontrol.getrightpanel.md +0 -22
- 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
|
};
|
|
@@ -735,7 +810,6 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
735
810
|
*/
|
|
736
811
|
get attributes(): {
|
|
737
812
|
class: string;
|
|
738
|
-
'data-dvr-controls': string;
|
|
739
813
|
};
|
|
740
814
|
/**
|
|
741
815
|
* @internal
|
|
@@ -743,9 +817,7 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
743
817
|
bindEvents(): void;
|
|
744
818
|
private onCoreReady;
|
|
745
819
|
private bindContainerEvents;
|
|
746
|
-
private onDvrChanged;
|
|
747
820
|
private click;
|
|
748
|
-
private settingsUpdate;
|
|
749
821
|
private shouldRender;
|
|
750
822
|
/**
|
|
751
823
|
* @internal
|
|
@@ -760,8 +832,23 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
760
832
|
export declare type ErrorLevel = 'FATAL' | 'WARN' | 'INFO';
|
|
761
833
|
|
|
762
834
|
/**
|
|
763
|
-
* `PLUGIN` that displays errors nicely in the overlay on top of the player.
|
|
764
|
-
* @
|
|
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
|
+
* ```
|
|
765
852
|
*/
|
|
766
853
|
export declare class ErrorScreen extends UICorePlugin {
|
|
767
854
|
private err;
|
|
@@ -805,8 +892,8 @@ export declare class ErrorScreen extends UICorePlugin {
|
|
|
805
892
|
}
|
|
806
893
|
|
|
807
894
|
/**
|
|
808
|
-
* Configuration options for the {@link ErrorScreen
|
|
809
|
-
* @
|
|
895
|
+
* Configuration options for the {@link ErrorScreen} plugin.
|
|
896
|
+
* @public
|
|
810
897
|
*/
|
|
811
898
|
export declare type ErrorScreenPluginSettings = {
|
|
812
899
|
/**
|
|
@@ -815,6 +902,17 @@ export declare type ErrorScreenPluginSettings = {
|
|
|
815
902
|
noReload?: boolean;
|
|
816
903
|
};
|
|
817
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
|
+
|
|
818
916
|
/**
|
|
819
917
|
* `PLUGIN` that changes the favicon according to the player's state.
|
|
820
918
|
* @beta
|
|
@@ -871,15 +969,15 @@ export declare interface FaviconPluginSettings {
|
|
|
871
969
|
}
|
|
872
970
|
|
|
873
971
|
/**
|
|
874
|
-
*
|
|
875
|
-
*/
|
|
876
|
-
export declare type GearItemElement = GearOptionsItem;
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* An element inside the gear menu
|
|
972
|
+
* Events triggered by the plugin
|
|
880
973
|
* @beta
|
|
881
974
|
*/
|
|
882
|
-
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
|
+
}
|
|
883
981
|
|
|
884
982
|
/**
|
|
885
983
|
* `PLUGIN` that integrates with Google Analytics
|
|
@@ -959,7 +1057,8 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
959
1057
|
private levelLabels;
|
|
960
1058
|
private removeAuto;
|
|
961
1059
|
private isHd;
|
|
962
|
-
private
|
|
1060
|
+
private currentText;
|
|
1061
|
+
private selectedLevelId;
|
|
963
1062
|
private static readonly buttonTemplate;
|
|
964
1063
|
private static readonly listTemplate;
|
|
965
1064
|
/**
|
|
@@ -983,11 +1082,8 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
983
1082
|
class: string;
|
|
984
1083
|
'data-level-selector': string;
|
|
985
1084
|
};
|
|
986
|
-
private currentText;
|
|
987
|
-
private selectedLevelId;
|
|
988
1085
|
get events(): {
|
|
989
1086
|
'click .gear-sub-menu_btn': string;
|
|
990
|
-
'click .gear-option': string;
|
|
991
1087
|
'click .go-back': string;
|
|
992
1088
|
};
|
|
993
1089
|
/**
|
|
@@ -996,31 +1092,30 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
996
1092
|
bindEvents(): void;
|
|
997
1093
|
private onCoreReady;
|
|
998
1094
|
private onGearRendered;
|
|
999
|
-
private
|
|
1095
|
+
private onActiveContainerChange;
|
|
1096
|
+
private updateHd;
|
|
1000
1097
|
private onStop;
|
|
1001
1098
|
private shouldRender;
|
|
1002
1099
|
/**
|
|
1003
1100
|
* @internal
|
|
1004
1101
|
*/
|
|
1005
1102
|
render(): this;
|
|
1006
|
-
private renderButton;
|
|
1007
1103
|
private renderDropdown;
|
|
1104
|
+
private updateButton;
|
|
1008
1105
|
private get maxLevel();
|
|
1009
|
-
private
|
|
1106
|
+
private onLevelsAvailable;
|
|
1010
1107
|
private makeLevelsLabels;
|
|
1011
|
-
private
|
|
1108
|
+
private onSelect;
|
|
1012
1109
|
private goBack;
|
|
1013
1110
|
private setLevel;
|
|
1014
|
-
private onShowLevelSelectMenu;
|
|
1015
1111
|
private allLevelElements;
|
|
1016
1112
|
private levelElement;
|
|
1017
1113
|
private onLevelSwitchStart;
|
|
1018
1114
|
private onLevelSwitchEnd;
|
|
1019
1115
|
private updateText;
|
|
1020
1116
|
private getLevelLabel;
|
|
1021
|
-
private
|
|
1117
|
+
private onBitrate;
|
|
1022
1118
|
private highlightCurrentLevel;
|
|
1023
|
-
private deferRender;
|
|
1024
1119
|
}
|
|
1025
1120
|
|
|
1026
1121
|
/**
|
|
@@ -1084,6 +1179,8 @@ export { LogTracer }
|
|
|
1084
1179
|
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
1085
1180
|
*/
|
|
1086
1181
|
export declare class MediaControl extends UICorePlugin {
|
|
1182
|
+
private customAreaElements;
|
|
1183
|
+
private customAreaHandler?;
|
|
1087
1184
|
private buttonsColor;
|
|
1088
1185
|
private currentDurationValue;
|
|
1089
1186
|
private currentPositionValue;
|
|
@@ -1098,7 +1195,6 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1098
1195
|
private hideId;
|
|
1099
1196
|
private hideVolumeId;
|
|
1100
1197
|
private intendedVolume;
|
|
1101
|
-
private isHD;
|
|
1102
1198
|
private keepVisible;
|
|
1103
1199
|
private kibo;
|
|
1104
1200
|
private lastMouseX;
|
|
@@ -1109,13 +1205,11 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1109
1205
|
private userDisabled;
|
|
1110
1206
|
private userKeepVisible;
|
|
1111
1207
|
private verticalVolume;
|
|
1112
|
-
private $audioTracksSelector;
|
|
1113
1208
|
private $clipText;
|
|
1114
1209
|
private $clipTextContainer;
|
|
1115
1210
|
private $duration;
|
|
1116
1211
|
private $fullscreenToggle;
|
|
1117
1212
|
private $multiCameraSelector;
|
|
1118
|
-
private $pip;
|
|
1119
1213
|
private $playPauseToggle;
|
|
1120
1214
|
private $playStopToggle;
|
|
1121
1215
|
private $playbackRate;
|
|
@@ -1259,8 +1353,6 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1259
1353
|
private renderSeekBar;
|
|
1260
1354
|
private drawDurationAndPosition;
|
|
1261
1355
|
private seek;
|
|
1262
|
-
private setKeepVisible;
|
|
1263
|
-
private resetKeepVisible;
|
|
1264
1356
|
private setUserKeepVisible;
|
|
1265
1357
|
private resetUserKeepVisible;
|
|
1266
1358
|
private isVisible;
|
|
@@ -1268,7 +1360,7 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1268
1360
|
private hide;
|
|
1269
1361
|
private updateCursorStyle;
|
|
1270
1362
|
private updateSettings;
|
|
1271
|
-
private
|
|
1363
|
+
private onHdUpdate;
|
|
1272
1364
|
private createCachedElements;
|
|
1273
1365
|
/**
|
|
1274
1366
|
* Get a media control element DOM node
|
|
@@ -1290,18 +1382,17 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1290
1382
|
* ```
|
|
1291
1383
|
*/
|
|
1292
1384
|
getElement(name: MediaControlElement): ZeptoResult | null;
|
|
1293
|
-
putElement(name: MediaControlElement, element:
|
|
1294
|
-
|
|
1295
|
-
* Get the right panel area to append custom elements to
|
|
1296
|
-
* @returns ZeptoSelector of the right panel element
|
|
1297
|
-
*/
|
|
1298
|
-
getRightPanel(): any;
|
|
1385
|
+
putElement(name: MediaControlElement, element: ZeptoResult): void;
|
|
1386
|
+
handleCustomArea(handler: (name: string, content: HTMLElement) => void): void;
|
|
1299
1387
|
/**
|
|
1300
|
-
*
|
|
1301
|
-
* @
|
|
1388
|
+
* Toggle the visibility of a media control element
|
|
1389
|
+
* @param name - The name of the media control element
|
|
1390
|
+
* @param show - Whether to show or hide the element
|
|
1302
1391
|
*/
|
|
1303
|
-
|
|
1304
|
-
|
|
1392
|
+
toggleElement(area: MediaControlElement, show: boolean): void;
|
|
1393
|
+
private getRightPanel;
|
|
1394
|
+
private getLeftPanel;
|
|
1395
|
+
private getCenterPanel;
|
|
1305
1396
|
private resetIndicators;
|
|
1306
1397
|
private initializeIcons;
|
|
1307
1398
|
private setSeekPercentage;
|
|
@@ -1336,24 +1427,14 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
1336
1427
|
disabledControlButton(): void;
|
|
1337
1428
|
private isSeekEnabledForHtml5Playback;
|
|
1338
1429
|
private getElementLocation;
|
|
1430
|
+
private onDvrStateChanged;
|
|
1339
1431
|
}
|
|
1340
1432
|
|
|
1341
1433
|
/**
|
|
1342
1434
|
* Media control elements, mount points for additional plugins
|
|
1343
1435
|
* @beta
|
|
1344
1436
|
*/
|
|
1345
|
-
export declare type MediaControlElement = 'audiotracks' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer' | '
|
|
1346
|
-
|
|
1347
|
-
/**
|
|
1348
|
-
* Custom events emitted by the plugins to communicate with one another
|
|
1349
|
-
* @beta
|
|
1350
|
-
*/
|
|
1351
|
-
export declare enum MediaControlEvents {
|
|
1352
|
-
/**
|
|
1353
|
-
* Emitted when the gear menu is rendered
|
|
1354
|
-
*/
|
|
1355
|
-
MEDIACONTROL_GEAR_RENDERED = "mediacontrol:gear:rendered"
|
|
1356
|
-
}
|
|
1437
|
+
export declare type MediaControlElement = 'audiotracks' | 'cc' | 'clipText' | 'dvr' | 'duration' | 'fullscreen' | 'gear' | 'multicamera' | 'pip' | 'playbackRate' | 'position' | 'seekBarContainer' | 'vr' | 'volume';
|
|
1357
1438
|
|
|
1358
1439
|
/**
|
|
1359
1440
|
* @beta
|
|
@@ -1580,17 +1661,32 @@ export declare type PlaybackModule = 'dash' | 'hls' | 'html5_video';
|
|
|
1580
1661
|
* @remarks
|
|
1581
1662
|
* Depends on:
|
|
1582
1663
|
*
|
|
1583
|
-
* - {@link MediaControl
|
|
1664
|
+
* - {@link MediaControl}
|
|
1665
|
+
*
|
|
1666
|
+
* - {@link BottomGear}
|
|
1584
1667
|
*
|
|
1585
|
-
*
|
|
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.
|
|
1586
1670
|
*
|
|
1587
|
-
*
|
|
1588
|
-
*
|
|
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
|
+
* ```
|
|
1589
1687
|
*/
|
|
1590
1688
|
export declare class PlaybackRate extends UICorePlugin {
|
|
1591
1689
|
private playbackRates;
|
|
1592
|
-
private prevSelectedRate;
|
|
1593
|
-
private rendered;
|
|
1594
1690
|
private selectedRate;
|
|
1595
1691
|
/**
|
|
1596
1692
|
* @internal
|
|
@@ -1615,9 +1711,8 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
1615
1711
|
* @internal
|
|
1616
1712
|
*/
|
|
1617
1713
|
get events(): {
|
|
1618
|
-
'click
|
|
1619
|
-
'click
|
|
1620
|
-
'click .go-back': string;
|
|
1714
|
+
'click [data-rate]': string;
|
|
1715
|
+
'click #playback-rate-back-button': string;
|
|
1621
1716
|
};
|
|
1622
1717
|
/**
|
|
1623
1718
|
* @internal
|
|
@@ -1625,8 +1720,10 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
1625
1720
|
bindEvents(): void;
|
|
1626
1721
|
private onCoreReady;
|
|
1627
1722
|
private onActiveContainerChange;
|
|
1723
|
+
private onMediaControlRendered;
|
|
1628
1724
|
private onGearRendered;
|
|
1629
|
-
private
|
|
1725
|
+
private addGearItem;
|
|
1726
|
+
private onMetaDataLoaded;
|
|
1630
1727
|
private allRateElements;
|
|
1631
1728
|
private rateElement;
|
|
1632
1729
|
private onPlaybackRateChange;
|
|
@@ -1635,19 +1732,33 @@ export declare class PlaybackRate extends UICorePlugin {
|
|
|
1635
1732
|
* @internal
|
|
1636
1733
|
*/
|
|
1637
1734
|
render(): this;
|
|
1638
|
-
private onStartAd;
|
|
1639
|
-
private onFinishAd;
|
|
1640
1735
|
private onPlay;
|
|
1641
1736
|
private resetPlaybackRate;
|
|
1642
1737
|
private onStop;
|
|
1643
|
-
private
|
|
1644
|
-
private onShowMenu;
|
|
1738
|
+
private onSelect;
|
|
1645
1739
|
private goBack;
|
|
1646
1740
|
private setSelectedRate;
|
|
1647
1741
|
private getTitle;
|
|
1648
1742
|
private highlightCurrentRate;
|
|
1743
|
+
private updateGearOptionLabel;
|
|
1649
1744
|
}
|
|
1650
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
|
+
|
|
1651
1762
|
/**
|
|
1652
1763
|
* Type of a stream
|
|
1653
1764
|
* @public
|
|
@@ -2311,11 +2422,47 @@ export declare class SkipTime extends UICorePlugin {
|
|
|
2311
2422
|
}
|
|
2312
2423
|
|
|
2313
2424
|
/**
|
|
2314
|
-
* `PLUGIN` that is responsible for managing the automatic failover between sources.
|
|
2315
|
-
* @
|
|
2425
|
+
* `PLUGIN` that is responsible for managing the automatic failover between media sources.
|
|
2426
|
+
* @public
|
|
2316
2427
|
* @remarks
|
|
2317
2428
|
* Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details
|
|
2318
|
-
* 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
|
+
* ```
|
|
2319
2466
|
*
|
|
2320
2467
|
* This plugin does not expose any public methods apart from required by the Clappr plugin interface.
|
|
2321
2468
|
* It is supposed to work autonomously.
|
|
@@ -2345,7 +2492,7 @@ export declare class SourceController extends CorePlugin {
|
|
|
2345
2492
|
min: string;
|
|
2346
2493
|
};
|
|
2347
2494
|
/**
|
|
2348
|
-
* @
|
|
2495
|
+
* @param core - The Clappr core instance.
|
|
2349
2496
|
*/
|
|
2350
2497
|
constructor(core: Core);
|
|
2351
2498
|
/**
|
|
@@ -2366,19 +2513,19 @@ export declare class SourceController extends CorePlugin {
|
|
|
2366
2513
|
|
|
2367
2514
|
/**
|
|
2368
2515
|
* Custom events emitted by the plugin
|
|
2369
|
-
* @
|
|
2516
|
+
* @public
|
|
2370
2517
|
*/
|
|
2371
2518
|
export declare enum SpinnerEvents {
|
|
2372
2519
|
/**
|
|
2373
2520
|
* Emitted at the end of the spinner animation cycle to facilitate smooth UI updates,
|
|
2374
|
-
*
|
|
2521
|
+
* for instance, {@link SourceController} listens to this event to reload the source when the spinner is hidden
|
|
2375
2522
|
*/
|
|
2376
2523
|
SYNC = "plugins:spinner:sync"
|
|
2377
2524
|
}
|
|
2378
2525
|
|
|
2379
2526
|
/**
|
|
2380
|
-
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state
|
|
2381
|
-
* @
|
|
2527
|
+
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state.
|
|
2528
|
+
* @public
|
|
2382
2529
|
* @remarks
|
|
2383
2530
|
* Events emitted- {@link SpinnerEvents}
|
|
2384
2531
|
* Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
|
|
@@ -2416,7 +2563,9 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
2416
2563
|
/**
|
|
2417
2564
|
* Shows the spinner.
|
|
2418
2565
|
*
|
|
2419
|
-
*
|
|
2566
|
+
* The method call prevents spinner's built-in logic from automatically hiding it until {@link SpinnerThreeBounce.hide} is called
|
|
2567
|
+
*
|
|
2568
|
+
* @param delay - The delay in milliseconds before the spinner is shown.
|
|
2420
2569
|
*/
|
|
2421
2570
|
show(delay?: number): void;
|
|
2422
2571
|
/**
|
|
@@ -2459,11 +2608,6 @@ export declare interface StartEventData {
|
|
|
2459
2608
|
event: TelemetryEvent.Start;
|
|
2460
2609
|
}
|
|
2461
2610
|
|
|
2462
|
-
/**
|
|
2463
|
-
* @deprecated Use {@link ClosedCaptionsPluginSettings} instead.
|
|
2464
|
-
*/
|
|
2465
|
-
export declare type SubtitlesPluginSettings = ClosedCaptionsPluginSettings;
|
|
2466
|
-
|
|
2467
2611
|
/**
|
|
2468
2612
|
* `PLUGIN` that collects and reports the performance statistics.
|
|
2469
2613
|
* @beta
|
|
@@ -2579,12 +2723,6 @@ export declare type TelemetryRecord = {
|
|
|
2579
2723
|
*/
|
|
2580
2724
|
export declare type TelemetrySendFn = (data: TelemetryRecord) => void;
|
|
2581
2725
|
|
|
2582
|
-
export declare interface TextTrackItem {
|
|
2583
|
-
id: number;
|
|
2584
|
-
name: string;
|
|
2585
|
-
track: TextTrack;
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
2726
|
/**
|
|
2589
2727
|
* `PLUGIN` that displays the thumbnails of the video when available.
|
|
2590
2728
|
* @beta
|