@gcorevideo/player 2.19.12 → 2.19.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +16 -11
- package/dist/index.css +1405 -1405
- package/dist/index.js +1239 -1088
- package/dist/player.d.ts +209 -45
- package/dist/plugins/index.css +1461 -1461
- package/dist/plugins/index.js +4005 -3858
- package/docs/api/player.bottomgear.md +3 -289
- package/docs/api/player.dvrcontrols._constructor_.md +3 -0
- package/docs/api/player.dvrcontrols.md +10 -201
- package/docs/api/player.levelselector.md +8 -140
- package/docs/api/player.md +9 -5
- package/docs/api/player.mediacontrol.disable.md +2 -0
- package/docs/api/player.mediacontrol.disabledcontrolbutton.md +1 -1
- package/docs/api/player.mediacontrol.enable.md +2 -0
- package/docs/api/player.mediacontrol.enablecontrolbutton.md +1 -1
- package/docs/api/player.mediacontrol.getelement.md +19 -1
- package/docs/api/player.mediacontrol.md +17 -281
- package/docs/api/player.mediacontrol.volume.md +2 -2
- package/docs/api/player.mediacontrolelement.md +2 -1
- package/docs/api/player.poster.disable.md +5 -0
- package/docs/api/player.poster.enable.md +5 -0
- package/docs/api/player.poster.md +25 -183
- package/lib/Player.d.ts +1 -0
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +15 -10
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/plugins/audio-selector/AudioSelector.js +2 -2
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +2 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts +38 -7
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +53 -33
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +20 -24
- package/lib/plugins/clappr-stats/ClapprStats.js +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- package/lib/plugins/clips/Clips.js +2 -2
- package/lib/plugins/context-menu/ContextMenu.js +1 -1
- package/lib/plugins/disable-controls/DisableControls.js +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +30 -4
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +39 -11
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +2 -1
- package/lib/plugins/favicon/Favicon.js +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.js +1 -1
- package/lib/plugins/level-selector/LevelSelector.d.ts +25 -6
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +33 -12
- package/lib/plugins/logo/Logo.js +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts +66 -22
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +72 -35
- package/lib/plugins/multi-camera/MultiCamera.js +3 -3
- package/lib/plugins/picture-in-picture/PictureInPicture.js +3 -3
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +3 -3
- package/lib/plugins/poster/Poster.d.ts +57 -3
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/poster/Poster.js +57 -9
- package/lib/plugins/seek-time/SeekTime.js +2 -2
- package/lib/plugins/share/Share.js +2 -2
- package/lib/plugins/skip-time/SkipTime.js +1 -1
- package/lib/plugins/source-controller/SourceController.js +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +1 -1
- package/lib/plugins/statistics/Statistics.js +1 -1
- package/lib/plugins/subtitles/Subtitles.js +3 -3
- package/lib/plugins/thumbnails/Thumbnails.js +3 -3
- package/lib/plugins/types.d.ts +1 -7
- package/lib/plugins/types.d.ts.map +1 -1
- 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 +2 -1
- package/src/Player.ts +15 -9
- package/src/__tests__/Player.test.ts +15 -76
- package/src/index.ts +1 -0
- package/src/plugins/audio-selector/AudioSelector.ts +2 -2
- package/src/plugins/big-mute-button/BigMuteButton.ts +2 -1
- package/src/plugins/bottom-gear/BottomGear.ts +67 -42
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +21 -26
- package/src/plugins/clappr-stats/ClapprStats.ts +1 -1
- package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
- package/src/plugins/clips/Clips.ts +2 -2
- package/src/plugins/context-menu/ContextMenu.ts +1 -1
- package/src/plugins/disable-controls/DisableControls.ts +1 -1
- package/src/plugins/dvr-controls/DvrControls.ts +42 -14
- package/src/plugins/error-screen/ErrorScreen.ts +2 -1
- package/src/plugins/favicon/Favicon.ts +1 -1
- package/src/plugins/google-analytics/GoogleAnalytics.ts +1 -1
- package/src/plugins/level-selector/LevelSelector.ts +34 -14
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +22 -2
- package/src/plugins/logo/Logo.ts +1 -1
- package/src/plugins/media-control/MediaControl.ts +83 -44
- package/src/plugins/multi-camera/MultiCamera.ts +3 -3
- package/src/plugins/picture-in-picture/PictureInPicture.ts +3 -3
- package/src/plugins/playback-rate/PlaybackRate.ts +3 -4
- package/src/plugins/poster/Poster.ts +59 -12
- package/src/plugins/seek-time/SeekTime.ts +2 -2
- package/src/plugins/share/Share.ts +2 -2
- package/src/plugins/skip-time/SkipTime.ts +1 -1
- package/src/plugins/source-controller/SourceController.ts +1 -1
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +5 -0
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +1 -1
- package/src/plugins/statistics/Statistics.ts +1 -1
- package/src/plugins/subtitles/Subtitles.ts +3 -3
- package/src/plugins/thumbnails/Thumbnails.ts +3 -3
- package/src/plugins/types.ts +1 -0
- package/src/plugins/vast-ads/VastAds.ts +6 -6
- package/temp/player.api.json +3301 -5030
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.bottomgear.attributes.md +0 -17
- package/docs/api/player.bottomgear.bindevents.md +0 -18
- package/docs/api/player.bottomgear.container.md +0 -14
- package/docs/api/player.bottomgear.events.md +0 -16
- package/docs/api/player.bottomgear.hide.md +0 -18
- package/docs/api/player.bottomgear.name.md +0 -14
- package/docs/api/player.bottomgear.refresh.md +0 -18
- package/docs/api/player.bottomgear.reload.md +0 -18
- package/docs/api/player.bottomgear.render.md +0 -18
- package/docs/api/player.bottomgear.supportedversion.md +0 -16
- package/docs/api/player.bottomgear.template.md +0 -14
- package/docs/api/player.bottomgear.togglegearmenu.md +0 -18
- package/docs/api/player.bottomgear.unbindevents.md +0 -18
- package/docs/api/player.bottomgear.version.md +0 -14
- package/docs/api/player.dvrcontrols.attributes.md +0 -14
- package/docs/api/player.dvrcontrols.bindevents.md +0 -15
- package/docs/api/player.dvrcontrols.click.md +0 -15
- package/docs/api/player.dvrcontrols.events.md +0 -13
- package/docs/api/player.dvrcontrols.name.md +0 -11
- package/docs/api/player.dvrcontrols.render.md +0 -15
- package/docs/api/player.dvrcontrols.settingsupdate.md +0 -15
- package/docs/api/player.dvrcontrols.shouldrender.md +0 -15
- package/docs/api/player.dvrcontrols.supportedversion.md +0 -13
- package/docs/api/player.dvrcontrols.template.md +0 -11
- package/docs/api/player.levelselector.attributes.md +0 -17
- package/docs/api/player.levelselector.bindevents.md +0 -18
- package/docs/api/player.levelselector.name.md +0 -14
- package/docs/api/player.levelselector.render.md +0 -18
- package/docs/api/player.levelselector.supportedversion.md +0 -16
- package/docs/api/player.levelselector.version.md +0 -14
- package/docs/api/player.mediacontrol.attributes.md +0 -17
- package/docs/api/player.mediacontrol.bindcontainerevents.md +0 -18
- package/docs/api/player.mediacontrol.bindevents.md +0 -18
- package/docs/api/player.mediacontrol.container.md +0 -14
- package/docs/api/player.mediacontrol.destroy.md +0 -18
- package/docs/api/player.mediacontrol.disabled.md +0 -14
- package/docs/api/player.mediacontrol.events.md +0 -40
- package/docs/api/player.mediacontrol.getexternalinterface.md +0 -21
- package/docs/api/player.mediacontrol.name.md +0 -14
- package/docs/api/player.mediacontrol.pause.md +0 -20
- package/docs/api/player.mediacontrol.play.md +0 -20
- package/docs/api/player.mediacontrol.playback.md +0 -14
- package/docs/api/player.mediacontrol.render.md +0 -18
- package/docs/api/player.mediacontrol.setmuted.md +0 -52
- package/docs/api/player.mediacontrol.stop.md +0 -20
- package/docs/api/player.mediacontrol.supportedversion.md +0 -16
- package/docs/api/player.poster.attributes.md +0 -14
- package/docs/api/player.poster.bindevents.md +0 -15
- package/docs/api/player.poster.destroy.md +0 -15
- package/docs/api/player.poster.events.md +0 -13
- package/docs/api/player.poster.name.md +0 -11
- package/docs/api/player.poster.render.md +0 -15
- package/docs/api/player.poster.shouldrender.md +0 -11
- package/docs/api/player.poster.showonvideoend.md +0 -11
- package/docs/api/player.poster.supportedversion.md +0 -13
- package/docs/api/player.poster.template.md +0 -11
- package/src/plugins/build.ts +0 -1
|
@@ -3,15 +3,22 @@ import { ZeptoResult } from '../../utils/types.js';
|
|
|
3
3
|
import '../../../assets/media-control/media-control.scss';
|
|
4
4
|
import '../../../assets/media-control/plugins.scss';
|
|
5
5
|
/**
|
|
6
|
+
* Media control elements, mount points for additional plugins
|
|
6
7
|
* @beta
|
|
7
8
|
*/
|
|
8
|
-
export type MediaControlElement = 'clipText' | 'pip' | 'seekBarContainer';
|
|
9
|
+
export type MediaControlElement = 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer';
|
|
9
10
|
/**
|
|
10
|
-
* The MediaControl
|
|
11
|
+
* The MediaControl provides a foundation for developing custom media controls UI.
|
|
11
12
|
* @beta
|
|
12
13
|
* @remarks
|
|
13
|
-
* This plugin provides a foundation for developing a media controls UI via additional plugins.
|
|
14
14
|
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
15
|
+
* The plugin registration should be arranged so that MediaControl is initialized before every other plugin that depends on it.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* Player.registerPlugin(MediaControl) // <--- This must go first
|
|
19
|
+
* Player.registerPlugin(LevelSelector) // a media control plugin
|
|
20
|
+
* Player.registerPlugin(NerdStats) // another media control plugin
|
|
21
|
+
* ```
|
|
15
22
|
*/
|
|
16
23
|
export declare class MediaControl extends UICorePlugin {
|
|
17
24
|
private advertisementPlaying;
|
|
@@ -37,7 +44,6 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
37
44
|
private persistConfig;
|
|
38
45
|
private rendered;
|
|
39
46
|
private settings;
|
|
40
|
-
private svgMask;
|
|
41
47
|
private userDisabled;
|
|
42
48
|
private userKeepVisible;
|
|
43
49
|
private verticalVolume;
|
|
@@ -66,17 +72,37 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
66
72
|
private $volumeContainer;
|
|
67
73
|
private $volumeIcon;
|
|
68
74
|
private static readonly template;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
69
78
|
get name(): string;
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
70
82
|
get supportedVersion(): {
|
|
71
83
|
min: string;
|
|
72
84
|
};
|
|
73
|
-
get disabled()
|
|
85
|
+
private get disabled();
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* @deprecated
|
|
89
|
+
*/
|
|
74
90
|
get container(): any;
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
* @deprecated
|
|
94
|
+
*/
|
|
75
95
|
get playback(): any;
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
76
99
|
get attributes(): {
|
|
77
100
|
class: string;
|
|
78
101
|
'data-media-control-skin-1': string;
|
|
79
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
80
106
|
get events(): {
|
|
81
107
|
'click [data-play]': string;
|
|
82
108
|
'click [data-pause]': string;
|
|
@@ -105,34 +131,34 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
105
131
|
'mouseleave .media-control-layer[data-controls]': string;
|
|
106
132
|
};
|
|
107
133
|
/**
|
|
108
|
-
* Current volume
|
|
134
|
+
* Current volume [0..100]
|
|
109
135
|
*/
|
|
110
|
-
get volume():
|
|
136
|
+
get volume(): number;
|
|
111
137
|
/**
|
|
112
138
|
* Muted state
|
|
113
139
|
*/
|
|
114
140
|
get muted(): boolean;
|
|
115
141
|
constructor(core: Core);
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
116
145
|
getExternalInterface(): {
|
|
117
146
|
setVolume: (value: number, isInitialVolume?: boolean) => void;
|
|
118
|
-
getVolume: () =>
|
|
147
|
+
getVolume: () => number;
|
|
119
148
|
};
|
|
120
|
-
bindEvents(): void;
|
|
121
|
-
bindContainerEvents(): void;
|
|
122
|
-
disable(): void;
|
|
123
|
-
enable(): void;
|
|
124
149
|
/**
|
|
125
|
-
*
|
|
150
|
+
* @internal
|
|
126
151
|
*/
|
|
127
|
-
|
|
152
|
+
bindEvents(): void;
|
|
153
|
+
private bindContainerEvents;
|
|
128
154
|
/**
|
|
129
|
-
*
|
|
155
|
+
* Disables the plugin and unmounts its UI
|
|
130
156
|
*/
|
|
131
|
-
|
|
157
|
+
disable(): void;
|
|
132
158
|
/**
|
|
133
|
-
*
|
|
159
|
+
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
134
160
|
*/
|
|
135
|
-
|
|
161
|
+
enable(): void;
|
|
136
162
|
/**
|
|
137
163
|
* Set the initial volume, which is preserved when playback is interrupted by an advertisement
|
|
138
164
|
*/
|
|
@@ -187,7 +213,20 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
187
213
|
/**
|
|
188
214
|
* Get a media control element DOM node
|
|
189
215
|
* @param name - The name of the media control element
|
|
190
|
-
* @returns The DOM node to render
|
|
216
|
+
* @returns The DOM node to render to or extend
|
|
217
|
+
* @remarks
|
|
218
|
+
* Use this method to render custom media control UI in a plugin
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* class MyPlugin extends UICorePlugin {
|
|
222
|
+
* override render() {
|
|
223
|
+
* const mediaControl = this.core.getPlugin('media_control')
|
|
224
|
+
* const clipText = mediaControl.getElement('clipText')
|
|
225
|
+
* clipText?.el.text('Here we go')
|
|
226
|
+
* return this
|
|
227
|
+
* }
|
|
228
|
+
* }
|
|
229
|
+
* ```
|
|
191
230
|
*/
|
|
192
231
|
getElement(name: MediaControlElement): ZeptoResult | null;
|
|
193
232
|
private resetIndicators;
|
|
@@ -199,22 +238,27 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
199
238
|
private unbindKeyEvents;
|
|
200
239
|
private parseColors;
|
|
201
240
|
private applyButtonStyle;
|
|
241
|
+
/**
|
|
242
|
+
* @internal
|
|
243
|
+
*/
|
|
202
244
|
destroy(): import("@clappr/core").UIObject;
|
|
203
245
|
private configure;
|
|
246
|
+
/**
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
204
249
|
render(): this;
|
|
205
250
|
private handleFullScreenOnBtn;
|
|
206
251
|
private onStartAd;
|
|
207
252
|
private onFinishAd;
|
|
208
253
|
private hideControllAds;
|
|
209
|
-
setMuted(value: boolean): void;
|
|
210
254
|
private static getPageX;
|
|
211
255
|
private static getPageY;
|
|
212
256
|
/**
|
|
213
|
-
* Enable the
|
|
257
|
+
* Enable the user interaction disabled earlier
|
|
214
258
|
*/
|
|
215
259
|
enableControlButton(): void;
|
|
216
260
|
/**
|
|
217
|
-
* Disable the control
|
|
261
|
+
* Disable the user interaction for the control buttons
|
|
218
262
|
*/
|
|
219
263
|
disabledControlButton(): void;
|
|
220
264
|
private isSeekEnabledForHtml5Playback;
|
|
@@ -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
|
|
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;AA6BtB;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,oBAAoB,CAAQ;IAEpC,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,CAAC,oBAAoB,CAAY;IACxC,OAAO,CAAC,oBAAoB,CAAY;IACxC,OAAO,CAAC,wBAAwB,CAAsB;IAEtD,OAAO,CAAC,qBAAqB,CAA0B;IACvD,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,0BAA0B,CAAsB;IAExD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,iBAAiB,CAAQ;IAEjC,OAAO,CAAC,6BAA6B,CAAuB;IAE5D,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,YAAY,CAA6C;IAEjE,OAAO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core';
|
|
6
6
|
import { reportError } from '@gcorevideo/utils';
|
|
7
7
|
import { Kibo } from '../kibo/index.js';
|
|
8
|
-
import { CLAPPR_VERSION } from '
|
|
8
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
9
9
|
import { getPageX, isFullscreen } from '../utils.js';
|
|
10
10
|
import '../../../assets/media-control/media-control.scss';
|
|
11
11
|
import '../../../assets/media-control/plugins.scss';
|
|
@@ -34,11 +34,17 @@ function orderByOrderPattern(arr, order) {
|
|
|
34
34
|
return [...ordered, ...rest];
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
* The MediaControl
|
|
37
|
+
* The MediaControl provides a foundation for developing custom media controls UI.
|
|
38
38
|
* @beta
|
|
39
39
|
* @remarks
|
|
40
|
-
* This plugin provides a foundation for developing a media controls UI via additional plugins.
|
|
41
40
|
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
41
|
+
* The plugin registration should be arranged so that MediaControl is initialized before every other plugin that depends on it.
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* Player.registerPlugin(MediaControl) // <--- This must go first
|
|
45
|
+
* Player.registerPlugin(LevelSelector) // a media control plugin
|
|
46
|
+
* Player.registerPlugin(NerdStats) // another media control plugin
|
|
47
|
+
* ```
|
|
42
48
|
*/
|
|
43
49
|
export class MediaControl extends UICorePlugin {
|
|
44
50
|
advertisementPlaying = false;
|
|
@@ -64,7 +70,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
64
70
|
persistConfig;
|
|
65
71
|
rendered = false;
|
|
66
72
|
settings = {};
|
|
67
|
-
svgMask = null;
|
|
68
73
|
userDisabled = false;
|
|
69
74
|
userKeepVisible = false;
|
|
70
75
|
verticalVolume = false;
|
|
@@ -93,9 +98,15 @@ export class MediaControl extends UICorePlugin {
|
|
|
93
98
|
$volumeContainer = null;
|
|
94
99
|
$volumeIcon = null;
|
|
95
100
|
static template = template(mediaControlHTML);
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
96
104
|
get name() {
|
|
97
105
|
return 'media_control';
|
|
98
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
99
110
|
get supportedVersion() {
|
|
100
111
|
return { min: CLAPPR_VERSION };
|
|
101
112
|
}
|
|
@@ -103,18 +114,32 @@ export class MediaControl extends UICorePlugin {
|
|
|
103
114
|
const playbackIsNOOP = this.container && this.container.getPlaybackType() === Playback.NO_OP;
|
|
104
115
|
return this.userDisabled || playbackIsNOOP;
|
|
105
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
* @deprecated
|
|
120
|
+
*/
|
|
106
121
|
get container() {
|
|
107
122
|
return this.core && this.core.activeContainer;
|
|
108
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* @internal
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
109
128
|
get playback() {
|
|
110
129
|
return this.core && this.core.activePlayback;
|
|
111
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
112
134
|
get attributes() {
|
|
113
135
|
return {
|
|
114
136
|
class: 'media-control-skin-1',
|
|
115
137
|
'data-media-control-skin-1': '',
|
|
116
138
|
};
|
|
117
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
118
143
|
get events() {
|
|
119
144
|
return {
|
|
120
145
|
'click [data-play]': 'play',
|
|
@@ -145,11 +170,11 @@ export class MediaControl extends UICorePlugin {
|
|
|
145
170
|
};
|
|
146
171
|
}
|
|
147
172
|
/**
|
|
148
|
-
* Current volume
|
|
173
|
+
* Current volume [0..100]
|
|
149
174
|
*/
|
|
150
175
|
get volume() {
|
|
151
|
-
return this.
|
|
152
|
-
? this.
|
|
176
|
+
return this.core.activeContainer?.isReady
|
|
177
|
+
? this.core.activeContainer.volume
|
|
153
178
|
: this.intendedVolume;
|
|
154
179
|
}
|
|
155
180
|
/**
|
|
@@ -165,8 +190,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
165
190
|
this.kibo = new Kibo(this.options.focusElement);
|
|
166
191
|
this.bindKeyEvents();
|
|
167
192
|
this.userDisabled = false;
|
|
168
|
-
if (
|
|
169
|
-
this.options.chromeless) {
|
|
193
|
+
if (this.options.chromeless) {
|
|
170
194
|
this.disable();
|
|
171
195
|
}
|
|
172
196
|
$(document).bind('mouseup', this.stopDrag);
|
|
@@ -174,12 +198,18 @@ export class MediaControl extends UICorePlugin {
|
|
|
174
198
|
$(document).bind('touchend', this.stopDrag);
|
|
175
199
|
$(document).bind('touchmove', this.updateDrag);
|
|
176
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
177
204
|
getExternalInterface() {
|
|
178
205
|
return {
|
|
179
206
|
setVolume: this.setVolume,
|
|
180
207
|
getVolume: () => this.volume,
|
|
181
208
|
};
|
|
182
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
183
213
|
bindEvents() {
|
|
184
214
|
// @ts-ignore
|
|
185
215
|
this.stopListening();
|
|
@@ -235,12 +265,18 @@ export class MediaControl extends UICorePlugin {
|
|
|
235
265
|
this.listenToOnce(this.container, Events.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag);
|
|
236
266
|
}
|
|
237
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Disables the plugin and unmounts its UI
|
|
270
|
+
*/
|
|
238
271
|
disable() {
|
|
239
272
|
this.userDisabled = true;
|
|
240
273
|
this.hide();
|
|
241
274
|
this.unbindKeyEvents();
|
|
242
275
|
this.$el.hide();
|
|
243
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
279
|
+
*/
|
|
244
280
|
enable() {
|
|
245
281
|
if (this.options.chromeless) {
|
|
246
282
|
return;
|
|
@@ -249,24 +285,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
249
285
|
this.bindKeyEvents();
|
|
250
286
|
this.show();
|
|
251
287
|
}
|
|
252
|
-
/**
|
|
253
|
-
* Start the playback
|
|
254
|
-
*/
|
|
255
|
-
play() {
|
|
256
|
-
this.container && this.container.play();
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Pause the playback
|
|
260
|
-
*/
|
|
261
|
-
pause() {
|
|
262
|
-
this.container && this.container.pause();
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Stop the playback
|
|
266
|
-
*/
|
|
267
|
-
stop() {
|
|
268
|
-
this.container && this.container.stop();
|
|
269
|
-
}
|
|
270
288
|
/**
|
|
271
289
|
* Set the initial volume, which is preserved when playback is interrupted by an advertisement
|
|
272
290
|
*/
|
|
@@ -765,14 +783,32 @@ export class MediaControl extends UICorePlugin {
|
|
|
765
783
|
/**
|
|
766
784
|
* Get a media control element DOM node
|
|
767
785
|
* @param name - The name of the media control element
|
|
768
|
-
* @returns The DOM node to render
|
|
786
|
+
* @returns The DOM node to render to or extend
|
|
787
|
+
* @remarks
|
|
788
|
+
* Use this method to render custom media control UI in a plugin
|
|
789
|
+
* @example
|
|
790
|
+
* ```ts
|
|
791
|
+
* class MyPlugin extends UICorePlugin {
|
|
792
|
+
* override render() {
|
|
793
|
+
* const mediaControl = this.core.getPlugin('media_control')
|
|
794
|
+
* const clipText = mediaControl.getElement('clipText')
|
|
795
|
+
* clipText?.el.text('Here we go')
|
|
796
|
+
* return this
|
|
797
|
+
* }
|
|
798
|
+
* }
|
|
799
|
+
* ```
|
|
769
800
|
*/
|
|
770
801
|
getElement(name) {
|
|
771
802
|
switch (name) {
|
|
772
803
|
case 'clipText':
|
|
773
804
|
return this.$clipText;
|
|
805
|
+
case 'bottomGear':
|
|
806
|
+
case 'gear':
|
|
807
|
+
return this.$bottomGear;
|
|
774
808
|
case 'pip':
|
|
775
809
|
return this.$pip;
|
|
810
|
+
case 'playbackRate':
|
|
811
|
+
return this.$playbackRate;
|
|
776
812
|
case 'seekBarContainer':
|
|
777
813
|
return this.$seekBarContainer;
|
|
778
814
|
}
|
|
@@ -906,6 +942,9 @@ export class MediaControl extends UICorePlugin {
|
|
|
906
942
|
element &&
|
|
907
943
|
$(element).find('svg path').css({ fill: this.buttonsColor });
|
|
908
944
|
}
|
|
945
|
+
/**
|
|
946
|
+
* @internal
|
|
947
|
+
*/
|
|
909
948
|
destroy() {
|
|
910
949
|
$(document).unbind('mouseup', this.stopDrag);
|
|
911
950
|
$(document).unbind('mousemove', this.updateDrag);
|
|
@@ -918,6 +957,9 @@ export class MediaControl extends UICorePlugin {
|
|
|
918
957
|
this.advertisementPlaying ? this.disable() : this.enable();
|
|
919
958
|
this.trigger(Events.MEDIACONTROL_OPTIONS_CHANGE);
|
|
920
959
|
}
|
|
960
|
+
/**
|
|
961
|
+
* @internal
|
|
962
|
+
*/
|
|
921
963
|
render() {
|
|
922
964
|
const timeout = this.options.hideMediaControlDelay || 2000;
|
|
923
965
|
const html = MediaControl.template({ settings: this.settings ?? {} });
|
|
@@ -1005,10 +1047,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
1005
1047
|
this.hide();
|
|
1006
1048
|
}
|
|
1007
1049
|
}
|
|
1008
|
-
// TODO
|
|
1009
|
-
setMuted(value) {
|
|
1010
|
-
this.container.options.mute = value;
|
|
1011
|
-
}
|
|
1012
1050
|
static getPageX(event) {
|
|
1013
1051
|
return getPageX(event);
|
|
1014
1052
|
}
|
|
@@ -1022,7 +1060,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
1022
1060
|
return 0;
|
|
1023
1061
|
}
|
|
1024
1062
|
/**
|
|
1025
|
-
* Enable the
|
|
1063
|
+
* Enable the user interaction disabled earlier
|
|
1026
1064
|
*/
|
|
1027
1065
|
enableControlButton() {
|
|
1028
1066
|
this.disabledClickableList.forEach((element) => {
|
|
@@ -1030,7 +1068,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
1030
1068
|
});
|
|
1031
1069
|
}
|
|
1032
1070
|
/**
|
|
1033
|
-
* Disable the control
|
|
1071
|
+
* Disable the user interaction for the control buttons
|
|
1034
1072
|
*/
|
|
1035
1073
|
disabledControlButton() {
|
|
1036
1074
|
this.disabledClickableList.forEach((element) => {
|
|
@@ -1044,7 +1082,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
1044
1082
|
return isFinite(this.core.activePlayback.getDuration());
|
|
1045
1083
|
}
|
|
1046
1084
|
}
|
|
1047
|
-
// TODO drop?
|
|
1048
1085
|
MediaControl.extend = function (properties) {
|
|
1049
1086
|
return extend(MediaControl, properties);
|
|
1050
1087
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Browser, Events, Playback, template, UICorePlugin } from '@clappr/core';
|
|
2
2
|
import { reportError, trace } from '@gcorevideo/utils';
|
|
3
|
-
import { CLAPPR_VERSION } from '
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
import pluginHtml from '../../../assets/multi-camera/multicamera.ejs';
|
|
5
5
|
import '../../../assets/multi-camera/style.scss';
|
|
6
6
|
import streamsIcon from '../../../assets/icons/old/streams.svg';
|
|
7
7
|
import streamsMomentoIcon from '../../../assets/icons/old/language.svg';
|
|
8
8
|
import streamsWhiteNightsIcon from '../../../assets/icons/old/wn.svg';
|
|
9
9
|
const VERSION = '0.0.1';
|
|
10
|
-
const T = 'plugins.
|
|
10
|
+
const T = 'plugins.media_control_multicamera';
|
|
11
11
|
export class MultiCamera extends UICorePlugin {
|
|
12
12
|
currentCamera = null;
|
|
13
13
|
currentTime = 0;
|
|
@@ -15,7 +15,7 @@ export class MultiCamera extends UICorePlugin {
|
|
|
15
15
|
multicamera = [];
|
|
16
16
|
noActiveStreams = false;
|
|
17
17
|
get name() {
|
|
18
|
-
return '
|
|
18
|
+
return 'media_control_multicamera';
|
|
19
19
|
}
|
|
20
20
|
get supportedVersion() {
|
|
21
21
|
return { min: CLAPPR_VERSION };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { UICorePlugin, template, Events } from '@clappr/core';
|
|
2
2
|
import { trace } from '@gcorevideo/utils';
|
|
3
|
-
import { CLAPPR_VERSION } from '
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
import pipIcon from '../../../assets/icons/new/pip.svg';
|
|
5
5
|
import buttonHtml from '../../../assets/picture-in-picture/button.ejs';
|
|
6
6
|
import '../../../assets/picture-in-picture/button.scss';
|
|
7
7
|
const VERSION = '0.0.1';
|
|
8
|
-
const T = `plugins.
|
|
8
|
+
const T = `plugins.media_control_pip`;
|
|
9
9
|
export class PictureInPicture extends UICorePlugin {
|
|
10
10
|
get name() {
|
|
11
|
-
return '
|
|
11
|
+
return 'media_control_pip';
|
|
12
12
|
}
|
|
13
13
|
get supportedVersion() {
|
|
14
14
|
return { min: CLAPPR_VERSION };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaybackRate.d.ts","sourceRoot":"","sources":["../../../src/plugins/playback-rate/PlaybackRate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAsB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"PlaybackRate.d.ts","sourceRoot":"","sources":["../../../src/plugins/playback-rate/PlaybackRate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAsB,MAAM,cAAc,CAAC;AAiCxE,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,eAAe,CAAyB;IAEhD,OAAO,CAAC,aAAa,CAAgD;IAErE,OAAO,CAAC,gBAAgB,CAAqB;IAE7C,OAAO,CAAC,YAAY,CAAiC;IAErD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAa,UAAU;;;MAKtB;IAED,IAAa,MAAM;;;;MAMlB;IAEQ,UAAU;IAoBnB,YAAY;IAOZ,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,gBAAgB;IAcxB,MAAM;IAKN,OAAO,CAAC,YAAY;IAUX,MAAM;IAyCf,SAAS;IAMT,UAAU;IAMV,MAAM;IAWN,MAAM;IAIN,YAAY,CAAC,KAAK,EAAE,UAAU;IAW9B,UAAU;IAaV,MAAM;IAIN,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAI/B,eAAe,CAAC,IAAI,EAAE,MAAM;IAQ5B,QAAQ;IAYR,oBAAoB;CASrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Events, UICorePlugin, Playback, template } from '@clappr/core';
|
|
2
|
-
import { CLAPPR_VERSION } from '
|
|
2
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
3
|
import pluginHtml from '../../../assets/playback-rate/playback-rate-selector.ejs';
|
|
4
4
|
import buttonHtml from '../../../assets/playback-rate/button.ejs';
|
|
5
5
|
import listHtml from '../../../assets/playback-rate/list.ejs';
|
|
@@ -17,6 +17,7 @@ const DEFAULT_PLAYBACK_RATES = [
|
|
|
17
17
|
{ value: '2.0', label: '2x' }
|
|
18
18
|
];
|
|
19
19
|
const DEFAULT_PLAYBACK_RATE = '1.0';
|
|
20
|
+
// TODO
|
|
20
21
|
const MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
21
22
|
export class PlaybackRate extends UICorePlugin {
|
|
22
23
|
currentPlayback = null;
|
|
@@ -24,7 +25,7 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
24
25
|
prevSelectedRate;
|
|
25
26
|
selectedRate = DEFAULT_PLAYBACK_RATE;
|
|
26
27
|
get name() {
|
|
27
|
-
return '
|
|
28
|
+
return 'media_control_playback_rate';
|
|
28
29
|
}
|
|
29
30
|
get supportedVersion() {
|
|
30
31
|
return { min: CLAPPR_VERSION };
|
|
@@ -202,4 +203,3 @@ export class PlaybackRate extends UICorePlugin {
|
|
|
202
203
|
currentLevelElement.find('a').addClass('gcore-skin-active');
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
|
-
// PlaybackRate.MEDIACONTROL_PLAYBACKRATE = 'playbackRate';
|
|
@@ -1,27 +1,75 @@
|
|
|
1
1
|
import { UIContainerPlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/poster/poster.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Displays a poster image in the background and a big play button on top when playback is stopped
|
|
5
|
+
* @beta
|
|
6
|
+
* @remarks
|
|
7
|
+
* When the playback is stopped, media control UI is disabled.
|
|
8
|
+
*
|
|
9
|
+
* Configuration options:
|
|
10
|
+
*
|
|
11
|
+
* - `poster.custom` - custom CSS background
|
|
12
|
+
*
|
|
13
|
+
* - `poster.showForNoOp` - whether to show the poster when the playback is not started
|
|
14
|
+
*
|
|
15
|
+
* - `poster.url` - the URL of the poster image
|
|
16
|
+
*
|
|
17
|
+
* - `poster.showOnVideoEnd` - whether to show the poster when the playback is ended
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* new Player({
|
|
22
|
+
* ...
|
|
23
|
+
* poster: {
|
|
24
|
+
* showForNoOp: true,
|
|
25
|
+
* url: 'https://via.placeholder.com/150.png',
|
|
26
|
+
* }
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
3
30
|
export declare class Poster extends UIContainerPlugin {
|
|
4
31
|
private hasFatalError;
|
|
5
32
|
private hasStartedPlaying;
|
|
6
33
|
private playRequested;
|
|
7
34
|
private $playButton;
|
|
8
35
|
private $playWrapper;
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
9
39
|
get name(): string;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
10
43
|
get supportedVersion(): {
|
|
11
44
|
min: string;
|
|
12
45
|
};
|
|
13
|
-
|
|
14
|
-
get shouldRender()
|
|
46
|
+
private static readonly template;
|
|
47
|
+
private get shouldRender();
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
15
51
|
get attributes(): {
|
|
16
52
|
class: string;
|
|
17
53
|
'data-poster': string;
|
|
18
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
19
58
|
get events(): {
|
|
20
59
|
click: string;
|
|
21
60
|
};
|
|
22
|
-
get showOnVideoEnd()
|
|
61
|
+
private get showOnVideoEnd();
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
23
65
|
bindEvents(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Reenables earlier disabled plugin
|
|
68
|
+
*/
|
|
24
69
|
enable(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Disables the plugin, unmounting it from the DOM
|
|
72
|
+
*/
|
|
25
73
|
disable(): void;
|
|
26
74
|
private onError;
|
|
27
75
|
private onPlay;
|
|
@@ -36,7 +84,13 @@ export declare class Poster extends UIContainerPlugin {
|
|
|
36
84
|
private updatePoster;
|
|
37
85
|
private showPoster;
|
|
38
86
|
private hidePoster;
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
39
90
|
render(): this;
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
40
94
|
destroy(): this;
|
|
41
95
|
}
|
|
42
96
|
//# sourceMappingURL=Poster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Poster.d.ts","sourceRoot":"","sources":["../../../src/plugins/poster/Poster.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,iBAAiB,EAIlB,MAAM,cAAc,CAAA;AAMrB,OAAO,oCAAoC,CAAA;AAO3C,qBAAa,MAAO,SAAQ,iBAAiB;IAC3C,OAAO,CAAC,aAAa,CAAQ;IAE7B,OAAO,CAAC,iBAAiB,CAAQ;IAEjC,OAAO,CAAC,aAAa,CAAQ;IAE7B,OAAO,CAAC,WAAW,CAA2B;IAE9C,OAAO,CAAC,YAAY,CAA2B;IAE/C,IAAI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