@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.
- package/assets/level-selector/list.ejs +2 -2
- package/dist/core.js +2 -2
- package/dist/index.css +780 -780
- package/dist/index.js +1720 -1473
- package/dist/player.d.ts +425 -94
- package/dist/plugins/index.css +1466 -1466
- package/dist/plugins/index.js +1501 -1252
- package/docs/api/player.bottomgear.getelement.md +56 -0
- package/docs/api/player.bottomgear.md +51 -0
- package/docs/api/player.bottomgear.setcontent.md +56 -0
- package/docs/api/player.clapprnerdstats.md +12 -259
- package/docs/api/player.dvrcontrols.md +5 -1
- package/docs/api/player.errorscreen.attributes.md +3 -0
- package/docs/api/player.errorscreen.bindevents.md +3 -0
- package/docs/api/player.errorscreen.container.md +3 -0
- package/docs/api/player.errorscreen.hide.md +3 -0
- package/docs/api/player.errorscreen.md +27 -0
- package/docs/api/player.errorscreen.name.md +3 -0
- package/docs/api/player.errorscreen.render.md +3 -0
- package/docs/api/player.errorscreen.show.md +3 -0
- package/docs/api/player.errorscreen.supportedversion.md +3 -0
- package/docs/api/player.errorscreen.template.md +3 -0
- package/docs/api/player.errorscreen.unbindevents.md +3 -0
- package/docs/api/player.gearevents.md +49 -0
- package/docs/api/{player.sourcecontroller.name.md → player.gearitemelement.md} +5 -3
- package/docs/api/{player.playbackrate.template.md → player.initeventdata.event.md} +3 -3
- package/docs/api/{player.playbackrate.updateplaybackrate.md → player.initeventdata.md} +15 -11
- package/docs/api/player.levelselector.md +9 -1
- package/docs/api/player.md +124 -4
- package/docs/api/{player.clapprnerdstats.render.md → player.mediacontrol.getrightpanel.md} +8 -4
- package/docs/api/player.mediacontrol.md +14 -0
- package/docs/api/player.mediacontrolelement.md +1 -1
- package/docs/api/player.pictureinpicture.md +9 -197
- package/docs/api/player.playbackrate.md +10 -314
- package/docs/api/player.sourcecontroller.md +0 -90
- package/docs/api/player.spinnerevents.md +49 -0
- package/docs/api/player.spinnerthreebounce._constructor_.md +3 -0
- package/docs/api/player.spinnerthreebounce.hide.md +5 -0
- package/docs/api/player.spinnerthreebounce.md +14 -95
- package/docs/api/player.spinnerthreebounce.show.md +6 -37
- package/docs/api/{player.playbackrate.onplay.md → player.stalleventdata.count.md} +5 -7
- package/docs/api/{player.playbackrate.name.md → player.stalleventdata.event.md} +3 -3
- package/docs/api/player.stalleventdata.md +112 -0
- package/docs/api/player.stalleventdata.time.md +13 -0
- package/docs/api/player.stalleventdata.total_ms.md +13 -0
- package/docs/api/{player.pluginsettings.md → player.starteventdata.event.md} +3 -5
- package/docs/api/{player.playbackrate.onrateselect.md → player.starteventdata.md} +15 -11
- package/docs/api/player.subtitles.hide.md +5 -0
- package/docs/api/player.subtitles.md +23 -275
- package/docs/api/player.subtitles.show.md +5 -0
- package/docs/api/{player.statistics._constructor_.md → player.telemetry._constructor_.md} +6 -3
- package/docs/api/player.telemetry.md +146 -0
- package/docs/api/{player.volumefade.name.md → player.telemetry.name.md} +4 -2
- package/docs/api/{player.sourcecontroller.supportedversion.md → player.telemetry.supportedversion.md} +4 -2
- package/docs/api/player.telemetryevent.md +89 -0
- package/docs/api/player.telemetryeventdata.md +15 -0
- package/docs/api/player.telemetrypluginsettings.md +57 -0
- package/docs/api/player.telemetrypluginsettings.send.md +13 -0
- package/docs/api/player.telemetryrecord.md +17 -0
- package/docs/api/player.volumefade.md +0 -93
- package/docs/api/{player.pictureinpicture.name.md → player.watcheventdata.event.md} +3 -3
- package/docs/api/{player.playbackrate.setselectedrate.md → player.watcheventdata.md} +15 -11
- package/lib/index.plugins.d.ts +2 -2
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -2
- package/lib/playback/hls-playback/HlsPlayback.js +1 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts +20 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +28 -7
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +38 -5
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +67 -21
- package/lib/plugins/dvr-controls/DvrControls.d.ts +5 -2
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +5 -2
- package/lib/plugins/error-screen/ErrorScreen.d.ts +5 -0
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +5 -0
- package/lib/plugins/index.d.ts +2 -3
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +2 -3
- package/lib/plugins/level-selector/LevelSelector.d.ts +10 -3
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +20 -19
- package/lib/plugins/media-control/MediaControl.d.ts +6 -2
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +40 -39
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +32 -4
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +30 -2
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +47 -14
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +38 -9
- package/lib/plugins/source-controller/SourceController.d.ts +9 -0
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +11 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +35 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +46 -23
- package/lib/plugins/statistics/Statistics.d.ts +38 -3
- package/lib/plugins/statistics/Statistics.d.ts.map +1 -1
- package/lib/plugins/statistics/Statistics.js +51 -9
- package/lib/plugins/subtitles/Subtitles.d.ts +65 -16
- package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -1
- package/lib/plugins/subtitles/Subtitles.js +131 -109
- package/lib/plugins/telemetry/Telemetry.d.ts +135 -0
- package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -0
- package/lib/plugins/telemetry/Telemetry.js +180 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts +7 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +8 -1
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -2
- package/src/playback/hls-playback/HlsPlayback.ts +1 -1
- package/src/plugins/bottom-gear/BottomGear.ts +26 -4
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +240 -173
- package/src/plugins/dvr-controls/DvrControls.ts +5 -2
- package/src/plugins/error-screen/ErrorScreen.ts +5 -0
- package/src/plugins/index.ts +2 -3
- package/src/plugins/level-selector/LevelSelector.ts +22 -19
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +47 -26
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +18 -18
- package/src/plugins/media-control/MediaControl.ts +43 -41
- package/src/plugins/picture-in-picture/PictureInPicture.ts +35 -7
- package/src/plugins/playback-rate/PlaybackRate.ts +53 -24
- package/src/plugins/source-controller/SourceController.ts +11 -1
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +1 -1
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +46 -22
- package/src/plugins/subtitles/Subtitles.ts +146 -155
- package/src/plugins/telemetry/Telemetry.ts +299 -0
- package/src/plugins/volume-fade/VolumeFade.ts +9 -2
- package/temp/player.api.json +3384 -4872
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.clapprnerdstats.attributes.md +0 -17
- package/docs/api/player.clapprnerdstats.bindevents.md +0 -18
- package/docs/api/player.clapprnerdstats.events.md +0 -18
- package/docs/api/player.clapprnerdstats.name.md +0 -14
- package/docs/api/player.clapprnerdstats.playerheight.md +0 -14
- package/docs/api/player.clapprnerdstats.playerwidth.md +0 -14
- package/docs/api/player.clapprnerdstats.statsboxelem.md +0 -14
- package/docs/api/player.clapprnerdstats.statsboxwidththreshold.md +0 -14
- package/docs/api/player.clapprnerdstats.supportedversion.md +0 -16
- package/docs/api/player.clapprnerdstats.template.md +0 -14
- package/docs/api/player.pictureinpicture.bindevents.md +0 -15
- package/docs/api/player.pictureinpicture.events.md +0 -13
- package/docs/api/player.pictureinpicture.exitpictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.render.md +0 -15
- package/docs/api/player.pictureinpicture.requestpictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.supportedversion.md +0 -13
- package/docs/api/player.pictureinpicture.togglepictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.version.md +0 -11
- package/docs/api/player.pictureinpicture.videoelement.md +0 -11
- package/docs/api/player.playbackrate.attributes.md +0 -14
- package/docs/api/player.playbackrate.bindevents.md +0 -15
- package/docs/api/player.playbackrate.events.md +0 -15
- package/docs/api/player.playbackrate.gettitle.md +0 -15
- package/docs/api/player.playbackrate.goback.md +0 -15
- package/docs/api/player.playbackrate.highlightcurrentrate.md +0 -15
- package/docs/api/player.playbackrate.onfinishad.md +0 -15
- package/docs/api/player.playbackrate.onshowmenu.md +0 -15
- package/docs/api/player.playbackrate.onstartad.md +0 -15
- package/docs/api/player.playbackrate.onstop.md +0 -15
- package/docs/api/player.playbackrate.reload.md +0 -15
- package/docs/api/player.playbackrate.render.md +0 -15
- package/docs/api/player.playbackrate.supportedversion.md +0 -13
- package/docs/api/player.playbackrate.unbindevents.md +0 -15
- package/docs/api/player.sourcecontroller.version.md +0 -14
- package/docs/api/player.spinnerthreebounce.attributes.md +0 -14
- package/docs/api/player.spinnerthreebounce.name.md +0 -11
- package/docs/api/player.spinnerthreebounce.render.md +0 -15
- package/docs/api/player.spinnerthreebounce.supportedversion.md +0 -13
- package/docs/api/player.statistics.bindevents.md +0 -15
- package/docs/api/player.statistics.md +0 -141
- package/docs/api/player.statistics.name.md +0 -11
- package/docs/api/player.statistics.supportedversion.md +0 -13
- package/docs/api/player.subtitles.attributes.md +0 -14
- package/docs/api/player.subtitles.bindevents.md +0 -15
- package/docs/api/player.subtitles.buttonelement.md +0 -15
- package/docs/api/player.subtitles.events.md +0 -14
- package/docs/api/player.subtitles.levelelement.md +0 -51
- package/docs/api/player.subtitles.name.md +0 -11
- package/docs/api/player.subtitles.preselectedlanguage.md +0 -11
- package/docs/api/player.subtitles.reload.md +0 -15
- package/docs/api/player.subtitles.render.md +0 -15
- package/docs/api/player.subtitles.selectsubtitles.md +0 -15
- package/docs/api/player.subtitles.startlevelswitch.md +0 -15
- package/docs/api/player.subtitles.stoplevelswitch.md +0 -15
- package/docs/api/player.subtitles.supportedversion.md +0 -13
- package/docs/api/player.subtitles.template.md +0 -11
- package/docs/api/player.subtitles.templatestring.md +0 -11
- package/docs/api/player.subtitles.unbindevents.md +0 -15
- package/docs/api/player.subtitles.version.md +0 -11
- package/docs/api/player.volumefade.bindevents.md +0 -18
- package/docs/api/player.volumefade.unbindevents.md +0 -18
- package/src/plugins/statistics/Statistics.ts +0 -207
- /package/src/plugins/{statistics → telemetry}/Statistics copy.xts +0 -0
|
@@ -8,16 +8,26 @@ import '../../../assets/bottom-gear/gear-sub-menu.scss';
|
|
|
8
8
|
import gearIcon from '../../../assets/icons/new/gear.svg';
|
|
9
9
|
import gearHdIcon from '../../../assets/icons/new/gear-hd.svg';
|
|
10
10
|
const VERSION = '2.19.12';
|
|
11
|
-
const T = 'plugins.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const T = 'plugins.bottom_gear';
|
|
12
|
+
/**
|
|
13
|
+
* Custom events emitted by the plugin
|
|
14
|
+
*/
|
|
15
|
+
export var GearEvents;
|
|
16
|
+
(function (GearEvents) {
|
|
17
|
+
/**
|
|
18
|
+
* Emitted when the gear menu is rendered
|
|
19
|
+
*/
|
|
20
|
+
GearEvents["MEDIACONTROL_GEAR_RENDERED"] = "mediacontrol:gear:rendered";
|
|
21
|
+
})(GearEvents || (GearEvents = {}));
|
|
16
22
|
/**
|
|
17
23
|
* Adds the gear button that triggers extra options menu on the right side of the {@link MediaControl | media control} UI
|
|
18
24
|
* @beta
|
|
19
25
|
* @remarks
|
|
20
26
|
* The plugins provides a base for attaching custom settings UI in the gear menu
|
|
27
|
+
*
|
|
28
|
+
* Depends on:
|
|
29
|
+
*
|
|
30
|
+
* - {@link MediaControl | media_control}
|
|
21
31
|
*/
|
|
22
32
|
export class BottomGear extends UICorePlugin {
|
|
23
33
|
isHd = false;
|
|
@@ -25,7 +35,7 @@ export class BottomGear extends UICorePlugin {
|
|
|
25
35
|
* @internal
|
|
26
36
|
*/
|
|
27
37
|
get name() {
|
|
28
|
-
return '
|
|
38
|
+
return 'bottom_gear';
|
|
29
39
|
}
|
|
30
40
|
/**
|
|
31
41
|
* @internal
|
|
@@ -68,9 +78,20 @@ export class BottomGear extends UICorePlugin {
|
|
|
68
78
|
this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_RENDERED, this.render);
|
|
69
79
|
this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_HIDE, this.hide); // TODO mediacontrol show as well
|
|
70
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* @param name - Name of a gear menu placeholder item to attach custom UI
|
|
83
|
+
* @returns Zepto result of the element
|
|
84
|
+
*/
|
|
71
85
|
getElement(name) {
|
|
72
86
|
return this.core.getPlugin('media_control')?.getElement('gear')?.find(`.gear-options-list [data-${name}]`);
|
|
73
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Replaces the content of the gear menu
|
|
90
|
+
* @param content - Zepto result of the element
|
|
91
|
+
*/
|
|
92
|
+
setContent(content) {
|
|
93
|
+
this.$el.find('.gear-wrapper').html(content);
|
|
94
|
+
}
|
|
74
95
|
onActiveContainerChanged() {
|
|
75
96
|
trace(`${T} onActiveContainerChanged`);
|
|
76
97
|
this.bindContainerEvents();
|
|
@@ -105,7 +126,7 @@ export class BottomGear extends UICorePlugin {
|
|
|
105
126
|
this.$el.html(BottomGear.template({ icon, items }));
|
|
106
127
|
mediaControl.getElement('gear')?.html(this.el);
|
|
107
128
|
this.core.trigger('gear:rendered'); // @deprecated
|
|
108
|
-
mediaControl.trigger(
|
|
129
|
+
mediaControl.trigger(GearEvents.MEDIACONTROL_GEAR_RENDERED);
|
|
109
130
|
return this;
|
|
110
131
|
}
|
|
111
132
|
refresh() {
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { UICorePlugin, Core } from '@clappr/core';
|
|
2
2
|
import '../../../assets/clappr-nerd-stats/clappr-nerd-stats.scss';
|
|
3
3
|
/**
|
|
4
|
+
* Displays useful network-related statistics.
|
|
4
5
|
* @beta
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Depends on:
|
|
9
|
+
*
|
|
10
|
+
* - {@link MediaControl}
|
|
11
|
+
*
|
|
12
|
+
* - {@link BottomGear}
|
|
13
|
+
*
|
|
14
|
+
* - {@link ClapprStats}
|
|
15
|
+
*
|
|
16
|
+
* The plugin is rendered as an item in the gear menu.
|
|
17
|
+
*
|
|
18
|
+
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
19
|
+
* and recommended quality level.
|
|
5
20
|
*/
|
|
6
21
|
export declare class ClapprNerdStats extends UICorePlugin {
|
|
7
22
|
private container;
|
|
@@ -10,25 +25,40 @@ export declare class ClapprNerdStats extends UICorePlugin {
|
|
|
10
25
|
private showing;
|
|
11
26
|
private shortcut;
|
|
12
27
|
private iconPosition;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
13
31
|
get name(): string;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
14
35
|
get supportedVersion(): {
|
|
15
36
|
min: string;
|
|
16
37
|
};
|
|
17
|
-
|
|
38
|
+
private static readonly template;
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
18
42
|
get attributes(): {
|
|
19
43
|
'data-clappr-nerd-stats': string;
|
|
20
44
|
class: string;
|
|
21
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
22
49
|
get events(): {
|
|
23
50
|
'click [data-show-stats-button]': string;
|
|
24
51
|
'click [data-close-button]': string;
|
|
25
52
|
'click [data-refresh-button]': string;
|
|
26
53
|
};
|
|
27
|
-
get statsBoxElem()
|
|
28
|
-
get statsBoxWidthThreshold()
|
|
29
|
-
get playerWidth()
|
|
30
|
-
get playerHeight()
|
|
54
|
+
private get statsBoxElem();
|
|
55
|
+
private get statsBoxWidthThreshold();
|
|
56
|
+
private get playerWidth();
|
|
57
|
+
private get playerHeight();
|
|
31
58
|
constructor(core: Core);
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
32
62
|
bindEvents(): void;
|
|
33
63
|
private init;
|
|
34
64
|
private toggle;
|
|
@@ -39,6 +69,9 @@ export declare class ClapprNerdStats extends UICorePlugin {
|
|
|
39
69
|
private addCustomMetrics;
|
|
40
70
|
private updateMetrics;
|
|
41
71
|
private setStatsBoxSize;
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
42
75
|
render(): this;
|
|
43
76
|
private addToBottomGear;
|
|
44
77
|
private clearCustomMetrics;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClapprNerdStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-nerd-stats/ClapprNerdStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,IAAI,EAAa,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"ClapprNerdStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-nerd-stats/ClapprNerdStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,IAAI,EAAa,MAAM,cAAc,CAAA;AAsB9E,OAAO,0DAA0D,CAAA;AAgGjE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,CAAC,SAAS,CAAyB;IAE1C,OAAO,CAAC,aAAa,CAIpB;IAED,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,OAAO,CAAQ;IAEvB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,YAAY,CAAc;IAElC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACH,IAAa,MAAM;;;;MAMlB;IAED,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,sBAAsB,GAEjC;IAED,OAAO,KAAK,WAAW,GAEtB;IAED,OAAO,KAAK,YAAY,GAEvB;gBAEW,IAAI,EAAE,IAAI;IAgBtB;;OAEG;IACM,UAAU;IAWnB,OAAO,CAAC,IAAI;IA4BZ,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,IAAI;IAeZ,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACM,MAAM;IAQf,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,gBAAgB;CAWzB"}
|
|
@@ -2,7 +2,7 @@ import { UICorePlugin, Events, template } from '@clappr/core';
|
|
|
2
2
|
import { reportError } from '@gcorevideo/utils';
|
|
3
3
|
import Mousetrap from 'mousetrap';
|
|
4
4
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
5
|
-
import { ClapprStatsEvents } from '../clappr-stats/types.js';
|
|
5
|
+
import { ClapprStatsEvents, } from '../clappr-stats/types.js';
|
|
6
6
|
import { newMetrics as newBaseMetrics } from '../clappr-stats/utils.js';
|
|
7
7
|
import Formatter from './formatter.js';
|
|
8
8
|
import { clearSpeedTestResults, configureSpeedTest, drawSpeedTestResults, initSpeedTest, startSpeedtest, stopSpeedtest, } from './speedtest/index.js';
|
|
@@ -10,14 +10,14 @@ import '../../../assets/clappr-nerd-stats/clappr-nerd-stats.scss';
|
|
|
10
10
|
import pluginHtml from '../../../assets/clappr-nerd-stats/clappr-nerd-stats.ejs';
|
|
11
11
|
import buttonHtml from '../../../assets/clappr-nerd-stats/button.ejs';
|
|
12
12
|
import statsIcon from '../../../assets/icons/new/stats.svg';
|
|
13
|
-
import {
|
|
13
|
+
import { GearEvents } from '../bottom-gear/BottomGear.js';
|
|
14
14
|
import assert from 'assert';
|
|
15
15
|
const qualityClasses = [
|
|
16
16
|
'speedtest-quality-value-1',
|
|
17
17
|
'speedtest-quality-value-2',
|
|
18
18
|
'speedtest-quality-value-3',
|
|
19
19
|
'speedtest-quality-value-4',
|
|
20
|
-
'speedtest-quality-value-5'
|
|
20
|
+
'speedtest-quality-value-5',
|
|
21
21
|
];
|
|
22
22
|
const getDownloadQuality = (speedValue) => {
|
|
23
23
|
if (speedValue < 3) {
|
|
@@ -81,7 +81,22 @@ const drawSummary = (customMetrics, vodContainer, liveContainer) => {
|
|
|
81
81
|
};
|
|
82
82
|
// const T = 'plugins.clappr_nerd_stats';
|
|
83
83
|
/**
|
|
84
|
+
* Displays useful network-related statistics.
|
|
84
85
|
* @beta
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* Depends on:
|
|
89
|
+
*
|
|
90
|
+
* - {@link MediaControl}
|
|
91
|
+
*
|
|
92
|
+
* - {@link BottomGear}
|
|
93
|
+
*
|
|
94
|
+
* - {@link ClapprStats}
|
|
95
|
+
*
|
|
96
|
+
* The plugin is rendered as an item in the gear menu.
|
|
97
|
+
*
|
|
98
|
+
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
99
|
+
* and recommended quality level.
|
|
85
100
|
*/
|
|
86
101
|
export class ClapprNerdStats extends UICorePlugin {
|
|
87
102
|
container = null;
|
|
@@ -94,21 +109,31 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
94
109
|
showing = false;
|
|
95
110
|
shortcut;
|
|
96
111
|
iconPosition;
|
|
112
|
+
/**
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
97
115
|
get name() {
|
|
98
|
-
return '
|
|
116
|
+
return 'nerd_stats';
|
|
99
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
*/
|
|
100
121
|
get supportedVersion() {
|
|
101
122
|
return { min: CLAPPR_VERSION };
|
|
102
123
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
124
|
+
static template = template(pluginHtml);
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
106
128
|
get attributes() {
|
|
107
129
|
return {
|
|
108
130
|
'data-clappr-nerd-stats': '',
|
|
109
|
-
|
|
131
|
+
class: 'clappr-nerd-stats',
|
|
110
132
|
};
|
|
111
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
112
137
|
get events() {
|
|
113
138
|
return {
|
|
114
139
|
'click [data-show-stats-button]': 'showOrHide',
|
|
@@ -130,8 +155,12 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
130
155
|
}
|
|
131
156
|
constructor(core) {
|
|
132
157
|
super(core);
|
|
133
|
-
this.shortcut = core.options.clapprNerdStats?.shortcut ?? [
|
|
134
|
-
|
|
158
|
+
this.shortcut = core.options.clapprNerdStats?.shortcut ?? [
|
|
159
|
+
'command+shift+s',
|
|
160
|
+
'ctrl+shift+s',
|
|
161
|
+
];
|
|
162
|
+
this.iconPosition =
|
|
163
|
+
core.options.clapprNerdStats?.iconPosition ?? 'bottom-right';
|
|
135
164
|
this.customMetrics = {
|
|
136
165
|
connectionSpeed: 0,
|
|
137
166
|
ping: 0,
|
|
@@ -139,11 +168,14 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
139
168
|
};
|
|
140
169
|
configureSpeedTest(core.options.clapprNerdStats?.speedTestServers ?? []);
|
|
141
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
142
174
|
bindEvents() {
|
|
143
175
|
const mediaControl = this.core.getPlugin('media_control');
|
|
144
176
|
assert(mediaControl, 'media_control plugin is required');
|
|
145
177
|
this.listenToOnce(this.core, Events.CORE_READY, this.init);
|
|
146
|
-
this.listenTo(mediaControl,
|
|
178
|
+
this.listenTo(mediaControl, GearEvents.MEDIACONTROL_GEAR_RENDERED, this.addToBottomGear);
|
|
147
179
|
}
|
|
148
180
|
init() {
|
|
149
181
|
this.container = this.core.activeContainer;
|
|
@@ -178,9 +210,11 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
178
210
|
this.core.$el.find(this.statsBoxElem).show();
|
|
179
211
|
this.showing = true;
|
|
180
212
|
this.refreshSpeedTest();
|
|
181
|
-
initSpeedTest(this.customMetrics)
|
|
213
|
+
initSpeedTest(this.customMetrics)
|
|
214
|
+
.then(() => {
|
|
182
215
|
startSpeedtest();
|
|
183
|
-
})
|
|
216
|
+
})
|
|
217
|
+
.catch((e) => {
|
|
184
218
|
reportError(e);
|
|
185
219
|
this.disable();
|
|
186
220
|
});
|
|
@@ -195,13 +229,19 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
195
229
|
}
|
|
196
230
|
addGeneralMetrics() {
|
|
197
231
|
this.metrics.general = {
|
|
198
|
-
displayResolution:
|
|
199
|
-
volume: this.container?.volume
|
|
232
|
+
displayResolution: this.playerWidth + 'x' + this.playerHeight,
|
|
233
|
+
volume: this.container?.volume,
|
|
200
234
|
};
|
|
201
235
|
}
|
|
202
236
|
addCustomMetrics() {
|
|
203
237
|
this.metrics.custom = this.customMetrics;
|
|
204
|
-
const videoQualityNames = [
|
|
238
|
+
const videoQualityNames = [
|
|
239
|
+
'SD (480p)',
|
|
240
|
+
'HD (720p)',
|
|
241
|
+
'Full HD (1080p)',
|
|
242
|
+
'2K (1440p)',
|
|
243
|
+
'4K (2160p)',
|
|
244
|
+
];
|
|
205
245
|
const { connectionSpeed, ping } = this.customMetrics;
|
|
206
246
|
if (!connectionSpeed || !ping) {
|
|
207
247
|
const calculatingText = 'Calculating... Please wait.';
|
|
@@ -213,17 +253,19 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
213
253
|
const pingQuality = getPingQuality(ping);
|
|
214
254
|
const liveQuality = Math.min(downloadQuality, pingQuality);
|
|
215
255
|
const prefix = 'Optimal for ';
|
|
216
|
-
this.metrics.custom.vodQuality =
|
|
217
|
-
|
|
256
|
+
this.metrics.custom.vodQuality =
|
|
257
|
+
prefix + videoQualityNames[downloadQuality - 1];
|
|
258
|
+
this.metrics.custom.liveQuality =
|
|
259
|
+
prefix + videoQualityNames[liveQuality - 1];
|
|
218
260
|
}
|
|
219
261
|
updateMetrics(metrics) {
|
|
220
262
|
Object.assign(this.metrics, metrics);
|
|
221
263
|
this.addGeneralMetrics();
|
|
222
264
|
this.addCustomMetrics();
|
|
223
265
|
const scrollTop = this.core.$el.find(this.statsBoxElem).scrollTop();
|
|
224
|
-
this.$el.html(
|
|
266
|
+
this.$el.html(ClapprNerdStats.template({
|
|
225
267
|
metrics: Formatter.format(this.metrics),
|
|
226
|
-
iconPosition: this.iconPosition
|
|
268
|
+
iconPosition: this.iconPosition,
|
|
227
269
|
}));
|
|
228
270
|
this.setStatsBoxSize();
|
|
229
271
|
drawSpeedTestResults();
|
|
@@ -243,13 +285,17 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
243
285
|
this.$el.find(this.statsBoxElem).addClass('narrow');
|
|
244
286
|
}
|
|
245
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* @internal
|
|
290
|
+
*/
|
|
246
291
|
render() {
|
|
292
|
+
// TODO append to the container
|
|
247
293
|
this.core.$el.append(this.$el[0]);
|
|
248
294
|
this.hide();
|
|
249
295
|
return this;
|
|
250
296
|
}
|
|
251
297
|
addToBottomGear() {
|
|
252
|
-
const gear = this.core.getPlugin('
|
|
298
|
+
const gear = this.core.getPlugin('bottom_gear');
|
|
253
299
|
const $el = gear.getElement('nerd');
|
|
254
300
|
$el.html(buttonHtml);
|
|
255
301
|
const $button = $el.find('.nerd-button');
|
|
@@ -5,8 +5,11 @@ import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
|
5
5
|
* @beta
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Depends on:
|
|
9
|
+
*
|
|
10
|
+
* - {@link MediaControl | media_control}
|
|
11
|
+
*
|
|
12
|
+
* The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
|
|
10
13
|
*/
|
|
11
14
|
export declare class DvrControls extends UICorePlugin {
|
|
12
15
|
private static readonly template;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAC;AAM9E,OAAO,gDAAgD,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAC;AAM9E,OAAO,gDAAgD,CAAC;AAExD;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAErD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;gBAEW,IAAI,EAAE,IAAI;IAKtB;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACM,MAAM;CAehB"}
|
|
@@ -8,8 +8,11 @@ import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
|
8
8
|
* @beta
|
|
9
9
|
*
|
|
10
10
|
* @remarks
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Depends on:
|
|
12
|
+
*
|
|
13
|
+
* - {@link MediaControl | media_control}
|
|
14
|
+
*
|
|
15
|
+
* The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
|
|
13
16
|
*/
|
|
14
17
|
export class DvrControls extends UICorePlugin {
|
|
15
18
|
static template = template(dvrHTML);
|
|
@@ -7,6 +7,11 @@ type PresentationalError = {
|
|
|
7
7
|
icon: string;
|
|
8
8
|
reloadIcon: string;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Displays a descriptive error in the overlay on top of the player.
|
|
12
|
+
* @beta
|
|
13
|
+
* TODO
|
|
14
|
+
*/
|
|
10
15
|
export declare class ErrorScreen extends UICorePlugin {
|
|
11
16
|
private _retry;
|
|
12
17
|
private err;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorScreen.d.ts","sourceRoot":"","sources":["../../../src/plugins/error-screen/ErrorScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiC,MAAM,cAAc,CAAC;AAQ3E,OA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UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAID;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAK;IAEnB,OAAO,CAAC,GAAG,CAAoC;IAE/C,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAI,SAAS,QAEZ;IAED,IAAa,UAAU;;;MAKtB;IAEQ,UAAU;IAQnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,YAAY;IAWpB,YAAY;IASZ,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,OAAO;IAqDf,OAAO,CAAC,MAAM;IAad,IAAI,CAAC,GAAG,CAAC,EAAE,mBAAmB;IAU9B,IAAI;IAIK,MAAM;CAYhB"}
|
|
@@ -7,6 +7,11 @@ import '../../../assets/error-screen/error_screen.scss';
|
|
|
7
7
|
const TIME_FOR_UPDATE = 10000;
|
|
8
8
|
const MAX_RETRY = 10;
|
|
9
9
|
const T = 'plugins.error_screen';
|
|
10
|
+
/**
|
|
11
|
+
* Displays a descriptive error in the overlay on top of the player.
|
|
12
|
+
* @beta
|
|
13
|
+
* TODO
|
|
14
|
+
*/
|
|
10
15
|
export class ErrorScreen extends UICorePlugin {
|
|
11
16
|
_retry = 0;
|
|
12
17
|
err = null;
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -28,11 +28,10 @@ export * from "./poster/Poster.js";
|
|
|
28
28
|
export * from "./seek-time/SeekTime.js";
|
|
29
29
|
export * from "./share/Share.js";
|
|
30
30
|
export * from "./skip-time/SkipTime.js";
|
|
31
|
+
export * from "./source-controller/SourceController.js";
|
|
31
32
|
export * from "./spinner-three-bounce/SpinnerThreeBounce.js";
|
|
32
|
-
export * from "./statistics/Statistics.js";
|
|
33
33
|
export * from "./subtitles/Subtitles.js";
|
|
34
|
+
export * from "./telemetry/Telemetry.js";
|
|
34
35
|
export * from "./thumbnails/Thumbnails.js";
|
|
35
|
-
export { setTracer } from "@gcorevideo/utils";
|
|
36
|
-
export * from "./source-controller/SourceController.js";
|
|
37
36
|
export * from "./volume-fade/VolumeFade.js";
|
|
38
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AAErC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AAErC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,6BAA6B,CAAC"}
|
package/lib/plugins/index.js
CHANGED
|
@@ -29,12 +29,11 @@ export * from "./poster/Poster.js";
|
|
|
29
29
|
export * from "./seek-time/SeekTime.js";
|
|
30
30
|
export * from "./share/Share.js";
|
|
31
31
|
export * from "./skip-time/SkipTime.js";
|
|
32
|
+
export * from "./source-controller/SourceController.js";
|
|
32
33
|
export * from "./spinner-three-bounce/SpinnerThreeBounce.js";
|
|
33
|
-
export * from "./statistics/Statistics.js";
|
|
34
34
|
export * from "./subtitles/Subtitles.js";
|
|
35
|
+
export * from "./telemetry/Telemetry.js";
|
|
35
36
|
export * from "./thumbnails/Thumbnails.js";
|
|
36
|
-
export { setTracer } from "@gcorevideo/utils";
|
|
37
|
-
export * from "./source-controller/SourceController.js";
|
|
38
37
|
// _ vast-ads
|
|
39
38
|
// _ video360
|
|
40
39
|
export * from "./volume-fade/VolumeFade.js";
|
|
@@ -5,7 +5,14 @@ import '../../../assets/level-selector/style.scss';
|
|
|
5
5
|
* @beta
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
*
|
|
8
|
+
* Depends on:
|
|
9
|
+
*
|
|
10
|
+
* - {@link MediaControl}
|
|
11
|
+
*
|
|
12
|
+
* - {@link BottomGear}
|
|
13
|
+
*
|
|
14
|
+
* The plugin is rendered as an item in the gear menu.
|
|
15
|
+
*
|
|
9
16
|
* When clicked, it shows a list of quality levels to choose from.
|
|
10
17
|
*
|
|
11
18
|
* Configuration options:
|
|
@@ -30,8 +37,8 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
30
37
|
private removeAuto;
|
|
31
38
|
private isHd;
|
|
32
39
|
private isOpen;
|
|
33
|
-
private buttonTemplate;
|
|
34
|
-
private listTemplate;
|
|
40
|
+
private static readonly buttonTemplate;
|
|
41
|
+
private static readonly listTemplate;
|
|
35
42
|
/**
|
|
36
43
|
* @internal
|
|
37
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LevelSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/level-selector/LevelSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"LevelSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/level-selector/LevelSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAA;AAe7D,OAAO,2CAA2C,CAAA;AAOlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC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assets/icons/new/arrow-left.svg';
|
|
9
9
|
import checkIcon from '../../../assets/icons/new/check.svg';
|
|
10
10
|
import '../../../assets/level-selector/style.scss';
|
|
11
|
-
|
|
11
|
+
import assert from 'assert';
|
|
12
|
+
const T = 'plugins.level_selector';
|
|
12
13
|
const VERSION = '2.19.4';
|
|
13
14
|
/**
|
|
14
15
|
* A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
|
|
15
16
|
* @beta
|
|
16
17
|
*
|
|
17
18
|
* @remarks
|
|
18
|
-
*
|
|
19
|
+
* Depends on:
|
|
20
|
+
*
|
|
21
|
+
* - {@link MediaControl}
|
|
22
|
+
*
|
|
23
|
+
* - {@link BottomGear}
|
|
24
|
+
*
|
|
25
|
+
* The plugin is rendered as an item in the gear menu.
|
|
26
|
+
*
|
|
19
27
|
* When clicked, it shows a list of quality levels to choose from.
|
|
20
28
|
*
|
|
21
29
|
* Configuration options:
|
|
@@ -40,13 +48,13 @@ export class LevelSelector extends UICorePlugin {
|
|
|
40
48
|
removeAuto = false;
|
|
41
49
|
isHd = false;
|
|
42
50
|
isOpen = false;
|
|
43
|
-
buttonTemplate =
|
|
44
|
-
listTemplate =
|
|
51
|
+
static buttonTemplate = template(buttonHtml);
|
|
52
|
+
static listTemplate = template(listHtml);
|
|
45
53
|
/**
|
|
46
54
|
* @internal
|
|
47
55
|
*/
|
|
48
56
|
get name() {
|
|
49
|
-
return '
|
|
57
|
+
return 'level_selector';
|
|
50
58
|
}
|
|
51
59
|
/**
|
|
52
60
|
* @internal
|
|
@@ -133,6 +141,7 @@ export class LevelSelector extends UICorePlugin {
|
|
|
133
141
|
* @internal
|
|
134
142
|
*/
|
|
135
143
|
render() {
|
|
144
|
+
assert(this.core.getPlugin('bottom_gear'), 'bottom_gear plugin is required');
|
|
136
145
|
if (!this.shouldRender()) {
|
|
137
146
|
return this;
|
|
138
147
|
}
|
|
@@ -140,28 +149,20 @@ export class LevelSelector extends UICorePlugin {
|
|
|
140
149
|
return this;
|
|
141
150
|
}
|
|
142
151
|
renderButton() {
|
|
143
|
-
if (!this.buttonTemplate) {
|
|
144
|
-
this.buttonTemplate = template(buttonHtml);
|
|
145
|
-
}
|
|
146
152
|
if (!this.isOpen) {
|
|
147
|
-
const html =
|
|
153
|
+
const html = LevelSelector.buttonTemplate({
|
|
148
154
|
arrowRightIcon,
|
|
149
155
|
currentText: this.currentText,
|
|
150
156
|
isHd: this.isHd,
|
|
151
157
|
hdIcon,
|
|
152
158
|
});
|
|
153
159
|
this.$el.html(html);
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
?.find('.gear-options-list [data-quality]')
|
|
157
|
-
?.html(this.el);
|
|
160
|
+
const gear = this.core.getPlugin('bottom_gear');
|
|
161
|
+
gear.getElement('quality')?.html(this.el);
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
renderDropdown() {
|
|
161
|
-
|
|
162
|
-
this.listTemplate = template(listHtml);
|
|
163
|
-
}
|
|
164
|
-
const html = this.listTemplate({
|
|
165
|
+
const html = LevelSelector.listTemplate({
|
|
165
166
|
arrowLeftIcon,
|
|
166
167
|
checkIcon,
|
|
167
168
|
labels: this.levelLabels,
|
|
@@ -170,8 +171,8 @@ export class LevelSelector extends UICorePlugin {
|
|
|
170
171
|
removeAuto: this.removeAuto,
|
|
171
172
|
});
|
|
172
173
|
this.$el.html(html);
|
|
173
|
-
const
|
|
174
|
-
|
|
174
|
+
const gear = this.core.getPlugin('bottom_gear');
|
|
175
|
+
gear?.setContent(this.el);
|
|
175
176
|
}
|
|
176
177
|
get maxLevel() {
|
|
177
178
|
const maxRes = this.core.options.levelSelector?.restrictResolution;
|
|
@@ -6,7 +6,7 @@ import '../../../assets/media-control/plugins.scss';
|
|
|
6
6
|
* Media control elements, mount points for additional plugins
|
|
7
7
|
* @beta
|
|
8
8
|
*/
|
|
9
|
-
export type MediaControlElement = 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer';
|
|
9
|
+
export type MediaControlElement = 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer' | 'subtitlesSelector';
|
|
10
10
|
/**
|
|
11
11
|
* The MediaControl provides a foundation for developing custom media controls UI.
|
|
12
12
|
* @beta
|
|
@@ -207,7 +207,6 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
207
207
|
private hide;
|
|
208
208
|
private updateCursorStyle;
|
|
209
209
|
private settingsUpdate;
|
|
210
|
-
private getSettings;
|
|
211
210
|
private highDefinitionUpdate;
|
|
212
211
|
private createCachedElements;
|
|
213
212
|
/**
|
|
@@ -229,6 +228,11 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
229
228
|
* ```
|
|
230
229
|
*/
|
|
231
230
|
getElement(name: MediaControlElement): ZeptoResult | null;
|
|
231
|
+
/**
|
|
232
|
+
* Get the right panel area to append custom elements to
|
|
233
|
+
* @returns ZeptoSelector of the right panel element
|
|
234
|
+
*/
|
|
235
|
+
getRightPanel(): any;
|
|
232
236
|
private resetIndicators;
|
|
233
237
|
private initializeIcons;
|
|
234
238
|
private setSeekPercentage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaControl.d.ts","sourceRoot":"","sources":["../../../src/plugins/media-control/MediaControl.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,EAMZ,IAAI,EACL,MAAM,cAAc,CAAA;AAOrB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGlD,OAAO,kDAAkD,CAAA;AACzD,OAAO,4CAA4C,CAAA;AAWnD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,YAAY,GACZ,UAAU,GACV,MAAM,GACN,KAAK,GACL,cAAc,GACd,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"MediaControl.d.ts","sourceRoot":"","sources":["../../../src/plugins/media-control/MediaControl.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,EAMZ,IAAI,EACL,MAAM,cAAc,CAAA;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