@gcorevideo/player 2.20.1 → 2.20.4
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 +30 -6
- package/dist/index.css +1572 -1572
- package/dist/index.js +343 -226
- package/dist/player.d.ts +280 -52
- package/dist/plugins/index.css +619 -619
- package/dist/plugins/index.js +1468 -1351
- package/docs/api/player.audioselector.md +1 -251
- package/docs/api/player.bigmutebutton.md +1 -156
- package/docs/api/player.clapprstats.exportmetrics.md +4 -0
- package/docs/api/player.clapprstats.md +7 -223
- package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
- package/docs/api/player.clicktopause.md +5 -113
- package/docs/api/player.clipsplugin.gettext.md +9 -0
- package/docs/api/player.clipsplugin.md +10 -94
- package/docs/api/player.clipspluginsettings.md +57 -0
- package/docs/api/player.clipspluginsettings.text.md +13 -0
- package/docs/api/player.contextmenu._constructor_.md +6 -3
- package/docs/api/player.contextmenu.md +13 -256
- package/docs/api/{player.audioselector.bindevents.md → player.contextmenupluginsettings.label.md} +3 -7
- package/docs/api/player.contextmenupluginsettings.md +98 -0
- package/docs/api/{player.audioselector.attributes.md → player.contextmenupluginsettings.preventshowcontextmenu.md} +3 -6
- package/docs/api/{player.audioselector.reload.md → player.contextmenupluginsettings.url.md} +3 -7
- package/docs/api/player.dvrcontrols.md +1 -1
- package/docs/api/player.errorscreen.md +0 -2
- package/docs/api/player.favicon._constructor_.md +3 -0
- package/docs/api/player.favicon.bindevents.md +3 -0
- package/docs/api/player.favicon.configure.md +3 -0
- package/docs/api/player.favicon.destroy.md +3 -0
- package/docs/api/player.favicon.disable.md +3 -0
- package/docs/api/player.favicon.md +18 -1
- package/docs/api/player.favicon.name.md +3 -0
- package/docs/api/player.favicon.supportedversion.md +3 -0
- package/docs/api/player.gearevents.md +4 -1
- package/docs/api/player.googleanalytics._constructor_.md +3 -0
- package/docs/api/player.googleanalytics.addeventlisteners.md +3 -0
- package/docs/api/player.googleanalytics.embedscript.md +3 -0
- package/docs/api/player.googleanalytics.md +42 -1
- package/docs/api/player.googleanalytics.name.md +3 -0
- package/docs/api/player.googleanalytics.onbufferfull.md +3 -0
- package/docs/api/player.googleanalytics.onbuffering.md +3 -0
- package/docs/api/player.googleanalytics.ondvr.md +3 -0
- package/docs/api/player.googleanalytics.onended.md +3 -0
- package/docs/api/player.googleanalytics.onerror.md +3 -0
- package/docs/api/player.googleanalytics.onfullscreen.md +3 -0
- package/docs/api/player.googleanalytics.onhd.md +3 -0
- package/docs/api/player.googleanalytics.onpause.md +3 -0
- package/docs/api/player.googleanalytics.onplay.md +3 -0
- package/docs/api/player.googleanalytics.onready.md +3 -0
- package/docs/api/player.googleanalytics.onseek.md +3 -0
- package/docs/api/player.googleanalytics.onstop.md +3 -0
- package/docs/api/player.googleanalytics.onvolumechanged.md +3 -0
- package/docs/api/player.googleanalytics.push.md +3 -0
- package/docs/api/player.googleanalytics.supportedversion.md +3 -0
- package/docs/api/player.initeventdata.event.md +3 -0
- package/docs/api/player.initeventdata.md +7 -0
- package/docs/api/player.logo._constructor_.md +3 -0
- package/docs/api/player.logo.attributes.md +3 -0
- package/docs/api/player.logo.bindevents.md +3 -0
- package/docs/api/player.logo.md +20 -1
- package/docs/api/player.logo.name.md +3 -0
- package/docs/api/player.logo.render.md +3 -0
- package/docs/api/player.logo.stoplistening.md +3 -0
- package/docs/api/player.logo.supportedversion.md +3 -0
- package/docs/api/player.logo.template.md +3 -0
- package/docs/api/player.md +73 -21
- package/docs/api/player.mediacontrolelement.md +1 -1
- package/docs/api/player.multicamera._constructor_.md +3 -0
- package/docs/api/player.multicamera.activebyid.md +3 -0
- package/docs/api/player.multicamera.attributes.md +3 -0
- package/docs/api/player.multicamera.bindevents.md +3 -0
- package/docs/api/player.multicamera.events.md +3 -0
- package/docs/api/player.multicamera.getcameraslist.md +3 -0
- package/docs/api/player.multicamera.getcurrentcamera.md +3 -0
- package/docs/api/player.multicamera.md +30 -1
- package/docs/api/player.multicamera.name.md +3 -0
- package/docs/api/player.multicamera.render.md +3 -0
- package/docs/api/player.multicamera.supportedversion.md +3 -0
- package/docs/api/player.multicamera.template.md +3 -0
- package/docs/api/player.multicamera.unbindevents.md +3 -0
- package/docs/api/player.multicamera.version.md +3 -0
- package/docs/api/player.seektime.attributes.md +3 -0
- package/docs/api/player.seektime.bindevents.md +3 -0
- package/docs/api/player.seektime.durationshown.md +3 -0
- package/docs/api/player.seektime.getseektime.md +3 -0
- package/docs/api/player.seektime.islivestreamwithdvr.md +3 -0
- package/docs/api/player.seektime.md +31 -0
- package/docs/api/player.seektime.mediacontrol.md +3 -0
- package/docs/api/player.seektime.mediacontrolcontainer.md +3 -0
- package/docs/api/player.seektime.name.md +3 -0
- package/docs/api/player.seektime.render.md +3 -0
- package/docs/api/player.seektime.shouldbevisible.md +3 -0
- package/docs/api/player.seektime.supportedversion.md +3 -0
- package/docs/api/player.seektime.template.md +3 -0
- package/docs/api/player.seektime.update.md +3 -0
- package/docs/api/player.share.md +2 -0
- package/docs/api/player.skiptime.md +2 -0
- package/docs/api/player.stalleventdata.count.md +3 -0
- package/docs/api/player.stalleventdata.event.md +3 -0
- package/docs/api/player.stalleventdata.md +8 -3
- package/docs/api/player.stalleventdata.time.md +3 -0
- package/docs/api/player.stalleventdata.total_ms.md +3 -0
- package/docs/api/player.starteventdata.event.md +3 -0
- package/docs/api/player.starteventdata.md +7 -0
- package/docs/api/player.telemetryevent.md +11 -0
- package/docs/api/player.telemetryeventdata.md +3 -0
- package/docs/api/player.telemetrypluginsettings.md +4 -1
- package/docs/api/player.telemetrypluginsettings.send.md +3 -0
- package/docs/api/player.telemetryrecord.md +3 -0
- package/docs/api/player.thumbnails.md +21 -139
- package/docs/api/player.thumbnailspluginsettings.md +23 -0
- package/docs/api/player.volumefade.md +1 -0
- package/docs/api/player.volumefadeevents.md +7 -0
- package/docs/api/player.watcheventdata.event.md +3 -0
- package/docs/api/player.watcheventdata.md +7 -0
- package/docs/api/player.zeptoresult.md +1 -0
- package/lib/Player.d.ts +5 -3
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +30 -6
- package/lib/index.plugins.d.ts +0 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +0 -1
- package/lib/internal.types.d.ts +7 -7
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.d.ts +28 -6
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +52 -22
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +18 -2
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +21 -16
- package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -0
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +1 -0
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +31 -8
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +24 -0
- package/lib/plugins/clappr-stats/types.d.ts +12 -0
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/types.js +3 -0
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +13 -1
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +14 -4
- package/lib/plugins/clips/Clips.d.ts +34 -2
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +51 -22
- package/lib/plugins/context-menu/ContextMenu.d.ts +44 -13
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.js +48 -36
- package/lib/plugins/dvr-controls/DvrControls.d.ts +1 -3
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +11 -28
- package/lib/plugins/error-screen/ErrorScreen.d.ts +0 -1
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +0 -1
- package/lib/plugins/favicon/Favicon.d.ts +4 -0
- package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
- package/lib/plugins/favicon/Favicon.js +4 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +4 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.js +5 -1
- package/lib/plugins/index.d.ts +0 -1
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +0 -1
- package/lib/plugins/logo/Logo.d.ts +4 -0
- package/lib/plugins/logo/Logo.d.ts.map +1 -1
- package/lib/plugins/logo/Logo.js +4 -0
- package/lib/plugins/media-control/MediaControl.d.ts +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +3 -1
- package/lib/plugins/multi-camera/MultiCamera.d.ts +4 -0
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +6 -2
- package/lib/plugins/seek-time/SeekTime.d.ts +4 -0
- package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
- package/lib/plugins/seek-time/SeekTime.js +6 -2
- package/lib/plugins/share/Share.d.ts +3 -0
- package/lib/plugins/share/Share.d.ts.map +1 -1
- package/lib/plugins/share/Share.js +4 -1
- package/lib/plugins/skip-time/SkipTime.d.ts +3 -0
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/skip-time/SkipTime.js +3 -0
- package/lib/plugins/telemetry/Telemetry.d.ts +18 -0
- package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
- package/lib/plugins/telemetry/Telemetry.js +1 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts +48 -3
- package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -1
- package/lib/plugins/thumbnails/Thumbnails.js +52 -18
- package/lib/plugins/volume-fade/VolumeFade.d.ts +5 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +5 -0
- package/lib/types.d.ts +9 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/release_notes +297 -0
- package/src/Player.ts +101 -46
- package/src/__tests__/Player.test.ts +23 -1
- package/src/index.plugins.ts +0 -1
- package/src/internal.types.ts +86 -79
- package/src/plugins/audio-selector/AudioSelector.ts +227 -154
- package/src/plugins/big-mute-button/BigMuteButton.ts +100 -79
- package/src/plugins/bottom-gear/BottomGear.ts +1 -0
- package/src/plugins/clappr-stats/ClapprStats.ts +32 -8
- package/src/plugins/clappr-stats/types.ts +13 -0
- package/src/plugins/click-to-pause/ClickToPause.ts +47 -36
- package/src/plugins/clips/Clips.ts +127 -71
- package/src/plugins/context-menu/ContextMenu.ts +109 -76
- package/src/plugins/dvr-controls/DvrControls.ts +11 -30
- package/src/plugins/error-screen/ErrorScreen.ts +0 -1
- package/src/plugins/favicon/Favicon.ts +4 -0
- package/src/plugins/google-analytics/GoogleAnalytics.ts +5 -1
- package/src/plugins/index.ts +0 -1
- package/src/plugins/logo/Logo.ts +4 -0
- package/src/plugins/media-control/MediaControl.ts +4 -1
- package/src/plugins/multi-camera/MultiCamera.ts +6 -2
- package/src/plugins/seek-time/SeekTime.ts +6 -2
- package/src/plugins/share/Share.ts +4 -1
- package/src/plugins/skip-time/SkipTime.ts +3 -0
- package/src/plugins/telemetry/Telemetry.ts +18 -0
- package/src/plugins/thumbnails/Thumbnails.ts +268 -194
- package/src/plugins/volume-fade/VolumeFade.ts +5 -0
- package/src/types.ts +11 -1
- package/src/utils/types.ts +1 -0
- package/temp/player.api.json +627 -2468
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.audioselector.events.md +0 -17
- package/docs/api/player.audioselector.hideselecttrackmenu.md +0 -18
- package/docs/api/player.audioselector.name.md +0 -14
- package/docs/api/player.audioselector.onshowlevelselectmenu.md +0 -18
- package/docs/api/player.audioselector.render.md +0 -18
- package/docs/api/player.audioselector.supportedversion.md +0 -16
- package/docs/api/player.audioselector.template.md +0 -14
- package/docs/api/player.audioselector.togglecontextmenu.md +0 -18
- package/docs/api/player.audioselector.unbindevents.md +0 -18
- package/docs/api/player.audioselector.version.md +0 -14
- package/docs/api/player.bigmutebutton.bindevents.md +0 -18
- package/docs/api/player.bigmutebutton.events.md +0 -17
- package/docs/api/player.bigmutebutton.name.md +0 -14
- package/docs/api/player.bigmutebutton.render.md +0 -18
- package/docs/api/player.bigmutebutton.supportedversion.md +0 -16
- package/docs/api/player.bigmutebutton.template.md +0 -14
- package/docs/api/player.clapprstats._buildreport.md +0 -18
- package/docs/api/player.clapprstats._defaultreport.md +0 -52
- package/docs/api/player.clapprstats._playbackname.md +0 -14
- package/docs/api/player.clapprstats._playbacktype.md +0 -14
- package/docs/api/player.clapprstats.bindevents.md +0 -18
- package/docs/api/player.clapprstats.destroy.md +0 -18
- package/docs/api/player.clapprstats.name.md +0 -14
- package/docs/api/player.clapprstats.onfirstplaying.md +0 -18
- package/docs/api/player.clapprstats.playafterpause.md +0 -18
- package/docs/api/player.clapprstats.starttimers.md +0 -18
- package/docs/api/player.clapprstats.stopreporting.md +0 -18
- package/docs/api/player.clapprstats.supportedversion.md +0 -16
- package/docs/api/player.clicktopause.bindevents.md +0 -15
- package/docs/api/player.clicktopause.config.md +0 -11
- package/docs/api/player.clicktopause.name.md +0 -11
- package/docs/api/player.clicktopause.supportedversion.md +0 -13
- package/docs/api/player.clipsplugin.attributes.md +0 -13
- package/docs/api/player.clipsplugin.bindevents.md +0 -15
- package/docs/api/player.clipsplugin.makesvg.md +0 -49
- package/docs/api/player.clipsplugin.name.md +0 -11
- package/docs/api/player.clipsplugin.unbindevents.md +0 -15
- package/docs/api/player.contextmenu.attributes.md +0 -13
- package/docs/api/player.contextmenu.bindevents.md +0 -15
- package/docs/api/player.contextmenu.destroy.md +0 -15
- package/docs/api/player.contextmenu.events.md +0 -13
- package/docs/api/player.contextmenu.exposeversion.md +0 -14
- package/docs/api/player.contextmenu.label.md +0 -11
- package/docs/api/player.contextmenu.mediacontrol.md +0 -11
- package/docs/api/player.contextmenu.name.md +0 -11
- package/docs/api/player.contextmenu.render.md +0 -15
- package/docs/api/player.contextmenu.supportedversion.md +0 -13
- package/docs/api/player.contextmenu.template.md +0 -11
- package/docs/api/player.contextmenu.url.md +0 -11
- package/docs/api/player.disablecontrols.bindevents.md +0 -15
- package/docs/api/player.disablecontrols.container.md +0 -11
- package/docs/api/player.disablecontrols.md +0 -138
- package/docs/api/player.disablecontrols.name.md +0 -11
- package/docs/api/player.disablecontrols.supportedversion.md +0 -13
- package/docs/api/player.disablecontrols.unbindevents.md +0 -15
- package/docs/api/player.thumbnails.attributes.md +0 -13
- package/docs/api/player.thumbnails.bindevents.md +0 -15
- package/docs/api/player.thumbnails.name.md +0 -11
- package/docs/api/player.thumbnails.settext.md +0 -49
- package/docs/api/player.thumbnails.supportedversion.md +0 -13
- package/docs/api/player.thumbnails.template.md +0 -11
- package/src/plugins/disable-controls/DisableControls.ts +0 -81
- package/src/plugins/ga-events/GaEvents.js +0 -395
- package/src/plugins/ga-events/ga-tracking.js +0 -46
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
import { Events, UICorePlugin, $ } from '@clappr/core';
|
|
2
2
|
import { strtimeToMiliseconds } from '../utils.js';
|
|
3
3
|
import '../../../assets/clips/clips.scss';
|
|
4
|
+
import assert from 'assert';
|
|
5
|
+
/**
|
|
6
|
+
* Adds a behavior of showing a text over the seekbar to indicate the current clip.
|
|
7
|
+
* @beta
|
|
8
|
+
* @remarks
|
|
9
|
+
* Depends on:
|
|
10
|
+
*
|
|
11
|
+
* - {@link MediaControl}
|
|
12
|
+
*
|
|
13
|
+
* Configuration options - {@link ClipsPluginSettings}
|
|
14
|
+
*/
|
|
4
15
|
export class ClipsPlugin extends UICorePlugin {
|
|
5
16
|
clips = new Map();
|
|
6
17
|
duration = 0;
|
|
7
18
|
durationGetting = false;
|
|
8
19
|
_oldContainer;
|
|
9
20
|
svgMask = null;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
10
24
|
get name() {
|
|
11
|
-
return '
|
|
25
|
+
return 'clips';
|
|
12
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
13
30
|
get attributes() {
|
|
14
31
|
return {
|
|
15
|
-
|
|
32
|
+
class: this.name,
|
|
16
33
|
};
|
|
17
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
18
38
|
bindEvents() {
|
|
39
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
40
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
19
41
|
this.listenToOnce(this.core, Events.CORE_READY, this._onCoreReady);
|
|
20
|
-
|
|
42
|
+
// TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
|
|
43
|
+
this.listenTo(mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
|
|
21
44
|
this.listenTo(this.core, Events.CORE_RESIZE, this.playerResize);
|
|
22
45
|
}
|
|
23
46
|
_onCoreReady() {
|
|
@@ -27,12 +50,6 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
27
50
|
}
|
|
28
51
|
this.parseClips();
|
|
29
52
|
}
|
|
30
|
-
unbindEvents() {
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
this.stopListening(this.core, Events.CORE_READY);
|
|
33
|
-
// @ts-ignore
|
|
34
|
-
this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED);
|
|
35
|
-
}
|
|
36
53
|
_onMediaControlContainerChanged() {
|
|
37
54
|
this._bindContainerEvents();
|
|
38
55
|
}
|
|
@@ -46,9 +63,10 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
46
63
|
if (this._oldContainer) {
|
|
47
64
|
this.stopListening(this._oldContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
48
65
|
}
|
|
49
|
-
|
|
66
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
67
|
+
this._oldContainer = mediaControl.container;
|
|
50
68
|
this.durationGetting = false;
|
|
51
|
-
this.listenTo(
|
|
69
|
+
this.listenTo(mediaControl.container, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
52
70
|
}
|
|
53
71
|
onTimeUpdate(event) {
|
|
54
72
|
if (!this.durationGetting) {
|
|
@@ -65,13 +83,17 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
65
83
|
}
|
|
66
84
|
parseClips() {
|
|
67
85
|
const textArr = this.options.clips.text.split('\n');
|
|
68
|
-
const clipsArr = textArr
|
|
86
|
+
const clipsArr = textArr
|
|
87
|
+
.map((val) => {
|
|
69
88
|
const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
|
|
70
|
-
return matchRes
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
89
|
+
return matchRes
|
|
90
|
+
? {
|
|
91
|
+
start: strtimeToMiliseconds(matchRes[1]),
|
|
92
|
+
text: matchRes[2],
|
|
93
|
+
}
|
|
94
|
+
: null;
|
|
95
|
+
})
|
|
96
|
+
.filter((clip) => clip !== null);
|
|
75
97
|
clipsArr.sort((a, b) => a.start - b.start);
|
|
76
98
|
clipsArr.forEach((clip, index) => {
|
|
77
99
|
this.clips.set(clip.start, {
|
|
@@ -82,6 +104,11 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
82
104
|
});
|
|
83
105
|
});
|
|
84
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns the text of the current clip.
|
|
109
|
+
* @param time - The current time of the player.
|
|
110
|
+
* @returns The text of the current clip.
|
|
111
|
+
*/
|
|
85
112
|
getText(time) {
|
|
86
113
|
for (const [key, value] of this.clips.entries()) {
|
|
87
114
|
if (time >= value.start && time < value.end) {
|
|
@@ -92,14 +119,14 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
92
119
|
}
|
|
93
120
|
makeSvg(duration) {
|
|
94
121
|
let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
|
|
95
|
-
const widthOfSeek = this.core.
|
|
122
|
+
const widthOfSeek = this.core.activeContainer.$el.width();
|
|
96
123
|
let finishValue = 0;
|
|
97
|
-
this.clips.forEach(val => {
|
|
124
|
+
this.clips.forEach((val) => {
|
|
98
125
|
let end = val.end;
|
|
99
126
|
if (!end) {
|
|
100
127
|
end = val.end = duration;
|
|
101
128
|
}
|
|
102
|
-
const widthChunk = (end - val.start) * widthOfSeek / duration;
|
|
129
|
+
const widthChunk = ((end - val.start) * widthOfSeek) / duration;
|
|
103
130
|
svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
|
|
104
131
|
finishValue += widthChunk;
|
|
105
132
|
});
|
|
@@ -112,7 +139,8 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
112
139
|
if (this.svgMask) {
|
|
113
140
|
this.svgMask.remove();
|
|
114
141
|
}
|
|
115
|
-
const
|
|
142
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
143
|
+
const $seekBarContainer = mediaControl.getElement('seekBarContainer');
|
|
116
144
|
if ($seekBarContainer?.get(0)) {
|
|
117
145
|
$seekBarContainer.addClass('clips');
|
|
118
146
|
}
|
|
@@ -120,7 +148,8 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
120
148
|
$seekBarContainer?.append(this.svgMask);
|
|
121
149
|
}
|
|
122
150
|
setClipText(text) {
|
|
123
|
-
const
|
|
151
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
152
|
+
const $clipText = mediaControl.getElement('clipText');
|
|
124
153
|
if ($clipText && text) {
|
|
125
154
|
$clipText.show();
|
|
126
155
|
$clipText.text(`${text}`);
|
|
@@ -1,36 +1,67 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Container, UIContainerPlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/context-menu/context_menu.scss';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The plugin adds a context menu to the player.
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
export interface ContextMenuPluginSettings {
|
|
8
|
+
label?: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
preventShowContextMenu?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Displays a small context menu when clicked on the player container.
|
|
14
|
+
* @beta
|
|
15
|
+
* @remarks
|
|
16
|
+
* Configuration options - {@link ContextMenuPluginSettings}
|
|
17
|
+
*/
|
|
18
|
+
export declare class ContextMenu extends UIContainerPlugin {
|
|
4
19
|
private _label;
|
|
5
20
|
private _url;
|
|
6
|
-
private container;
|
|
7
21
|
private menuOptions;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
8
25
|
get name(): string;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
9
29
|
get supportedVersion(): {
|
|
10
30
|
min: string;
|
|
11
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
12
35
|
get attributes(): {
|
|
13
36
|
class: string;
|
|
14
37
|
};
|
|
15
|
-
|
|
16
|
-
get
|
|
17
|
-
get
|
|
18
|
-
get
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
38
|
+
private static readonly template;
|
|
39
|
+
private get label();
|
|
40
|
+
private get url();
|
|
41
|
+
private get exposeVersion();
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
23
45
|
get events(): {
|
|
24
46
|
'click [data-version]': string;
|
|
25
47
|
};
|
|
26
|
-
constructor(
|
|
48
|
+
constructor(container: Container);
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
27
52
|
bindEvents(): void;
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
28
56
|
destroy(): import("@clappr/core").UIObject;
|
|
29
|
-
private containerChanged;
|
|
30
57
|
private toggleContextMenu;
|
|
31
58
|
private show;
|
|
32
59
|
private hide;
|
|
33
60
|
private onOpenMainPage;
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
34
64
|
render(): this;
|
|
65
|
+
private hideOnBodyClick;
|
|
35
66
|
}
|
|
36
67
|
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/context-menu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/context-menu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EACT,iBAAiB,EAClB,MAAM,cAAc,CAAA;AAIrB,OAAO,gDAAgD,CAAA;AASvD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IAChD,OAAO,CAAC,MAAM,CAAa;IAE3B,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO,CAAC,WAAW,CAAmB;IAEtC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,UAAU;;MAEtB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAEzD,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,GAAG,GAEd;IAED,OAAO,KAAK,aAAa,GAKxB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;gBAEW,SAAS,EAAE,SAAS;IAYhC;;OAEG;IACM,UAAU;IAUnB;;OAEG;IACM,OAAO;IAKhB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,cAAc;IAItB;;OAEG;IACM,MAAM;IASf,OAAO,CAAC,eAAe,CAEtB;CACF"}
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Events, template, $, UIContainerPlugin, } from '@clappr/core';
|
|
2
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
|
+
import { version } from '../../version.js';
|
|
6
|
+
/**
|
|
7
|
+
* Displays a small context menu when clicked on the player container.
|
|
8
|
+
* @beta
|
|
9
|
+
* @remarks
|
|
10
|
+
* Configuration options - {@link ContextMenuPluginSettings}
|
|
11
|
+
*/
|
|
12
|
+
export class ContextMenu extends UIContainerPlugin {
|
|
6
13
|
_label = '';
|
|
7
14
|
_url = '';
|
|
8
|
-
container = null;
|
|
9
15
|
menuOptions = [];
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
10
19
|
get name() {
|
|
11
20
|
return 'context_menu';
|
|
12
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
13
25
|
get supportedVersion() {
|
|
14
26
|
return { min: CLAPPR_VERSION };
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
16
31
|
get attributes() {
|
|
17
|
-
return {
|
|
18
|
-
}
|
|
19
|
-
get mediaControl() {
|
|
20
|
-
return this.core.mediaControl;
|
|
21
|
-
}
|
|
22
|
-
get template() {
|
|
23
|
-
return template(templateHtml);
|
|
32
|
+
return { class: 'context-menu' };
|
|
24
33
|
}
|
|
34
|
+
static template = template(templateHtml);
|
|
25
35
|
get label() {
|
|
26
|
-
return this._label || 'Gcore player ver. ' +
|
|
36
|
+
return this._label || 'Gcore player ver. ' + version().gplayer;
|
|
27
37
|
}
|
|
28
38
|
get url() {
|
|
29
39
|
return this._url || 'https://gcore.com/';
|
|
@@ -31,16 +41,19 @@ export class ContextMenu extends UICorePlugin {
|
|
|
31
41
|
get exposeVersion() {
|
|
32
42
|
return {
|
|
33
43
|
label: this.label,
|
|
34
|
-
name: 'version'
|
|
44
|
+
name: 'version',
|
|
35
45
|
};
|
|
36
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
37
50
|
get events() {
|
|
38
51
|
return {
|
|
39
|
-
'click [data-version]': 'onOpenMainPage'
|
|
52
|
+
'click [data-version]': 'onOpenMainPage',
|
|
40
53
|
};
|
|
41
54
|
}
|
|
42
|
-
constructor(
|
|
43
|
-
super(
|
|
55
|
+
constructor(container) {
|
|
56
|
+
super(container);
|
|
44
57
|
if (this.options.contextMenu && this.options.contextMenu.label) {
|
|
45
58
|
this._label = this.options.contextMenu.label;
|
|
46
59
|
}
|
|
@@ -50,28 +63,21 @@ export class ContextMenu extends UICorePlugin {
|
|
|
50
63
|
this.render();
|
|
51
64
|
this.bindEvents();
|
|
52
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
53
69
|
bindEvents() {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.listenTo(this.container, Events.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
|
|
58
|
-
this.listenTo(this.container, Events.CONTAINER_CLICK, this.hide);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
$('body').on('click', this.hide.bind(this));
|
|
70
|
+
this.listenTo(this.container, Events.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
|
|
71
|
+
this.listenTo(this.container, Events.CONTAINER_CLICK, this.hide);
|
|
72
|
+
$('body').on('click', this.hideOnBodyClick);
|
|
62
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
63
77
|
destroy() {
|
|
64
|
-
$('body').off('click', this.
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
this.stopListening();
|
|
78
|
+
$('body').off('click', this.hideOnBodyClick);
|
|
67
79
|
return super.destroy();
|
|
68
80
|
}
|
|
69
|
-
containerChanged() {
|
|
70
|
-
this.container = this.core.activeContainer;
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
this.stopListening();
|
|
73
|
-
this.bindEvents();
|
|
74
|
-
}
|
|
75
81
|
toggleContextMenu(event) {
|
|
76
82
|
event.preventDefault();
|
|
77
83
|
const offset = this.container?.$el.offset();
|
|
@@ -79,7 +85,8 @@ export class ContextMenu extends UICorePlugin {
|
|
|
79
85
|
}
|
|
80
86
|
show(top, left) {
|
|
81
87
|
this.hide();
|
|
82
|
-
if (this.options.contextMenu &&
|
|
88
|
+
if (this.options.contextMenu &&
|
|
89
|
+
this.options.contextMenu.preventShowContextMenu) {
|
|
83
90
|
return;
|
|
84
91
|
}
|
|
85
92
|
this.$el.css({ top, left });
|
|
@@ -91,12 +98,17 @@ export class ContextMenu extends UICorePlugin {
|
|
|
91
98
|
onOpenMainPage() {
|
|
92
99
|
window.open(this.url, '_blank');
|
|
93
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
94
104
|
render() {
|
|
95
105
|
this.menuOptions = [this.exposeVersion];
|
|
96
|
-
this.$el.html(
|
|
97
|
-
this.
|
|
106
|
+
this.$el.html(ContextMenu.template({ options: this.menuOptions }));
|
|
107
|
+
this.container.$el.append(this.$el); // TODO append to the container, turn into a container plugin
|
|
98
108
|
this.hide();
|
|
99
|
-
this.disable();
|
|
100
109
|
return this;
|
|
101
110
|
}
|
|
111
|
+
hideOnBodyClick = () => {
|
|
112
|
+
this.hide();
|
|
113
|
+
};
|
|
102
114
|
}
|
|
@@ -7,7 +7,7 @@ import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
|
7
7
|
* @remarks
|
|
8
8
|
* Depends on:
|
|
9
9
|
*
|
|
10
|
-
* - {@link MediaControl
|
|
10
|
+
* - {@link MediaControl}
|
|
11
11
|
*
|
|
12
12
|
* The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
|
|
13
13
|
*/
|
|
@@ -41,9 +41,7 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
41
41
|
* @internal
|
|
42
42
|
*/
|
|
43
43
|
bindEvents(): void;
|
|
44
|
-
private bindCoreEvents;
|
|
45
44
|
private bindContainerEvents;
|
|
46
|
-
private containerChanged;
|
|
47
45
|
private dvrChanged;
|
|
48
46
|
private click;
|
|
49
47
|
private settingsUpdate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAC;AAM9E,OAAO,gDAAgD,CAAC;AAExD;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAErD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;gBAEW,IAAI,EAAE,IAAI;IAKtB;;OAEG;IACM,UAAU;
|
|
1
|
+
{"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAC;AAM9E,OAAO,gDAAgD,CAAC;AAExD;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAErD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACH,IAAa,UAAU;;;MAKtB;gBAEW,IAAI,EAAE,IAAI;IAKtB;;OAEG;IACM,UAAU;IAQnB,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACM,MAAM;CAehB"}
|
|
@@ -10,7 +10,7 @@ import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
|
10
10
|
* @remarks
|
|
11
11
|
* Depends on:
|
|
12
12
|
*
|
|
13
|
-
* - {@link MediaControl
|
|
13
|
+
* - {@link MediaControl}
|
|
14
14
|
*
|
|
15
15
|
* The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
|
|
16
16
|
*/
|
|
@@ -20,7 +20,7 @@ export class DvrControls extends UICorePlugin {
|
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
22
|
get name() {
|
|
23
|
-
return '
|
|
23
|
+
return 'dvr_controls';
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @internal
|
|
@@ -53,32 +53,15 @@ export class DvrControls extends UICorePlugin {
|
|
|
53
53
|
* @internal
|
|
54
54
|
*/
|
|
55
55
|
bindEvents() {
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
bindCoreEvents() {
|
|
63
|
-
if (this.core.mediaControl.settings) {
|
|
64
|
-
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
|
|
65
|
-
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.settingsUpdate);
|
|
66
|
-
this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.render);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
setTimeout(() => this.bindCoreEvents(), 100);
|
|
70
|
-
}
|
|
56
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
57
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
58
|
+
this.listenTo(mediaControl, Events.MEDIACONTROL_RENDERED, this.settingsUpdate);
|
|
59
|
+
this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.render);
|
|
60
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.bindContainerEvents);
|
|
71
61
|
}
|
|
72
62
|
bindContainerEvents() {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.listenTo(this.core.activeContainer, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
containerChanged() {
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
this.stopListening();
|
|
81
|
-
this.bindEvents();
|
|
63
|
+
this.listenToOnce(this.core.activeContainer, Events.CONTAINER_TIMEUPDATE, this.render);
|
|
64
|
+
this.listenTo(this.core.activeContainer, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
|
|
82
65
|
}
|
|
83
66
|
dvrChanged(dvrEnabled) {
|
|
84
67
|
if (this.core.getPlaybackType() !== Playback.LIVE) {
|
|
@@ -111,7 +94,7 @@ export class DvrControls extends UICorePlugin {
|
|
|
111
94
|
settingsUpdate() {
|
|
112
95
|
// @ts-ignore
|
|
113
96
|
this.stopListening(); // TODO sort out
|
|
114
|
-
this.core.
|
|
97
|
+
this.core.getPlugin('media_control').$el.removeClass('live'); // TODO don't access directly
|
|
115
98
|
if (this.shouldRender()) {
|
|
116
99
|
this.render();
|
|
117
100
|
this.$el.click(() => this.click());
|
|
@@ -131,7 +114,7 @@ export class DvrControls extends UICorePlugin {
|
|
|
131
114
|
backToLive: this.core.i18n.t('back_to_live')
|
|
132
115
|
}));
|
|
133
116
|
if (this.shouldRender()) {
|
|
134
|
-
const mediaControl = this.core.
|
|
117
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
135
118
|
assert(mediaControl, 'media_control plugin is required');
|
|
136
119
|
// TODO don't tap into the $el directly
|
|
137
120
|
mediaControl.$el.addClass('live');
|
|
@@ -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
|
|
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;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAK;IAEnB,OAAO,CAAC,GAAG,CAAoC;IAE/C,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAI,SAAS,QAEZ;IAED,IAAa,UAAU;;;MAKtB;IAEQ,UAAU;IAQnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,YAAY;IAWpB,YAAY;IASZ,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,OAAO;IAqDf,OAAO,CAAC,MAAM;IAad,IAAI,CAAC,GAAG,CAAC,EAAE,mBAAmB;IAU9B,IAAI;IAIK,MAAM;CAYhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Favicon.d.ts","sourceRoot":"","sources":["../../../src/plugins/favicon/Favicon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,IAAI,EAAa,MAAM,cAAc,CAAC;AActE,qBAAa,OAAQ,SAAQ,UAAU;IACrC,OAAO,CAAC,UAAU,CAA0B;IAE5C,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,QAAQ,CAA4B;IAE5C,OAAO,CAAC,SAAS,CAA4B;IAE7C,OAAO,CAAC,QAAQ,CAA4B;IAE5C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;gBAMW,IAAI,EAAE,IAAI;IAUtB,SAAS;IAaA,UAAU;IAMnB,OAAO,CAAC,gBAAgB;IAYf,OAAO;IAKP,OAAO;IAKhB,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;CAMnB"}
|
|
1
|
+
{"version":3,"file":"Favicon.d.ts","sourceRoot":"","sources":["../../../src/plugins/favicon/Favicon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,IAAI,EAAa,MAAM,cAAc,CAAC;AActE;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,UAAU;IACrC,OAAO,CAAC,UAAU,CAA0B;IAE5C,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,QAAQ,CAA4B;IAE5C,OAAO,CAAC,SAAS,CAA4B;IAE7C,OAAO,CAAC,QAAQ,CAA4B;IAE5C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;gBAMW,IAAI,EAAE,IAAI;IAUtB,SAAS;IAaA,UAAU;IAMnB,OAAO,CAAC,gBAAgB;IAYf,OAAO;IAKP,OAAO;IAKhB,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;CAMnB"}
|
|
@@ -6,6 +6,10 @@ import stopIcon from '../../../assets/icons/new/stop.svg';
|
|
|
6
6
|
const FAVICON_COLOR = '#567';
|
|
7
7
|
const FAVICON_SELECTOR = 'link[rel="shortcut icon"]';
|
|
8
8
|
// const oldIcon = $(FAVICON_SELECTOR);
|
|
9
|
+
/**
|
|
10
|
+
* The plugin adds custom favicon to the player's tab.
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
9
13
|
export class Favicon extends CorePlugin {
|
|
10
14
|
_container = null;
|
|
11
15
|
oldIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleAnalytics.d.ts","sourceRoot":"","sources":["../../../src/plugins/google-analytics/GoogleAnalytics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAQlE,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,WAAW,CAAc;IAEjC,OAAO,CAAC,UAAU,CAAc;IAEhC,OAAO,CAAC,cAAc,CAAoB;IAE1C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;gBAEW,SAAS,EAAE,SAAS;IAUhC,WAAW;IAcX,iBAAiB;IAuBjB,OAAO;IAIP,MAAM;IAIN,MAAM;IAIN,OAAO;IAIP,WAAW;IAIX,YAAY;IAIZ,OAAO;IAIP,IAAI,CAAC,IAAI,EAAE,OAAO;IASlB,OAAO,CAAC,iBAAiB;IAMzB,KAAK,CAAC,QAAQ,EAAE,OAAO;IAMvB,OAAO;IAIP,MAAM;IAIN,eAAe;IAIf,YAAY;IAIZ,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;CAKrB"}
|
|
1
|
+
{"version":3,"file":"GoogleAnalytics.d.ts","sourceRoot":"","sources":["../../../src/plugins/google-analytics/GoogleAnalytics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAQlE;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,WAAW,CAAc;IAEjC,OAAO,CAAC,UAAU,CAAc;IAEhC,OAAO,CAAC,cAAc,CAAoB;IAE1C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;gBAEW,SAAS,EAAE,SAAS;IAUhC,WAAW;IAcX,iBAAiB;IAuBjB,OAAO;IAIP,MAAM;IAIN,MAAM;IAIN,OAAO;IAIP,WAAW;IAIX,YAAY;IAIZ,OAAO;IAIP,IAAI,CAAC,IAAI,EAAE,OAAO;IASlB,OAAO,CAAC,iBAAiB;IAMzB,KAAK,CAAC,QAAQ,EAAE,OAAO;IAMvB,OAAO;IAIP,MAAM;IAIN,eAAe;IAIf,YAAY;IAIZ,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;CAKrB"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
|
-
// license that can be found
|
|
3
|
+
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE
|
|
4
4
|
import { ContainerPlugin, Events } from '@clappr/core';
|
|
5
5
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
6
|
+
/**
|
|
7
|
+
* An example Google Analytics integration plugin
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
6
10
|
export class GoogleAnalytics extends ContainerPlugin {
|
|
7
11
|
account = '';
|
|
8
12
|
trackerName = '';
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from "./clappr-stats/ClapprStats.js";
|
|
|
12
12
|
export * from "./click-to-pause/ClickToPause.js";
|
|
13
13
|
export * from "./clips/Clips.js";
|
|
14
14
|
export * from "./context-menu/ContextMenu.js";
|
|
15
|
-
export * from "./disable-controls/DisableControls.js";
|
|
16
15
|
export * from "./dvr-controls/DvrControls.js";
|
|
17
16
|
export * from "./error-screen/ErrorScreen.js";
|
|
18
17
|
export * from "./favicon/Favicon.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AAErC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,6BAA6B,CAAC"}
|
package/lib/plugins/index.js
CHANGED
|
@@ -12,7 +12,6 @@ export * from "./clappr-stats/ClapprStats.js";
|
|
|
12
12
|
export * from "./click-to-pause/ClickToPause.js";
|
|
13
13
|
export * from "./clips/Clips.js";
|
|
14
14
|
export * from "./context-menu/ContextMenu.js";
|
|
15
|
-
export * from "./disable-controls/DisableControls.js";
|
|
16
15
|
export * from "./dvr-controls/DvrControls.js";
|
|
17
16
|
export * from "./error-screen/ErrorScreen.js";
|
|
18
17
|
export * from "./favicon/Favicon.js";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { UIContainerPlugin, Container } from '@clappr/core';
|
|
2
2
|
import '../../../assets/logo/styles/logo.scss';
|
|
3
|
+
/**
|
|
4
|
+
* The plugin adds custom logo to the player.
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
3
7
|
export declare class Logo extends UIContainerPlugin {
|
|
4
8
|
private hasStartedPlaying;
|
|
5
9
|
private $logoContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/plugins/logo/Logo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,SAAS,EAAE,MAAM,cAAc,CAAC;AAOnF,OAAO,uCAAuC,CAAC;AAe/C,qBAAa,IAAK,SAAQ,iBAAiB;IACzC,OAAO,CAAC,iBAAiB,CAAS;IAElC,OAAO,CAAC,cAAc,CAA4B;IAElD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAa,UAAU;;;MAKtB;IAED,OAAO,KAAK,YAAY,GAEvB;IAEQ,UAAU;IAQV,aAAa;IAMtB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,MAAM;gBAYF,SAAS,EAAE,SAAS;IAYvB,MAAM;IAaf,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,YAAY;IA6DpB,OAAO,CAAC,WAAW;IAuCnB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;CAKjB"}
|
|
1
|
+
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/plugins/logo/Logo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,SAAS,EAAE,MAAM,cAAc,CAAC;AAOnF,OAAO,uCAAuC,CAAC;AAe/C;;;GAGG;AACH,qBAAa,IAAK,SAAQ,iBAAiB;IACzC,OAAO,CAAC,iBAAiB,CAAS;IAElC,OAAO,CAAC,cAAc,CAA4B;IAElD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAa,UAAU;;;MAKtB;IAED,OAAO,KAAK,YAAY,GAEvB;IAEQ,UAAU;IAQV,aAAa;IAMtB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,MAAM;gBAYF,SAAS,EAAE,SAAS;IAYvB,MAAM;IAaf,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,YAAY;IA6DpB,OAAO,CAAC,WAAW;IAuCnB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;CAKjB"}
|
package/lib/plugins/logo/Logo.js
CHANGED
|
@@ -3,6 +3,10 @@ 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';
|
|
6
|
+
/**
|
|
7
|
+
* The plugin adds custom logo to the player.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
6
10
|
export class Logo extends UIContainerPlugin {
|
|
7
11
|
hasStartedPlaying = false;
|
|
8
12
|
$logoContainer = null;
|
|
@@ -6,7 +6,7 @@ import '../../../assets/media-control/plugins.scss';
|
|
|
6
6
|
* Media control elements, mount points for additional plugins
|
|
7
7
|
* @beta
|
|
8
8
|
*/
|
|
9
|
-
export type MediaControlElement = 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer' | 'subtitlesSelector';
|
|
9
|
+
export type MediaControlElement = 'audioTracksSelector' | 'bottomGear' | 'clipText' | 'gear' | 'pip' | 'playbackRate' | 'seekBarContainer' | 'subtitlesSelector';
|
|
10
10
|
/**
|
|
11
11
|
* The MediaControl provides a foundation for developing custom media controls UI.
|
|
12
12
|
* @beta
|