@gcorevideo/player 2.22.4 → 2.22.5
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/button.ejs +1 -1
- package/assets/level-selector/list.ejs +10 -4
- package/assets/level-selector/style.scss +8 -3
- package/dist/core.js +1 -1
- package/dist/index.css +1337 -1333
- package/dist/index.js +329 -326
- package/dist/plugins/index.css +626 -622
- package/dist/plugins/index.js +305 -302
- package/lib/index.plugins.d.ts +2 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -1
- package/lib/plugins/level-selector/LevelSelector.d.ts +6 -5
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +11 -8
- package/lib/plugins/level-selector/QualityLevels.d.ts +112 -0
- package/lib/plugins/level-selector/QualityLevels.d.ts.map +1 -0
- package/lib/plugins/level-selector/QualityLevels.js +280 -0
- package/lib/plugins/vast-ads/VastAds.d.ts +1 -0
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.js +6 -3
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -1
- package/src/plugins/level-selector/{LevelSelector.ts → QualityLevels.ts} +19 -13
- package/src/plugins/level-selector/__tests__/{LevelSelector.test.ts → QualityLevels.test.ts} +20 -6
- package/src/plugins/level-selector/__tests__/__snapshots__/{LevelSelector.test.ts.snap → QualityLevels.test.ts.snap} +58 -25
- package/src/plugins/vast-ads/VastAds.ts +8 -4
- package/tsconfig.tsbuildinfo +1 -1
package/lib/index.plugins.d.ts
CHANGED
|
@@ -12,13 +12,14 @@ export * from "./plugins/dvr-controls/DvrControls.js";
|
|
|
12
12
|
export * from "./plugins/error-screen/ErrorScreen.js";
|
|
13
13
|
export * from "./plugins/favicon/Favicon.js";
|
|
14
14
|
export * from "./plugins/google-analytics/GoogleAnalytics.js";
|
|
15
|
-
export * from "./plugins/level-selector/LevelSelector.js";
|
|
16
15
|
export * from "./plugins/logo/Logo.js";
|
|
17
16
|
export * from "./plugins/media-control/MediaControl.js";
|
|
18
17
|
export * from "./plugins/multi-camera/MultiCamera.js";
|
|
19
18
|
export * from "./plugins/picture-in-picture/PictureInPicture.js";
|
|
20
19
|
export * from "./plugins/playback-rate/PlaybackRate.js";
|
|
21
20
|
export * from "./plugins/poster/Poster.js";
|
|
21
|
+
export * from "./plugins/level-selector/QualityLevels.js";
|
|
22
|
+
export { QualityLevels as LevelSelector } from "./plugins/level-selector/QualityLevels.js";
|
|
22
23
|
export * from "./plugins/seek-time/SeekTime.js";
|
|
23
24
|
export * from "./plugins/share/Share.js";
|
|
24
25
|
export * from "./plugins/skip-time/SkipTime.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.plugins.d.ts","sourceRoot":"","sources":["../src/index.plugins.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAEnC,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,2CAA2C,CAAC;AACzF,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,
|
|
1
|
+
{"version":3,"file":"index.plugins.d.ts","sourceRoot":"","sources":["../src/index.plugins.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAEnC,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,2CAA2C,CAAC;AACzF,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wBAAwB,CAAC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC3F,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sDAAsD,CAAC;AACrE,OAAO,EAAE,kBAAkB,IAAI,OAAO,EAAE,MAAM,sDAAsD,CAAC;AACrG,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACpF,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,qCAAqC,CAAC"}
|
package/lib/index.plugins.js
CHANGED
|
@@ -13,13 +13,14 @@ export * from "./plugins/error-screen/ErrorScreen.js";
|
|
|
13
13
|
export * from "./plugins/favicon/Favicon.js";
|
|
14
14
|
// _ ga-events
|
|
15
15
|
export * from "./plugins/google-analytics/GoogleAnalytics.js";
|
|
16
|
-
export * from "./plugins/level-selector/LevelSelector.js";
|
|
17
16
|
export * from "./plugins/logo/Logo.js";
|
|
18
17
|
export * from "./plugins/media-control/MediaControl.js";
|
|
19
18
|
export * from "./plugins/multi-camera/MultiCamera.js";
|
|
20
19
|
export * from "./plugins/picture-in-picture/PictureInPicture.js";
|
|
21
20
|
export * from "./plugins/playback-rate/PlaybackRate.js";
|
|
22
21
|
export * from "./plugins/poster/Poster.js";
|
|
22
|
+
export * from "./plugins/level-selector/QualityLevels.js";
|
|
23
|
+
export { QualityLevels as LevelSelector } from "./plugins/level-selector/QualityLevels.js";
|
|
23
24
|
export * from "./plugins/seek-time/SeekTime.js";
|
|
24
25
|
export * from "./plugins/share/Share.js";
|
|
25
26
|
export * from "./plugins/skip-time/SkipTime.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/level-selector/style.scss';
|
|
3
3
|
/**
|
|
4
|
-
* Configuration options for the {@link
|
|
4
|
+
* Configuration options for the {@link QualityLevels} plugin.
|
|
5
5
|
* @beta
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface QualityLevelsPluginSettings {
|
|
8
8
|
/**
|
|
9
9
|
* The maximum resolution to allow in the level selector.
|
|
10
10
|
*/
|
|
@@ -31,19 +31,19 @@ export interface LevelSelectorPluginSettings {
|
|
|
31
31
|
*
|
|
32
32
|
* The plugin is rendered as an item in the gear menu, which, when clicked, shows a list of quality levels to choose from.
|
|
33
33
|
*
|
|
34
|
-
* Configuration options - {@link
|
|
34
|
+
* Configuration options - {@link QualityLevelsPluginSettings}
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```ts
|
|
38
38
|
* new Player({
|
|
39
|
-
*
|
|
39
|
+
* qualityLevels: {
|
|
40
40
|
* restrictResolution: 360,
|
|
41
41
|
* labels: { 360: 'SD', 720: 'HD' },
|
|
42
42
|
* },
|
|
43
43
|
* })
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
|
-
export declare class
|
|
46
|
+
export declare class QualityLevels extends UICorePlugin {
|
|
47
47
|
private levels;
|
|
48
48
|
private levelLabels;
|
|
49
49
|
private removeAuto;
|
|
@@ -93,6 +93,7 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
93
93
|
render(): this;
|
|
94
94
|
private renderDropdown;
|
|
95
95
|
private updateButton;
|
|
96
|
+
private get pluginOptions();
|
|
96
97
|
private get maxLevel();
|
|
97
98
|
private onLevelsAvailable;
|
|
98
99
|
private makeLevelsLabels;
|
|
@@ -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;AAgB7D,OAAO,2CAA2C,CAAA;AAMlD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,WAAW,CAAe;IAElC,OAAO,CAAC,UAAU,CAAQ;IAE1B,OAAO,CAAC,IAAI,CAAQ;IAEpB,OAAO,CAAC,WAAW,CAAK;IAExB,OAAO,CAAC,eAAe,CAAK;IAE5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAChB;IAEtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAuC;IAE3E;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,uBAAuB;IAoC/B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AC,QAAQ,CAAC,YAAY,CAAuC;IAE3E;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,uBAAuB;IAoC/B,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,YAAY;IAcpB;;OAEG;IACM,MAAM;IAUf,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,YAAY;IAcpB,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,KAAK,QAAQ,GASnB;IAED,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,qBAAqB;CAkB9B"}
|
|
@@ -25,19 +25,19 @@ const VERSION = '2.19.4';
|
|
|
25
25
|
*
|
|
26
26
|
* The plugin is rendered as an item in the gear menu, which, when clicked, shows a list of quality levels to choose from.
|
|
27
27
|
*
|
|
28
|
-
* Configuration options - {@link
|
|
28
|
+
* Configuration options - {@link QualityLevelsPluginSettings}
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```ts
|
|
32
32
|
* new Player({
|
|
33
|
-
*
|
|
33
|
+
* qualityLevels: {
|
|
34
34
|
* restrictResolution: 360,
|
|
35
35
|
* labels: { 360: 'SD', 720: 'HD' },
|
|
36
36
|
* },
|
|
37
37
|
* })
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
export class
|
|
40
|
+
export class QualityLevels extends UICorePlugin {
|
|
41
41
|
levels = [];
|
|
42
42
|
levelLabels = [];
|
|
43
43
|
removeAuto = false;
|
|
@@ -156,7 +156,7 @@ export class LevelSelector extends UICorePlugin {
|
|
|
156
156
|
return this;
|
|
157
157
|
}
|
|
158
158
|
renderDropdown() {
|
|
159
|
-
this.$el.html(
|
|
159
|
+
this.$el.html(QualityLevels.listTemplate({
|
|
160
160
|
arrowLeftIcon,
|
|
161
161
|
checkIcon,
|
|
162
162
|
current: this.selectedLevelId,
|
|
@@ -171,7 +171,7 @@ export class LevelSelector extends UICorePlugin {
|
|
|
171
171
|
;
|
|
172
172
|
this.core.getPlugin('bottom_gear')
|
|
173
173
|
?.addItem('quality', this.$el)
|
|
174
|
-
.html(
|
|
174
|
+
.html(QualityLevels.buttonTemplate({
|
|
175
175
|
arrowRightIcon,
|
|
176
176
|
currentText: this.currentText,
|
|
177
177
|
isHd: this.isHd,
|
|
@@ -179,15 +179,18 @@ export class LevelSelector extends UICorePlugin {
|
|
|
179
179
|
i18n: this.core.i18n,
|
|
180
180
|
}));
|
|
181
181
|
}
|
|
182
|
+
get pluginOptions() {
|
|
183
|
+
return this.core.options.qualityLevels || this.core.options.levelSelector;
|
|
184
|
+
}
|
|
182
185
|
get maxLevel() {
|
|
183
|
-
const maxRes = this.
|
|
186
|
+
const maxRes = this.pluginOptions.restrictResolution;
|
|
184
187
|
return maxRes
|
|
185
188
|
? this.levels.find((level) => (level.height > level.width ? level.width : level.height) ===
|
|
186
189
|
maxRes)?.level ?? -1
|
|
187
190
|
: -1;
|
|
188
191
|
}
|
|
189
192
|
onLevelsAvailable(levels) {
|
|
190
|
-
const maxResolution = this.
|
|
193
|
+
const maxResolution = this.pluginOptions.restrictResolution;
|
|
191
194
|
this.levels = levels;
|
|
192
195
|
this.makeLevelsLabels();
|
|
193
196
|
if (maxResolution) {
|
|
@@ -201,7 +204,7 @@ export class LevelSelector extends UICorePlugin {
|
|
|
201
204
|
this.render();
|
|
202
205
|
}
|
|
203
206
|
makeLevelsLabels() {
|
|
204
|
-
const labels = this.
|
|
207
|
+
const labels = this.pluginOptions.labels ?? {};
|
|
205
208
|
this.levelLabels = [];
|
|
206
209
|
for (const level of this.levels) {
|
|
207
210
|
const ll = level.width > level.height ? level.height : level.width;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { UICorePlugin } from '@clappr/core';
|
|
2
|
+
import '../../../assets/level-selector/style.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for the {@link QualityLevels} plugin.
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
export interface QualityLevelsPluginSettings {
|
|
8
|
+
/**
|
|
9
|
+
* The maximum resolution to allow in the level selector.
|
|
10
|
+
*/
|
|
11
|
+
restrictResolution?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The labels to show in the level selector.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* { 360: 'SD', 720: 'HD' }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
labels?: Record<number, string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
23
|
+
* @beta
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Depends on:
|
|
27
|
+
*
|
|
28
|
+
* - {@link MediaControl}
|
|
29
|
+
*
|
|
30
|
+
* - {@link BottomGear}
|
|
31
|
+
*
|
|
32
|
+
* The plugin is rendered as an item in the gear menu, which, when clicked, shows a list of quality levels to choose from.
|
|
33
|
+
*
|
|
34
|
+
* Configuration options - {@link QualityLevelsPluginSettings}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* new Player({
|
|
39
|
+
* qualityLevels: {
|
|
40
|
+
* restrictResolution: 360,
|
|
41
|
+
* labels: { 360: 'SD', 720: 'HD' },
|
|
42
|
+
* },
|
|
43
|
+
* })
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class QualityLevels extends UICorePlugin {
|
|
47
|
+
private levels;
|
|
48
|
+
private levelLabels;
|
|
49
|
+
private removeAuto;
|
|
50
|
+
private isHd;
|
|
51
|
+
private currentText;
|
|
52
|
+
private selectedLevelId;
|
|
53
|
+
private static readonly buttonTemplate;
|
|
54
|
+
private static readonly listTemplate;
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
get name(): string;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
get supportedVersion(): {
|
|
63
|
+
min: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
static get version(): string;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
get attributes(): {
|
|
73
|
+
class: string;
|
|
74
|
+
'data-level-selector': string;
|
|
75
|
+
};
|
|
76
|
+
get events(): {
|
|
77
|
+
'click .gear-sub-menu_btn': string;
|
|
78
|
+
'click .go-back': string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
bindEvents(): void;
|
|
84
|
+
private onCoreReady;
|
|
85
|
+
private onGearRendered;
|
|
86
|
+
private onActiveContainerChange;
|
|
87
|
+
private updateHd;
|
|
88
|
+
private onStop;
|
|
89
|
+
private shouldRender;
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
render(): this;
|
|
94
|
+
private renderDropdown;
|
|
95
|
+
private updateButton;
|
|
96
|
+
private get pluginOptions();
|
|
97
|
+
private get maxLevel();
|
|
98
|
+
private onLevelsAvailable;
|
|
99
|
+
private makeLevelsLabels;
|
|
100
|
+
private onSelect;
|
|
101
|
+
private goBack;
|
|
102
|
+
private setLevel;
|
|
103
|
+
private allLevelElements;
|
|
104
|
+
private levelElement;
|
|
105
|
+
private onLevelSwitchStart;
|
|
106
|
+
private onLevelSwitchEnd;
|
|
107
|
+
private updateText;
|
|
108
|
+
private getLevelLabel;
|
|
109
|
+
private onBitrate;
|
|
110
|
+
private highlightCurrentLevel;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=QualityLevels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QualityLevels.d.ts","sourceRoot":"","sources":["../../../src/plugins/level-selector/QualityLevels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAA;AAgB7D,OAAO,2CAA2C,CAAA;AAMlD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,WAAW,CAAe;IAElC,OAAO,CAAC,UAAU,CAAQ;IAE1B,OAAO,CAAC,IAAI,CAAQ;IAEpB,OAAO,CAAC,WAAW,CAAK;IAExB,OAAO,CAAC,eAAe,CAAK;IAE5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAChB;IAEtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAuC;IAE3E;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,uBAAuB;IAoC/B,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,YAAY;IAcpB;;OAEG;IACM,MAAM;IAUf,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,YAAY;IAcpB,OAAO,KAAK,aAAa,GAIxB;IAED,OAAO,KAAK,QAAQ,GASnB;IAED,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,qBAAqB;CAkB9B"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Events, template, UICorePlugin } from '@clappr/core';
|
|
2
|
+
import { trace } from '@gcorevideo/utils';
|
|
3
|
+
import assert from 'assert';
|
|
4
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
5
|
+
import { GearEvents } from '../bottom-gear/BottomGear.js';
|
|
6
|
+
import buttonHtml from '../../../assets/level-selector/button.ejs';
|
|
7
|
+
import listHtml from '../../../assets/level-selector/list.ejs';
|
|
8
|
+
import hdIcon from '../../../assets/icons/new/hd.svg';
|
|
9
|
+
import arrowRightIcon from '../../../assets/icons/new/arrow-right.svg';
|
|
10
|
+
import arrowLeftIcon from '../../../assets/icons/new/arrow-left.svg';
|
|
11
|
+
import checkIcon from '../../../assets/icons/new/check.svg';
|
|
12
|
+
import '../../../assets/level-selector/style.scss';
|
|
13
|
+
const T = 'plugins.quality_levels';
|
|
14
|
+
const VERSION = 'v2.22.5';
|
|
15
|
+
/**
|
|
16
|
+
* `PLUGIN` that provides a UI to select the desired quality level of the playback.
|
|
17
|
+
* @beta
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Depends on:
|
|
21
|
+
*
|
|
22
|
+
* - {@link MediaControl}
|
|
23
|
+
*
|
|
24
|
+
* - {@link BottomGear}
|
|
25
|
+
*
|
|
26
|
+
* The plugin is rendered as an item in the gear menu, which, when clicked, shows a list of quality levels to choose from.
|
|
27
|
+
*
|
|
28
|
+
* Configuration options - {@link QualityLevelsPluginSettings}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* new Player({
|
|
33
|
+
* qualityLevels: {
|
|
34
|
+
* restrictResolution: 360,
|
|
35
|
+
* labels: { 360: 'SD', 720: 'HD' },
|
|
36
|
+
* },
|
|
37
|
+
* })
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class QualityLevels extends UICorePlugin {
|
|
41
|
+
levels = [];
|
|
42
|
+
levelLabels = [];
|
|
43
|
+
removeAuto = false;
|
|
44
|
+
isHd = false;
|
|
45
|
+
currentText = '';
|
|
46
|
+
selectedLevelId = -1;
|
|
47
|
+
static buttonTemplate = template(buttonHtml);
|
|
48
|
+
static listTemplate = template(listHtml);
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
get name() {
|
|
53
|
+
return 'level_selector';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
get supportedVersion() {
|
|
59
|
+
return { min: CLAPPR_VERSION };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
static get version() {
|
|
65
|
+
return VERSION;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
get attributes() {
|
|
71
|
+
return {
|
|
72
|
+
class: 'level-selector',
|
|
73
|
+
'data-level-selector': '',
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
get events() {
|
|
77
|
+
return {
|
|
78
|
+
'click .gear-sub-menu_btn': 'onSelect',
|
|
79
|
+
'click .go-back': 'goBack',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
bindEvents() {
|
|
86
|
+
this.listenToOnce(this.core, Events.CORE_READY, this.onCoreReady);
|
|
87
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChange);
|
|
88
|
+
}
|
|
89
|
+
onCoreReady() {
|
|
90
|
+
trace(`${T} onCoreReady`);
|
|
91
|
+
const gear = this.core.getPlugin('bottom_gear');
|
|
92
|
+
assert(gear, 'bottom_gear plugin is required');
|
|
93
|
+
this.currentText = this.core.i18n.t('auto');
|
|
94
|
+
this.listenTo(gear, GearEvents.RENDERED, this.onGearRendered);
|
|
95
|
+
}
|
|
96
|
+
onGearRendered() {
|
|
97
|
+
trace(`${T} onGearRendered`);
|
|
98
|
+
this.render();
|
|
99
|
+
}
|
|
100
|
+
onActiveContainerChange() {
|
|
101
|
+
this.removeAuto = false;
|
|
102
|
+
this.isHd = false;
|
|
103
|
+
const activePlayback = this.core.activePlayback;
|
|
104
|
+
this.listenTo(activePlayback, Events.PLAYBACK_LEVELS_AVAILABLE, this.onLevelsAvailable);
|
|
105
|
+
this.listenTo(activePlayback, Events.PLAYBACK_LEVEL_SWITCH_START, this.onLevelSwitchStart);
|
|
106
|
+
this.listenTo(activePlayback, Events.PLAYBACK_LEVEL_SWITCH_END, this.onLevelSwitchEnd);
|
|
107
|
+
this.listenTo(activePlayback, Events.PLAYBACK_BITRATE, this.onBitrate);
|
|
108
|
+
this.listenTo(activePlayback, Events.PLAYBACK_STOP, this.onStop);
|
|
109
|
+
this.listenTo(activePlayback, Events.PLAYBACK_HIGHDEFINITIONUPDATE, (isHd) => {
|
|
110
|
+
this.isHd = isHd;
|
|
111
|
+
this.updateHd();
|
|
112
|
+
});
|
|
113
|
+
if (activePlayback.levels?.length > 0) {
|
|
114
|
+
this.onLevelsAvailable(activePlayback.levels);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
updateHd() {
|
|
118
|
+
if (this.isHd) {
|
|
119
|
+
this.$el.find('.gear-option_hd-icon').removeClass('hidden');
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
this.$el.find('.gear-option_hd-icon').addClass('hidden');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
onStop() {
|
|
126
|
+
trace(`${T} onStop`);
|
|
127
|
+
this.listenToOnce(this.core.activePlayback, Events.PLAYBACK_PLAY, () => {
|
|
128
|
+
if (this.core.activePlayback.getPlaybackType() === 'live') {
|
|
129
|
+
if (this.selectedLevelId !== -1) {
|
|
130
|
+
this.core.activePlayback.currentLevel = this.selectedLevelId;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
shouldRender() {
|
|
136
|
+
const activePlayback = this.core.activePlayback;
|
|
137
|
+
if (!activePlayback) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
const supportsCurrentLevel = 'currentLevel' in activePlayback;
|
|
141
|
+
if (!supportsCurrentLevel) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
// Only care if we have at least 2 to choose from
|
|
145
|
+
return !!(this.levels && this.levels.length > 1);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
render() {
|
|
151
|
+
if (!this.shouldRender()) {
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
this.renderDropdown();
|
|
155
|
+
this.updateButton();
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
renderDropdown() {
|
|
159
|
+
this.$el.html(QualityLevels.listTemplate({
|
|
160
|
+
arrowLeftIcon,
|
|
161
|
+
checkIcon,
|
|
162
|
+
current: this.selectedLevelId,
|
|
163
|
+
labels: this.levelLabels,
|
|
164
|
+
levels: this.levels,
|
|
165
|
+
maxLevel: this.maxLevel,
|
|
166
|
+
removeAuto: this.removeAuto,
|
|
167
|
+
i18n: this.core.i18n,
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
updateButton() {
|
|
171
|
+
;
|
|
172
|
+
this.core.getPlugin('bottom_gear')
|
|
173
|
+
?.addItem('quality', this.$el)
|
|
174
|
+
.html(QualityLevels.buttonTemplate({
|
|
175
|
+
arrowRightIcon,
|
|
176
|
+
currentText: this.currentText,
|
|
177
|
+
isHd: this.isHd,
|
|
178
|
+
hdIcon,
|
|
179
|
+
i18n: this.core.i18n,
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
get pluginOptions() {
|
|
183
|
+
return (this.core.options.qualityLevels || this.core.options.levelSelector || {});
|
|
184
|
+
}
|
|
185
|
+
get maxLevel() {
|
|
186
|
+
const maxRes = this.pluginOptions.restrictResolution;
|
|
187
|
+
return maxRes
|
|
188
|
+
? this.levels.find((level) => (level.height > level.width ? level.width : level.height) ===
|
|
189
|
+
maxRes)?.level ?? -1
|
|
190
|
+
: -1;
|
|
191
|
+
}
|
|
192
|
+
onLevelsAvailable(levels) {
|
|
193
|
+
const maxResolution = this.pluginOptions.restrictResolution;
|
|
194
|
+
this.levels = levels;
|
|
195
|
+
this.makeLevelsLabels();
|
|
196
|
+
if (maxResolution) {
|
|
197
|
+
this.removeAuto = true;
|
|
198
|
+
const initialLevel = levels
|
|
199
|
+
.filter((level) => (level.width > level.height ? level.height : level.width) <=
|
|
200
|
+
maxResolution)
|
|
201
|
+
.pop();
|
|
202
|
+
this.setLevel(initialLevel?.level ?? 0);
|
|
203
|
+
}
|
|
204
|
+
this.render();
|
|
205
|
+
}
|
|
206
|
+
makeLevelsLabels() {
|
|
207
|
+
const labels = this.pluginOptions.labels ?? {};
|
|
208
|
+
this.levelLabels = [];
|
|
209
|
+
for (const level of this.levels) {
|
|
210
|
+
const ll = level.width > level.height ? level.height : level.width;
|
|
211
|
+
const label = labels[ll] || `${ll}p`;
|
|
212
|
+
this.levelLabels.push(label);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
onSelect(event) {
|
|
216
|
+
const selectedLevel = parseInt(event.currentTarget?.dataset?.id ?? '-1', 10);
|
|
217
|
+
this.setLevel(selectedLevel);
|
|
218
|
+
event.stopPropagation();
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
goBack() {
|
|
223
|
+
trace(`${T} goBack`);
|
|
224
|
+
this.core.getPlugin('bottom_gear').refresh();
|
|
225
|
+
}
|
|
226
|
+
setLevel(index) {
|
|
227
|
+
this.selectedLevelId = index;
|
|
228
|
+
this.core.activePlayback.currentLevel = this.selectedLevelId;
|
|
229
|
+
this.highlightCurrentLevel();
|
|
230
|
+
}
|
|
231
|
+
allLevelElements() {
|
|
232
|
+
return this.$('#level-selector-menu li');
|
|
233
|
+
}
|
|
234
|
+
levelElement(id = -1) {
|
|
235
|
+
return this.$(`#level-selector-menu a[data-id="${id}"]`).parent();
|
|
236
|
+
}
|
|
237
|
+
onLevelSwitchStart() {
|
|
238
|
+
this.levelElement(this.selectedLevelId).addClass('changing');
|
|
239
|
+
}
|
|
240
|
+
onLevelSwitchEnd() {
|
|
241
|
+
this.levelElement(this.selectedLevelId).removeClass('changing');
|
|
242
|
+
}
|
|
243
|
+
updateText(level) {
|
|
244
|
+
this.currentText = this.getLevelLabel(level);
|
|
245
|
+
this.updateButton();
|
|
246
|
+
}
|
|
247
|
+
getLevelLabel(id) {
|
|
248
|
+
if (id < 0) {
|
|
249
|
+
return this.core.i18n.t('auto');
|
|
250
|
+
}
|
|
251
|
+
const index = this.levels.findIndex((l) => l.level === id);
|
|
252
|
+
if (index < 0) {
|
|
253
|
+
return this.core.i18n.t('auto');
|
|
254
|
+
}
|
|
255
|
+
return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
|
|
256
|
+
}
|
|
257
|
+
onBitrate(info) {
|
|
258
|
+
trace(`${T} updateCurrentLevel`, { info });
|
|
259
|
+
this.highlightCurrentLevel();
|
|
260
|
+
}
|
|
261
|
+
highlightCurrentLevel() {
|
|
262
|
+
trace(`${T} highlightCurrentLevel`, {
|
|
263
|
+
selectedLevelId: this.selectedLevelId,
|
|
264
|
+
});
|
|
265
|
+
this.allLevelElements()
|
|
266
|
+
.removeClass('current')
|
|
267
|
+
.find('a')
|
|
268
|
+
.removeClass('gcore-skin-active');
|
|
269
|
+
const currentLevelElement = this.levelElement(this.selectedLevelId);
|
|
270
|
+
currentLevelElement
|
|
271
|
+
.addClass('current')
|
|
272
|
+
.find('a')
|
|
273
|
+
.addClass('gcore-skin-active');
|
|
274
|
+
this.updateText(this.selectedLevelId);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function formatLevelLabel(level) {
|
|
278
|
+
const h = level.width > level.height ? level.height : level.width;
|
|
279
|
+
return `${h}p`;
|
|
280
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VastAds.d.ts","sourceRoot":"","sources":["../../../src/plugins/vast-ads/VastAds.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIJ,QAAQ,EAER,YAAY,EAEb,MAAM,cAAc,CAAA;AAarB,OAAO,qCAAqC,CAAA;AAQ5C,qBAAa,OAAQ,SAAQ,YAAY;IACvC,OAAO,CAAC,mBAAmB,CAAiC;IAE5D,OAAO,CAAC,qBAAqB,CAAwC;IAErE,OAAO,CAAC,oBAAoB,CAAwC;IAEpE,OAAO,CAAC,eAAe,CAAI;IAE3B,OAAO,CAAC,mBAAmB,CAAI;IAE/B,OAAO,CAAC,UAAU,CAAyB;IAE3C,OAAO,CAAC,SAAS,CAAyB;IAE1C,OAAO,CAAC,eAAe,CAA2B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+345,11 @@ export class VastAds extends UICorePlugin {
|
|
|
345
345
|
// @ts-ignore
|
|
346
346
|
this.stopListening(this.playback, Events.PLAYBACK_PAUSE);
|
|
347
347
|
}
|
|
348
|
+
get pluginOptions() {
|
|
349
|
+
return this.options.vastAds;
|
|
350
|
+
}
|
|
348
351
|
_pauserollListeners() {
|
|
349
|
-
if (!this._validateData(this.
|
|
352
|
+
if (!this._validateData(this.pluginOptions.pauseroll)) {
|
|
350
353
|
return;
|
|
351
354
|
}
|
|
352
355
|
this._stopPauserollListeners();
|
|
@@ -571,11 +574,11 @@ export class VastAds extends UICorePlugin {
|
|
|
571
574
|
// const currentRoll = type;
|
|
572
575
|
this.destroyRoll();
|
|
573
576
|
if (currentRoll === 'preroll') {
|
|
574
|
-
this.
|
|
577
|
+
this.pluginOptions[currentRoll] = [];
|
|
575
578
|
}
|
|
576
579
|
this.currentState = '';
|
|
577
580
|
this.$el.hide();
|
|
578
|
-
if (!this.options.disableClickOnPause) {
|
|
581
|
+
if (!this.options.disableClickOnPause) { // TODO sort out
|
|
579
582
|
this._clickToPausePlugin?.enable();
|
|
580
583
|
}
|
|
581
584
|
try {
|
package/package.json
CHANGED
package/src/index.plugins.ts
CHANGED
|
@@ -14,13 +14,14 @@ export * from "./plugins/error-screen/ErrorScreen.js";
|
|
|
14
14
|
export * from "./plugins/favicon/Favicon.js";
|
|
15
15
|
// _ ga-events
|
|
16
16
|
export * from "./plugins/google-analytics/GoogleAnalytics.js";
|
|
17
|
-
export * from "./plugins/level-selector/LevelSelector.js";
|
|
18
17
|
export * from "./plugins/logo/Logo.js";
|
|
19
18
|
export * from "./plugins/media-control/MediaControl.js";
|
|
20
19
|
export * from "./plugins/multi-camera/MultiCamera.js";
|
|
21
20
|
export * from "./plugins/picture-in-picture/PictureInPicture.js";
|
|
22
21
|
export * from "./plugins/playback-rate/PlaybackRate.js";
|
|
23
22
|
export * from "./plugins/poster/Poster.js";
|
|
23
|
+
export * from "./plugins/level-selector/QualityLevels.js";
|
|
24
|
+
export { QualityLevels as LevelSelector } from "./plugins/level-selector/QualityLevels.js";
|
|
24
25
|
export * from "./plugins/seek-time/SeekTime.js";
|
|
25
26
|
export * from "./plugins/share/Share.js";
|
|
26
27
|
export * from "./plugins/skip-time/SkipTime.js";
|