@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UICorePlugin, Events, template } from '@clappr/core';
|
|
2
2
|
import { reportError } from '@gcorevideo/utils';
|
|
3
3
|
import Mousetrap from 'mousetrap';
|
|
4
|
-
import { CLAPPR_VERSION } from '
|
|
4
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
5
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';
|
|
@@ -10,6 +10,8 @@ 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 { Events as BottomGearEvents } from '../bottom-gear/BottomGear.js';
|
|
14
|
+
import assert from 'assert';
|
|
13
15
|
const qualityClasses = [
|
|
14
16
|
'speedtest-quality-value-1',
|
|
15
17
|
'speedtest-quality-value-2',
|
|
@@ -93,7 +95,7 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
93
95
|
shortcut;
|
|
94
96
|
iconPosition;
|
|
95
97
|
get name() {
|
|
96
|
-
return '
|
|
98
|
+
return 'media_control_nerd_stats';
|
|
97
99
|
}
|
|
98
100
|
get supportedVersion() {
|
|
99
101
|
return { min: CLAPPR_VERSION };
|
|
@@ -138,8 +140,10 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
138
140
|
configureSpeedTest(core.options.clapprNerdStats?.speedTestServers ?? []);
|
|
139
141
|
}
|
|
140
142
|
bindEvents() {
|
|
143
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
144
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
141
145
|
this.listenToOnce(this.core, Events.CORE_READY, this.init);
|
|
142
|
-
this.listenTo(
|
|
146
|
+
this.listenTo(mediaControl, BottomGearEvents.MEDIACONTROL_GEAR_RENDERED, this.addToBottomGear);
|
|
143
147
|
}
|
|
144
148
|
init() {
|
|
145
149
|
this.container = this.core.activeContainer;
|
|
@@ -153,32 +157,26 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
153
157
|
this.disable();
|
|
154
158
|
}
|
|
155
159
|
else {
|
|
156
|
-
Mousetrap.bind(this.shortcut, () => this.
|
|
160
|
+
Mousetrap.bind(this.shortcut, () => this.toggle());
|
|
157
161
|
this.listenTo(this.core, Events.CORE_RESIZE, this.onPlayerResize);
|
|
158
162
|
// TODO: fix
|
|
159
163
|
this.listenTo(clapprStats, ClapprStatsEvents.REPORT_EVENT, this.updateMetrics);
|
|
160
164
|
clapprStats.setUpdateMetrics(this.updateMetrics.bind(this));
|
|
161
165
|
this.updateMetrics(clapprStats.exportMetrics());
|
|
162
166
|
this.render();
|
|
163
|
-
// this.$el.find('.speed-test-button').on('click', this.onSpeedTestClick.bind(this));
|
|
164
|
-
// this.$el.find('.close-speed-test').on('click', this.closeSpeedTest.bind(this));
|
|
165
|
-
// this.$el.find('.speed-test').hide();
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
+
toggle() {
|
|
169
170
|
if (this.showing) {
|
|
170
|
-
this.hide(
|
|
171
|
+
this.hide();
|
|
171
172
|
}
|
|
172
173
|
else {
|
|
173
|
-
this.show(
|
|
174
|
+
this.show();
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
|
-
show(
|
|
177
|
+
show() {
|
|
177
178
|
this.core.$el.find(this.statsBoxElem).show();
|
|
178
179
|
this.showing = true;
|
|
179
|
-
if (event) {
|
|
180
|
-
event.stopPropagation();
|
|
181
|
-
}
|
|
182
180
|
this.refreshSpeedTest();
|
|
183
181
|
initSpeedTest(this.customMetrics).then(() => {
|
|
184
182
|
startSpeedtest();
|
|
@@ -187,12 +185,9 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
187
185
|
this.disable();
|
|
188
186
|
});
|
|
189
187
|
}
|
|
190
|
-
hide(
|
|
188
|
+
hide() {
|
|
191
189
|
this.core.$el.find(this.statsBoxElem).hide();
|
|
192
190
|
this.showing = false;
|
|
193
|
-
if (event) {
|
|
194
|
-
event.stopPropagation();
|
|
195
|
-
}
|
|
196
191
|
stopSpeedtest();
|
|
197
192
|
}
|
|
198
193
|
onPlayerResize() {
|
|
@@ -254,13 +249,14 @@ export class ClapprNerdStats extends UICorePlugin {
|
|
|
254
249
|
return this;
|
|
255
250
|
}
|
|
256
251
|
addToBottomGear() {
|
|
257
|
-
this.core.
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
const gear = this.core.getPlugin('media_control_gear');
|
|
253
|
+
const $el = gear.getElement('nerd');
|
|
254
|
+
$el.html(buttonHtml);
|
|
255
|
+
const $button = $el.find('.nerd-button');
|
|
260
256
|
$button.find('.stats-icon').html(statsIcon);
|
|
261
|
-
$button.on('click', () => {
|
|
262
|
-
|
|
263
|
-
this.
|
|
257
|
+
$button.on('click', (e) => {
|
|
258
|
+
e.stopPropagation();
|
|
259
|
+
this.toggle();
|
|
264
260
|
});
|
|
265
261
|
}
|
|
266
262
|
clearCustomMetrics() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContainerPlugin, Events as CoreEvents, Log } from '@clappr/core';
|
|
2
2
|
import assert from 'assert';
|
|
3
|
-
import { CLAPPR_VERSION } from '
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
4
4
|
import { ClapprStatsEvents } from './types.js';
|
|
5
5
|
import { newMetrics } from './utils.js';
|
|
6
6
|
// TODO: fix
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
import { ContainerPlugin, Events, Playback } from '@clappr/core';
|
|
5
5
|
import { trace } from '@gcorevideo/utils';
|
|
6
|
-
import { CLAPPR_VERSION } from '
|
|
6
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
7
7
|
const T = 'plugins.click_to_pause_custom';
|
|
8
8
|
export class ClickToPause extends ContainerPlugin {
|
|
9
9
|
pointerEnabled = false;
|
|
@@ -8,7 +8,7 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
8
8
|
_oldContainer;
|
|
9
9
|
svgMask = null;
|
|
10
10
|
get name() {
|
|
11
|
-
return '
|
|
11
|
+
return 'media_control_clips';
|
|
12
12
|
}
|
|
13
13
|
get attributes() {
|
|
14
14
|
return {
|
|
@@ -108,7 +108,7 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
108
108
|
this.setSVGMask(svg);
|
|
109
109
|
}
|
|
110
110
|
setSVGMask(svg) {
|
|
111
|
-
this.core.mediaControl.setSVGMask(svg);
|
|
111
|
+
// this.core.mediaControl.setSVGMask(svg);
|
|
112
112
|
if (this.svgMask) {
|
|
113
113
|
this.svgMask.remove();
|
|
114
114
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UICorePlugin, Events, template, $ } from '@clappr/core';
|
|
2
|
-
import { CLAPPR_VERSION } from '
|
|
2
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
3
|
import '../../../assets/context-menu/context_menu.scss';
|
|
4
4
|
import templateHtml from '../../../assets/context-menu/context_menu.ejs';
|
|
5
5
|
export class ContextMenu extends UICorePlugin {
|
|
@@ -1,27 +1,53 @@
|
|
|
1
1
|
import { Core, UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Adds the DVR controls to the media control UI
|
|
5
|
+
* @beta
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The plugin is rendered in the {@link MediaControl | media control} UI.
|
|
9
|
+
* It renders the live stream indicator and the DVR seek bar if DVR is enabled.
|
|
10
|
+
*/
|
|
3
11
|
export declare class DvrControls extends UICorePlugin {
|
|
4
|
-
|
|
12
|
+
private static readonly template;
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
5
16
|
get name(): string;
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
6
20
|
get supportedVersion(): {
|
|
7
21
|
min: string;
|
|
8
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
9
26
|
get events(): {
|
|
10
27
|
'click .live-button': string;
|
|
11
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
12
32
|
get attributes(): {
|
|
13
33
|
class: string;
|
|
14
34
|
'data-dvr-controls': string;
|
|
15
35
|
};
|
|
16
36
|
constructor(core: Core);
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
17
40
|
bindEvents(): void;
|
|
18
41
|
private bindCoreEvents;
|
|
19
42
|
private bindContainerEvents;
|
|
20
43
|
private containerChanged;
|
|
21
44
|
private dvrChanged;
|
|
22
|
-
click
|
|
23
|
-
settingsUpdate
|
|
24
|
-
shouldRender
|
|
45
|
+
private click;
|
|
46
|
+
private settingsUpdate;
|
|
47
|
+
private shouldRender;
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
25
51
|
render(): this;
|
|
26
52
|
}
|
|
27
53
|
//# sourceMappingURL=DvrControls.d.ts.map
|
|
@@ -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;
|
|
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;;;;;;;GAOG;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"}
|
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
import { Events, Playback, UICorePlugin, template } from '@clappr/core';
|
|
2
|
-
import
|
|
2
|
+
import assert from 'assert';
|
|
3
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
4
|
import dvrHTML from '../../../assets/dvr-controls/index.ejs';
|
|
4
5
|
import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
6
|
+
/**
|
|
7
|
+
* Adds the DVR controls to the media control UI
|
|
8
|
+
* @beta
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The plugin is rendered in the {@link MediaControl | media control} UI.
|
|
12
|
+
* It renders the live stream indicator and the DVR seek bar if DVR is enabled.
|
|
13
|
+
*/
|
|
5
14
|
export class DvrControls extends UICorePlugin {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
static template = template(dvrHTML);
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
9
19
|
get name() {
|
|
10
|
-
return '
|
|
20
|
+
return 'media_control_dvr';
|
|
11
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
12
25
|
get supportedVersion() {
|
|
13
26
|
return { min: CLAPPR_VERSION };
|
|
14
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
15
31
|
get events() {
|
|
16
32
|
return {
|
|
17
33
|
'click .live-button': 'click'
|
|
18
34
|
};
|
|
19
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
20
39
|
get attributes() {
|
|
21
40
|
return {
|
|
22
41
|
'class': 'dvr-controls',
|
|
@@ -27,6 +46,9 @@ export class DvrControls extends UICorePlugin {
|
|
|
27
46
|
super(core);
|
|
28
47
|
this.settingsUpdate();
|
|
29
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
30
52
|
bindEvents() {
|
|
31
53
|
this.bindCoreEvents();
|
|
32
54
|
this.bindContainerEvents();
|
|
@@ -74,8 +96,8 @@ export class DvrControls extends UICorePlugin {
|
|
|
74
96
|
}
|
|
75
97
|
}
|
|
76
98
|
click() {
|
|
77
|
-
const mediaControl = this.core.
|
|
78
|
-
const container =
|
|
99
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
100
|
+
const container = this.core.activeContainer;
|
|
79
101
|
if (!container.isPlaying()) {
|
|
80
102
|
container.play();
|
|
81
103
|
}
|
|
@@ -85,7 +107,7 @@ export class DvrControls extends UICorePlugin {
|
|
|
85
107
|
}
|
|
86
108
|
settingsUpdate() {
|
|
87
109
|
// @ts-ignore
|
|
88
|
-
this.stopListening();
|
|
110
|
+
this.stopListening(); // TODO sort out
|
|
89
111
|
this.core.mediaControl.$el.removeClass('live');
|
|
90
112
|
if (this.shouldRender()) {
|
|
91
113
|
this.render();
|
|
@@ -97,14 +119,20 @@ export class DvrControls extends UICorePlugin {
|
|
|
97
119
|
const useDvrControls = this.core.options.useDvrControls === undefined || !!this.core.options.useDvrControls;
|
|
98
120
|
return useDvrControls && this.core.getPlaybackType() === Playback.LIVE;
|
|
99
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
100
125
|
render() {
|
|
101
|
-
this.$el.html(
|
|
126
|
+
this.$el.html(DvrControls.template({
|
|
102
127
|
live: this.core.i18n.t('live'),
|
|
103
128
|
backToLive: this.core.i18n.t('back_to_live')
|
|
104
129
|
}));
|
|
105
130
|
if (this.shouldRender()) {
|
|
106
|
-
this.core.mediaControl
|
|
107
|
-
|
|
131
|
+
const mediaControl = this.core.mediaControl;
|
|
132
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
133
|
+
// TODO don't tap into the $el directly
|
|
134
|
+
mediaControl.$el.addClass('live');
|
|
135
|
+
mediaControl.$('.media-control-left-panel[data-media-control]').append(this.$el);
|
|
108
136
|
}
|
|
109
137
|
return this;
|
|
110
138
|
}
|
|
@@ -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,OAAO,gDAAgD,CAAC;AAaxD,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAID,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;
|
|
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,OAAO,gDAAgD,CAAC;AAaxD,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAID,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UICorePlugin, Events, template, PlayerError } 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 reloadIcon from '../../../assets/icons/old/reload.svg';
|
|
5
5
|
import templateHtml from '../../../assets/error-screen/error_screen.ejs';
|
|
6
6
|
import '../../../assets/error-screen/error_screen.scss';
|
|
@@ -160,6 +160,7 @@ export class ErrorScreen extends UICorePlugin {
|
|
|
160
160
|
if (err) {
|
|
161
161
|
this.err = err;
|
|
162
162
|
}
|
|
163
|
+
// TODO use container.disableMediaControl() instead
|
|
163
164
|
this.core.mediaControl.disable();
|
|
164
165
|
this.render();
|
|
165
166
|
this.$el.show();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CorePlugin, Events, $ } from '@clappr/core';
|
|
2
|
-
import { CLAPPR_VERSION } from '
|
|
2
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
3
|
import playIcon from '../../../assets/icons/new/play.svg';
|
|
4
4
|
import pauseIcon from '../../../assets/icons/new/pause.svg';
|
|
5
5
|
import stopIcon from '../../../assets/icons/new/stop.svg';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
import { ContainerPlugin, Events } from '@clappr/core';
|
|
5
|
-
import { CLAPPR_VERSION } from '
|
|
5
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
6
6
|
export class GoogleAnalytics extends ContainerPlugin {
|
|
7
7
|
account = '';
|
|
8
8
|
trackerName = '';
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/level-selector/style.scss';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
|
|
5
5
|
* @beta
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* The plugin is rendered as a button in the gear menu.
|
|
8
|
+
* The plugin is rendered as a button in the {@link BottomGear | gear menu}.
|
|
9
9
|
* When clicked, it shows a list of quality levels to choose from.
|
|
10
10
|
*
|
|
11
11
|
* Configuration options:
|
|
12
12
|
*
|
|
13
|
-
* - `labels`: The labels to show in the level selector. [
|
|
13
|
+
* - `labels`: The labels to show in the level selector. [video resolution]: string
|
|
14
|
+
*
|
|
14
15
|
* - `restrictResolution`: The maximum resolution to allow in the level selector.
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```ts
|
|
18
|
-
* {
|
|
19
|
+
* new Player({
|
|
19
20
|
* levelSelector: {
|
|
20
21
|
* restrictResolution: 360,
|
|
21
|
-
* labels: { 360: '
|
|
22
|
+
* labels: { 360: 'SD', 720: 'HD' },
|
|
22
23
|
* },
|
|
23
|
-
* }
|
|
24
|
+
* })
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
27
|
export declare class LevelSelector extends UICorePlugin {
|
|
@@ -31,11 +32,23 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
31
32
|
private isOpen;
|
|
32
33
|
private buttonTemplate;
|
|
33
34
|
private listTemplate;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
34
38
|
get name(): string;
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
35
42
|
get supportedVersion(): {
|
|
36
43
|
min: string;
|
|
37
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
38
48
|
static get version(): string;
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
39
52
|
get attributes(): {
|
|
40
53
|
class: string;
|
|
41
54
|
'data-level-selector': string;
|
|
@@ -47,10 +60,16 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
47
60
|
'click .gear-option': string;
|
|
48
61
|
'click .go-back': string;
|
|
49
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
50
66
|
bindEvents(): void;
|
|
51
67
|
private bindPlaybackEvents;
|
|
52
68
|
private onStop;
|
|
53
69
|
private shouldRender;
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
54
73
|
render(): this;
|
|
55
74
|
private renderButton;
|
|
56
75
|
private renderDropdown;
|
|
@@ -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;AAc7D,OAAO,2CAA2C,CAAA;AAMlD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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,MAAM,CAAQ;IAEtB,OAAO,CAAC,cAAc,CAAgC;IAEtD,OAAO,CAAC,YAAY,CAAgC;IAEpD;;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,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,eAAe,CAAK;IAE5B,IAAa,MAAM;;;;MAMlB;IAED;;OAEG;IACM,UAAU;IAKnB,OAAO,CAAC,kBAAkB;IAsC1B,OAAO,CAAC,MAAM;IAcd,OAAO,CAAC,YAAY;IAmBpB;;OAEG;IACM,MAAM;IAUf,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,cAAc;IAiBtB,OAAO,KAAK,QAAQ,GAQnB;IAED,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,QAAQ;IAmBhB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,WAAW,CAAmC;CACvD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Events, 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 buttonHtml from '../../../assets/level-selector/button.ejs';
|
|
5
5
|
import listHtml from '../../../assets/level-selector/list.ejs';
|
|
6
6
|
import hdIcon from '../../../assets/icons/new/hd.svg';
|
|
@@ -8,29 +8,30 @@ import arrowRightIcon from '../../../assets/icons/new/arrow-right.svg';
|
|
|
8
8
|
import arrowLeftIcon from '../../../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
|
-
const T = 'plugins.
|
|
11
|
+
const T = 'plugins.media_control_level_selector';
|
|
12
12
|
const VERSION = '2.19.4';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
|
|
15
15
|
* @beta
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* The plugin is rendered as a button in the gear menu.
|
|
18
|
+
* The plugin is rendered as a button in the {@link BottomGear | gear menu}.
|
|
19
19
|
* When clicked, it shows a list of quality levels to choose from.
|
|
20
20
|
*
|
|
21
21
|
* Configuration options:
|
|
22
22
|
*
|
|
23
|
-
* - `labels`: The labels to show in the level selector. [
|
|
23
|
+
* - `labels`: The labels to show in the level selector. [video resolution]: string
|
|
24
|
+
*
|
|
24
25
|
* - `restrictResolution`: The maximum resolution to allow in the level selector.
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
28
|
* ```ts
|
|
28
|
-
* {
|
|
29
|
+
* new Player({
|
|
29
30
|
* levelSelector: {
|
|
30
31
|
* restrictResolution: 360,
|
|
31
|
-
* labels: { 360: '
|
|
32
|
+
* labels: { 360: 'SD', 720: 'HD' },
|
|
32
33
|
* },
|
|
33
|
-
* }
|
|
34
|
+
* })
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
37
|
export class LevelSelector extends UICorePlugin {
|
|
@@ -41,15 +42,27 @@ export class LevelSelector extends UICorePlugin {
|
|
|
41
42
|
isOpen = false;
|
|
42
43
|
buttonTemplate = null;
|
|
43
44
|
listTemplate = null;
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
44
48
|
get name() {
|
|
45
|
-
return '
|
|
49
|
+
return 'media_control_level_selector';
|
|
46
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
47
54
|
get supportedVersion() {
|
|
48
55
|
return { min: CLAPPR_VERSION };
|
|
49
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
50
60
|
static get version() {
|
|
51
61
|
return VERSION;
|
|
52
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
53
66
|
get attributes() {
|
|
54
67
|
return {
|
|
55
68
|
class: this.name,
|
|
@@ -65,6 +78,9 @@ export class LevelSelector extends UICorePlugin {
|
|
|
65
78
|
'click .go-back': 'goBack',
|
|
66
79
|
};
|
|
67
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
68
84
|
bindEvents() {
|
|
69
85
|
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindPlaybackEvents());
|
|
70
86
|
this.listenTo(this.core, 'gear:rendered', this.render);
|
|
@@ -113,6 +129,9 @@ export class LevelSelector extends UICorePlugin {
|
|
|
113
129
|
// Only care if we have at least 2 to choose from
|
|
114
130
|
return !!(this.levels && this.levels.length > 1);
|
|
115
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
116
135
|
render() {
|
|
117
136
|
if (!this.shouldRender()) {
|
|
118
137
|
return this;
|
|
@@ -132,9 +151,10 @@ export class LevelSelector extends UICorePlugin {
|
|
|
132
151
|
hdIcon,
|
|
133
152
|
});
|
|
134
153
|
this.$el.html(html);
|
|
135
|
-
this.core.
|
|
154
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
155
|
+
mediaControl.getElement('bottomGear')
|
|
136
156
|
?.find('.gear-options-list [data-quality]')
|
|
137
|
-
|
|
157
|
+
?.html(this.el);
|
|
138
158
|
}
|
|
139
159
|
}
|
|
140
160
|
renderDropdown() {
|
|
@@ -150,7 +170,8 @@ export class LevelSelector extends UICorePlugin {
|
|
|
150
170
|
removeAuto: this.removeAuto,
|
|
151
171
|
});
|
|
152
172
|
this.$el.html(html);
|
|
153
|
-
this.core.
|
|
173
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
174
|
+
mediaControl.getElement('bottomGear')?.find('.gear-wrapper').html(this.el);
|
|
154
175
|
}
|
|
155
176
|
get maxLevel() {
|
|
156
177
|
const maxRes = this.core.options.levelSelector?.restrictResolution;
|
package/lib/plugins/logo/Logo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UIContainerPlugin, Events, template as t } from '@clappr/core';
|
|
2
|
-
import { CLAPPR_VERSION } from '
|
|
2
|
+
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
3
|
import { calculateSize } from './utils/index.js';
|
|
4
4
|
import logoHTML from '../../../assets/logo/templates/logo.ejs';
|
|
5
5
|
import '../../../assets/logo/styles/logo.scss';
|