@gcorevideo/player 2.22.18 → 2.22.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/audio-selector/track-selector.ejs +3 -3
- package/assets/bottom-gear/bottomgear.ejs +3 -3
- package/assets/dvr-controls/dvr_controls.scss +0 -12
- package/assets/level-selector/button.ejs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.css +664 -671
- package/dist/index.js +285 -260
- package/dist/player.d.ts +144 -123
- package/dist/plugins/index.css +758 -765
- package/dist/plugins/index.js +194 -172
- package/docs/api/player.clapprstats.exportmetrics.md +2 -2
- package/docs/api/player.clapprstats.md +0 -4
- package/docs/api/player.clapprstatsbitratetrack.md +20 -0
- package/docs/api/player.clapprstatschronograph.md +115 -0
- package/docs/api/player.clapprstatscounter.md +211 -0
- package/docs/api/player.clapprstatsevents.md +51 -0
- package/docs/api/player.clapprstatsmetrics.md +52 -0
- package/docs/api/player.clipspluginsettings.md +1 -1
- package/docs/api/player.gearevents.md +1 -1
- package/docs/api/player.md +57 -2
- package/docs/api/player.mediacontrol.mount.md +0 -5
- package/docs/api/player.mediacontrol.putelement.md +5 -0
- package/docs/api/player.mediacontrol.toggleelement.md +1 -1
- package/docs/api/player.nerdstats.md +3 -3
- package/docs/api/player.playerconfig.md +1 -1
- package/docs/api/player.playerconfig.playbacktype.md +6 -1
- package/docs/api/player.timeupdate.md +6 -3
- package/lib/plugins/audio-selector/AudioSelector.d.ts +1 -1
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +15 -8
- package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +2 -2
- package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +4 -4
- package/lib/plugins/clappr-nerd-stats/NerdStats.js +4 -4
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +5 -2
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +31 -33
- package/lib/plugins/clappr-stats/types.d.ts +21 -21
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/types.js +22 -22
- package/lib/plugins/clappr-stats/utils.d.ts +2 -2
- package/lib/plugins/clappr-stats/utils.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- package/lib/plugins/clips/Clips.d.ts +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +6 -2
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +39 -27
- package/lib/plugins/media-control/MediaControl.d.ts +9 -2
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +26 -10
- package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +1 -1
- package/lib/plugins/vast-ads/VastAds.js +1 -1
- package/lib/plugins/vast-ads/rollmanager.js +1 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts +25 -10
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +62 -60
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +7 -4
- package/lib/types.d.ts +1 -1
- package/package.json +3 -3
- package/src/playback/__tests__/HTML5Video.test.ts +2 -2
- package/src/plugins/audio-selector/AudioSelector.ts +14 -7
- package/src/plugins/audio-selector/__tests__/AudioSelector.test.ts +8 -8
- package/src/plugins/audio-selector/__tests__/__snapshots__/AudioSelector.test.ts.snap +15 -15
- package/src/plugins/bottom-gear/BottomGear.ts +2 -2
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +8 -5
- package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +3 -3
- package/src/plugins/clappr-nerd-stats/NerdStats.ts +5 -5
- package/src/plugins/clappr-stats/ClapprStats.ts +41 -40
- package/src/plugins/clappr-stats/__tests__/ClapprStats.test.ts +12 -12
- package/src/plugins/clappr-stats/types.ts +21 -21
- package/src/plugins/clappr-stats/utils.ts +2 -2
- package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
- package/src/plugins/clips/Clips.ts +1 -1
- package/src/plugins/clips/__tests__/Clips.test.ts +1 -1
- package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +1 -1
- package/src/plugins/dvr-controls/DvrControls.ts +51 -37
- package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +84 -26
- package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +0 -12
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +1 -1
- package/src/plugins/media-control/MediaControl.ts +27 -10
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +8 -5
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +20 -20
- package/src/plugins/picture-in-picture/PictureInPicture.ts +1 -1
- package/src/plugins/subtitles/ClosedCaptions.ts +1 -1
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +1 -1
- package/src/plugins/vast-ads/VastAds.ts +1 -1
- package/src/plugins/vast-ads/rollmanager.ts +1 -1
- package/src/plugins/volume-fade/VolumeFade.ts +92 -75
- package/src/testUtils.ts +11 -5
- package/src/types.ts +1 -1
- package/temp/player.api.json +634 -16
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio-selector/AudioSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAY,MAAM,cAAc,CAAA;AAO7D,OAAO,2CAA2C,CAAA;
|
|
1
|
+
{"version":3,"file":"AudioSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/audio-selector/AudioSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAY,MAAM,cAAc,CAAA;AAO7D,OAAO,2CAA2C,CAAA;AAUlD;;;;;;;;;GASG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,YAAY,CAA0B;IAE9C,OAAO,CAAC,MAAM,CAAmB;IAEjC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED;;OAEG;IACH,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACM,MAAM;IAmBf,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,qBAAqB;CAe9B"}
|
|
@@ -4,6 +4,7 @@ import { CLAPPR_VERSION } from '../../build.js';
|
|
|
4
4
|
import pluginHtml from '../../../assets/audio-selector/track-selector.ejs';
|
|
5
5
|
import '../../../assets/audio-selector/style.scss';
|
|
6
6
|
import audioArrow from '../../../assets/icons/old/quality-arrow.svg';
|
|
7
|
+
// import { trace } from '@gcorevideo/utils'
|
|
7
8
|
const VERSION = '2.22.4';
|
|
8
9
|
// const T = 'plugins.audiotracks'
|
|
9
10
|
/**
|
|
@@ -66,7 +67,7 @@ export class AudioTracks extends UICorePlugin {
|
|
|
66
67
|
const mediaControl = this.core.getPlugin('media_control');
|
|
67
68
|
assert(mediaControl, 'media_control plugin is required');
|
|
68
69
|
this.listenTo(mediaControl, Events.MEDIACONTROL_RENDERED, () => {
|
|
69
|
-
mediaControl.
|
|
70
|
+
mediaControl.mount('audiotracks', this.$el);
|
|
70
71
|
});
|
|
71
72
|
this.listenTo(mediaControl, Events.MEDIACONTROL_HIDE, this.hideMenu);
|
|
72
73
|
}
|
|
@@ -97,18 +98,18 @@ export class AudioTracks extends UICorePlugin {
|
|
|
97
98
|
if (!this.shouldRender()) {
|
|
98
99
|
return this;
|
|
99
100
|
}
|
|
100
|
-
const mediaControl = this.core.getPlugin('media_control');
|
|
101
101
|
this.$el.html(AudioTracks.template({
|
|
102
102
|
tracks: this.tracks,
|
|
103
103
|
title: this.getTitle(),
|
|
104
104
|
icon: audioArrow,
|
|
105
|
+
current: this.currentTrack?.id,
|
|
105
106
|
}));
|
|
106
107
|
this.updateText();
|
|
107
108
|
this.highlightCurrentTrack();
|
|
108
109
|
return this;
|
|
109
110
|
}
|
|
110
111
|
onTrackSelect(event) {
|
|
111
|
-
const id = event.
|
|
112
|
+
const id = event.currentTarget?.dataset?.audiotracksSelect;
|
|
112
113
|
if (id) {
|
|
113
114
|
this.selectAudioTrack(id);
|
|
114
115
|
}
|
|
@@ -117,7 +118,7 @@ export class AudioTracks extends UICorePlugin {
|
|
|
117
118
|
return false;
|
|
118
119
|
}
|
|
119
120
|
selectAudioTrack(id) {
|
|
120
|
-
this.
|
|
121
|
+
this.startTrackSwitching();
|
|
121
122
|
this.core.activeContainer.switchAudioTrack(id);
|
|
122
123
|
this.updateText();
|
|
123
124
|
}
|
|
@@ -125,7 +126,9 @@ export class AudioTracks extends UICorePlugin {
|
|
|
125
126
|
this.$el.find('#audiotracks-select').addClass('hidden');
|
|
126
127
|
}
|
|
127
128
|
toggleContextMenu() {
|
|
128
|
-
this.$el.find('#audiotracks-select').toggleClass('hidden');
|
|
129
|
+
this.$el.find('#audiotracks-select').toggleClass('hidden'); // TODO use plain CSS display: none
|
|
130
|
+
const open = !this.$el.find('#audiotracks-select').hasClass('hidden'); // TODO hold state
|
|
131
|
+
this.$el.find('#audiotracks-button').attr('aria-expanded', open);
|
|
129
132
|
}
|
|
130
133
|
buttonElement() {
|
|
131
134
|
return this.$('button');
|
|
@@ -143,7 +146,7 @@ export class AudioTracks extends UICorePlugin {
|
|
|
143
146
|
}
|
|
144
147
|
return this.currentTrack.label || this.currentTrack.language;
|
|
145
148
|
}
|
|
146
|
-
|
|
149
|
+
startTrackSwitching() {
|
|
147
150
|
this.buttonElement().addClass('changing');
|
|
148
151
|
}
|
|
149
152
|
updateText() {
|
|
@@ -154,12 +157,16 @@ export class AudioTracks extends UICorePlugin {
|
|
|
154
157
|
}
|
|
155
158
|
highlightCurrentTrack() {
|
|
156
159
|
this.trackElement().removeClass('current');
|
|
157
|
-
this.trackElement()
|
|
160
|
+
this.trackElement()
|
|
161
|
+
.find('a')
|
|
162
|
+
.removeClass('gcore-skin-active')
|
|
163
|
+
.attr('aria-checked', 'false');
|
|
158
164
|
if (this.currentTrack) {
|
|
159
165
|
this.trackElement(this.currentTrack.id)
|
|
160
166
|
.addClass('current')
|
|
161
167
|
.find('a')
|
|
162
|
-
.addClass('gcore-skin-active')
|
|
168
|
+
.addClass('gcore-skin-active')
|
|
169
|
+
.attr('aria-checked', 'true');
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
}
|
|
@@ -8,7 +8,7 @@ import { ZeptoResult } from '../../types.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare enum GearEvents {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Subscribe to this event to accurately attach an item to the gear menu
|
|
12
12
|
*/
|
|
13
13
|
RENDERED = "rendered"
|
|
14
14
|
}
|
|
@@ -16,7 +16,7 @@ const T = 'plugins.bottom_gear';
|
|
|
16
16
|
export var GearEvents;
|
|
17
17
|
(function (GearEvents) {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Subscribe to this event to accurately attach an item to the gear menu
|
|
20
20
|
*/
|
|
21
21
|
GearEvents["RENDERED"] = "rendered";
|
|
22
22
|
})(GearEvents || (GearEvents = {}));
|
|
@@ -237,6 +237,6 @@ export class BottomGear extends UICorePlugin {
|
|
|
237
237
|
onMediaControlRendered() {
|
|
238
238
|
trace(`${T} onMediaControlRendered`);
|
|
239
239
|
const mediaControl = this.core.getPlugin('media_control');
|
|
240
|
-
mediaControl.
|
|
240
|
+
mediaControl.mount('gear', this.$el);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { UICorePlugin, Core } from '@clappr/core';
|
|
2
2
|
import '../../../assets/clappr-nerd-stats/clappr-nerd-stats.scss';
|
|
3
3
|
/**
|
|
4
|
-
* `PLUGIN` that displays useful network
|
|
4
|
+
* `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
|
|
5
5
|
* @beta
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* Depends on:
|
|
9
9
|
*
|
|
10
|
-
* - {@link BottomGear}
|
|
11
|
-
*
|
|
12
|
-
* - {@link ClapprStats}
|
|
10
|
+
* - {@link BottomGear} - where the button is attached
|
|
13
11
|
*
|
|
12
|
+
* - {@link ClapprStats} - to get the metrics from
|
|
13
|
+
*
|
|
14
14
|
* The plugin is rendered as an item in the gear menu.
|
|
15
15
|
*
|
|
16
16
|
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
@@ -21,16 +21,16 @@ const PLAYBACK_NAMES = {
|
|
|
21
21
|
};
|
|
22
22
|
const T = 'plugins.nerd_stats';
|
|
23
23
|
/**
|
|
24
|
-
* `PLUGIN` that displays useful network
|
|
24
|
+
* `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
|
|
25
25
|
* @beta
|
|
26
26
|
*
|
|
27
27
|
* @remarks
|
|
28
28
|
* Depends on:
|
|
29
29
|
*
|
|
30
|
-
* - {@link BottomGear}
|
|
31
|
-
*
|
|
32
|
-
* - {@link ClapprStats}
|
|
30
|
+
* - {@link BottomGear} - where the button is attached
|
|
33
31
|
*
|
|
32
|
+
* - {@link ClapprStats} - to get the metrics from
|
|
33
|
+
*
|
|
34
34
|
* The plugin is rendered as an item in the gear menu.
|
|
35
35
|
*
|
|
36
36
|
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Container, ContainerPlugin } from '@clappr/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ClapprStatsMetrics } from './types.js';
|
|
3
|
+
export * from './types.js';
|
|
3
4
|
export type ClapprStatsSettings = {
|
|
4
5
|
/**
|
|
5
6
|
* The interval in milliseconds of periodic measurements.
|
|
@@ -13,6 +14,8 @@ export type ClapprStatsSettings = {
|
|
|
13
14
|
* @remarks
|
|
14
15
|
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
15
16
|
*
|
|
17
|
+
* @see {@link NerdStats} - a plugin that visualises the playback metrics
|
|
18
|
+
*
|
|
16
19
|
* Configuration options - {@link ClapprStatsSettings}
|
|
17
20
|
*
|
|
18
21
|
* Events - {@link ClapprStatsEvents}
|
|
@@ -52,7 +55,7 @@ export declare class ClapprStats extends ContainerPlugin {
|
|
|
52
55
|
* Returns the collected metrics.
|
|
53
56
|
* @returns Measurements collected so far
|
|
54
57
|
*/
|
|
55
|
-
exportMetrics():
|
|
58
|
+
exportMetrics(): ClapprStatsMetrics;
|
|
56
59
|
private onBitrate;
|
|
57
60
|
private stopReporting;
|
|
58
61
|
private startTimers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClapprStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/ClapprStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAA;AAU/E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Clap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W;IAcnB,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,aAAa;CA0BtB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ContainerPlugin, Events as CoreEvents } from '@clappr/core';
|
|
2
2
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
3
|
-
import { ClapprStatsEvents,
|
|
3
|
+
import { ClapprStatsEvents, ClapprStatsChronograph, ClapprStatsCounter, } from './types.js';
|
|
4
|
+
export * from './types.js';
|
|
4
5
|
import { newMetrics } from './utils.js';
|
|
5
6
|
/**
|
|
6
7
|
* `PLUGIN` that measures data about playback, which can be useful for analyzing performance and UX.
|
|
@@ -8,6 +9,8 @@ import { newMetrics } from './utils.js';
|
|
|
8
9
|
* @remarks
|
|
9
10
|
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
10
11
|
*
|
|
12
|
+
* @see {@link NerdStats} - a plugin that visualises the playback metrics
|
|
13
|
+
*
|
|
11
14
|
* Configuration options - {@link ClapprStatsSettings}
|
|
12
15
|
*
|
|
13
16
|
* Events - {@link ClapprStatsEvents}
|
|
@@ -17,11 +20,11 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
17
20
|
lastDecodedFramesCount = 0;
|
|
18
21
|
metrics = newMetrics();
|
|
19
22
|
timers = {
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
23
|
+
[ClapprStatsChronograph.Startup]: 0,
|
|
24
|
+
[ClapprStatsChronograph.Watch]: 0,
|
|
25
|
+
[ClapprStatsChronograph.Pause]: 0,
|
|
26
|
+
[ClapprStatsChronograph.Buffering]: 0,
|
|
27
|
+
[ClapprStatsChronograph.Session]: 0,
|
|
25
28
|
};
|
|
26
29
|
runEach;
|
|
27
30
|
/**
|
|
@@ -51,15 +54,10 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
51
54
|
inc(counter) {
|
|
52
55
|
this.metrics.counters[counter] += 1;
|
|
53
56
|
}
|
|
54
|
-
// _timerHasStarted(timer) {
|
|
55
|
-
// return this[`_start${timer}`] !== undefined;
|
|
56
|
-
// }
|
|
57
57
|
start(timer) {
|
|
58
|
-
// this[`_start${timer}`] = this._now();
|
|
59
58
|
this.timers[timer] = this.now();
|
|
60
59
|
}
|
|
61
60
|
stop(timer) {
|
|
62
|
-
// this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
|
|
63
61
|
this.metrics.chrono[timer] += this.now() - this.timers[timer];
|
|
64
62
|
}
|
|
65
63
|
constructor(container) {
|
|
@@ -79,10 +77,10 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
79
77
|
this.listenTo(this.container, CoreEvents.CONTAINER_PAUSE, this.onPause);
|
|
80
78
|
this.listenToOnce(this.container, CoreEvents.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
81
79
|
this.listenTo(this.container, CoreEvents.CONTAINER_SEEK, this.onSeek);
|
|
82
|
-
this.listenTo(this.container, CoreEvents.CONTAINER_ERROR, () => this.inc(
|
|
83
|
-
this.listenTo(this.container, CoreEvents.CONTAINER_FULLSCREEN, () => this.inc(
|
|
80
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_ERROR, () => this.inc(ClapprStatsCounter.Error));
|
|
81
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_FULLSCREEN, () => this.inc(ClapprStatsCounter.Fullscreen));
|
|
84
82
|
this.listenTo(this.container, CoreEvents.CONTAINER_PLAYBACKDVRSTATECHANGED, (dvrInUse) => {
|
|
85
|
-
dvrInUse && this.inc(
|
|
83
|
+
dvrInUse && this.inc(ClapprStatsCounter.DvrUsage);
|
|
86
84
|
});
|
|
87
85
|
this.listenTo(this.container.playback, CoreEvents.PLAYBACK_PROGRESS, this.onProgress);
|
|
88
86
|
this.listenTo(this.container.playback, CoreEvents.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
|
|
@@ -110,7 +108,7 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
110
108
|
last.time = now - last.start;
|
|
111
109
|
}
|
|
112
110
|
this.metrics.extra.bitratesHistory.push({ start: this.now(), bitrate });
|
|
113
|
-
this.inc(
|
|
111
|
+
this.inc(ClapprStatsCounter.ChangeLevel);
|
|
114
112
|
}
|
|
115
113
|
stopReporting() {
|
|
116
114
|
this.buildReport();
|
|
@@ -121,31 +119,31 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
121
119
|
}
|
|
122
120
|
startTimers() {
|
|
123
121
|
this.timerId = setInterval(this.buildReport.bind(this), this.runEach);
|
|
124
|
-
this.start(
|
|
125
|
-
this.start(
|
|
122
|
+
this.start(ClapprStatsChronograph.Session);
|
|
123
|
+
this.start(ClapprStatsChronograph.Startup);
|
|
126
124
|
}
|
|
127
125
|
onFirstPlaying() {
|
|
128
126
|
this.listenTo(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
129
|
-
this.start(
|
|
130
|
-
this.stop(
|
|
127
|
+
this.start(ClapprStatsChronograph.Watch);
|
|
128
|
+
this.stop(ClapprStatsChronograph.Startup);
|
|
131
129
|
}
|
|
132
130
|
playAfterPause() {
|
|
133
131
|
this.listenTo(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
134
|
-
this.stop(
|
|
135
|
-
this.start(
|
|
132
|
+
this.stop(ClapprStatsChronograph.Pause);
|
|
133
|
+
this.start(ClapprStatsChronograph.Watch);
|
|
136
134
|
}
|
|
137
135
|
onPlay() {
|
|
138
|
-
this.inc(
|
|
136
|
+
this.inc(ClapprStatsCounter.Play);
|
|
139
137
|
}
|
|
140
138
|
onPause() {
|
|
141
|
-
this.stop(
|
|
142
|
-
this.start(
|
|
143
|
-
this.inc(
|
|
139
|
+
this.stop(ClapprStatsChronograph.Watch);
|
|
140
|
+
this.start(ClapprStatsChronograph.Pause);
|
|
141
|
+
this.inc(ClapprStatsCounter.Pause);
|
|
144
142
|
this.listenToOnce(this.container, CoreEvents.CONTAINER_PLAY, this.playAfterPause);
|
|
145
143
|
this.stopListening(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
146
144
|
}
|
|
147
145
|
onSeek(e) {
|
|
148
|
-
this.inc(
|
|
146
|
+
this.inc(ClapprStatsCounter.Seek);
|
|
149
147
|
this.metrics.extra.watchHistory.push([e * 1000, e * 1000]);
|
|
150
148
|
}
|
|
151
149
|
onTimeUpdate(e) {
|
|
@@ -170,17 +168,17 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
170
168
|
}
|
|
171
169
|
onContainerUpdateWhilePlaying() {
|
|
172
170
|
if (this.container.playback.isPlaying()) {
|
|
173
|
-
this.stop(
|
|
174
|
-
this.start(
|
|
171
|
+
this.stop(ClapprStatsChronograph.Watch);
|
|
172
|
+
this.start(ClapprStatsChronograph.Watch);
|
|
175
173
|
}
|
|
176
174
|
}
|
|
177
175
|
onBuffering() {
|
|
178
|
-
this.inc(
|
|
179
|
-
this.start(
|
|
176
|
+
this.inc(ClapprStatsCounter.Buffering);
|
|
177
|
+
this.start(ClapprStatsChronograph.Buffering);
|
|
180
178
|
this.listenToOnce(this.container, CoreEvents.CONTAINER_STATE_BUFFERFULL, this.onBufferfull);
|
|
181
179
|
}
|
|
182
180
|
onBufferfull() {
|
|
183
|
-
this.stop(
|
|
181
|
+
this.stop(ClapprStatsChronograph.Buffering);
|
|
184
182
|
this.listenToOnce(this.container, CoreEvents.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
185
183
|
}
|
|
186
184
|
onProgress(progress) {
|
|
@@ -192,8 +190,8 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
192
190
|
// this.trigger(ClapprStatsEvents.PERCENTAGE, currentPercentage);
|
|
193
191
|
}
|
|
194
192
|
buildReport() {
|
|
195
|
-
this.stop(
|
|
196
|
-
this.start(
|
|
193
|
+
this.stop(ClapprStatsChronograph.Session);
|
|
194
|
+
this.start(ClapprStatsChronograph.Session);
|
|
197
195
|
this.metrics.extra.playbackName = this.playbackName;
|
|
198
196
|
this.metrics.extra.playbackType = this.playbackType;
|
|
199
197
|
this.calcBitrates();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @beta
|
|
3
3
|
*/
|
|
4
|
-
export declare enum
|
|
4
|
+
export declare enum ClapprStatsChronograph {
|
|
5
5
|
Startup = "startup",
|
|
6
6
|
Watch = "watch",
|
|
7
7
|
Pause = "pause",
|
|
@@ -11,7 +11,7 @@ export declare enum Chronograph {
|
|
|
11
11
|
/**
|
|
12
12
|
* @beta
|
|
13
13
|
*/
|
|
14
|
-
export declare enum
|
|
14
|
+
export declare enum ClapprStatsCounter {
|
|
15
15
|
Play = "play",
|
|
16
16
|
Pause = "pause",
|
|
17
17
|
Error = "error",
|
|
@@ -27,7 +27,7 @@ export declare enum Counter {
|
|
|
27
27
|
/**
|
|
28
28
|
* @beta
|
|
29
29
|
*/
|
|
30
|
-
export type
|
|
30
|
+
export type ClapprStatsMetrics = {
|
|
31
31
|
/**
|
|
32
32
|
* Events count counters
|
|
33
33
|
*/
|
|
@@ -35,17 +35,17 @@ export type Metrics = {
|
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
38
|
+
[ClapprStatsCounter.Play]: number;
|
|
39
|
+
[ClapprStatsCounter.Pause]: number;
|
|
40
|
+
[ClapprStatsCounter.Error]: number;
|
|
41
|
+
[ClapprStatsCounter.Buffering]: number;
|
|
42
|
+
[ClapprStatsCounter.DecodedFrames]: number;
|
|
43
|
+
[ClapprStatsCounter.DroppedFrames]: number;
|
|
44
|
+
[ClapprStatsCounter.Fps]: number;
|
|
45
|
+
[ClapprStatsCounter.ChangeLevel]: number;
|
|
46
|
+
[ClapprStatsCounter.Seek]: number;
|
|
47
|
+
[ClapprStatsCounter.Fullscreen]: number;
|
|
48
|
+
[ClapprStatsCounter.DvrUsage]: number;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* Time measurements - accumulated duration of time-based activities
|
|
@@ -54,22 +54,22 @@ export type Metrics = {
|
|
|
54
54
|
/**
|
|
55
55
|
* Time spent in the startup phase
|
|
56
56
|
*/
|
|
57
|
-
[
|
|
57
|
+
[ClapprStatsChronograph.Startup]: number;
|
|
58
58
|
/**
|
|
59
59
|
* Total time spent in the watch phase
|
|
60
60
|
*/
|
|
61
|
-
[
|
|
61
|
+
[ClapprStatsChronograph.Watch]: number;
|
|
62
62
|
/**
|
|
63
63
|
*
|
|
64
64
|
*/
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
65
|
+
[ClapprStatsChronograph.Pause]: number;
|
|
66
|
+
[ClapprStatsChronograph.Buffering]: number;
|
|
67
|
+
[ClapprStatsChronograph.Session]: number;
|
|
68
68
|
};
|
|
69
69
|
extra: {
|
|
70
70
|
playbackName: string;
|
|
71
71
|
playbackType: string;
|
|
72
|
-
bitratesHistory:
|
|
72
|
+
bitratesHistory: ClapprStatsBitrateTrack[];
|
|
73
73
|
bitrateWeightedMean: number;
|
|
74
74
|
bitrateMostUsed: number;
|
|
75
75
|
buffersize: number;
|
|
@@ -84,7 +84,7 @@ export type Metrics = {
|
|
|
84
84
|
/**
|
|
85
85
|
* @beta
|
|
86
86
|
*/
|
|
87
|
-
export type
|
|
87
|
+
export type ClapprStatsBitrateTrack = {
|
|
88
88
|
start: number;
|
|
89
89
|
end?: number;
|
|
90
90
|
time?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,
|
|
1
|
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5
|
+
(function (ClapprStatsChronograph) {
|
|
6
|
+
ClapprStatsChronograph["Startup"] = "startup";
|
|
7
|
+
ClapprStatsChronograph["Watch"] = "watch";
|
|
8
|
+
ClapprStatsChronograph["Pause"] = "pause";
|
|
9
|
+
ClapprStatsChronograph["Buffering"] = "buffering";
|
|
10
|
+
ClapprStatsChronograph["Session"] = "session";
|
|
11
11
|
// Latency = 'latency',
|
|
12
|
-
})(
|
|
12
|
+
})(ClapprStatsChronograph || (ClapprStatsChronograph = {}));
|
|
13
13
|
/**
|
|
14
14
|
* @beta
|
|
15
15
|
*/
|
|
16
|
-
export var
|
|
17
|
-
(function (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})(
|
|
16
|
+
export var ClapprStatsCounter;
|
|
17
|
+
(function (ClapprStatsCounter) {
|
|
18
|
+
ClapprStatsCounter["Play"] = "play";
|
|
19
|
+
ClapprStatsCounter["Pause"] = "pause";
|
|
20
|
+
ClapprStatsCounter["Error"] = "error";
|
|
21
|
+
ClapprStatsCounter["Buffering"] = "buffering";
|
|
22
|
+
ClapprStatsCounter["DecodedFrames"] = "decodedFrames";
|
|
23
|
+
ClapprStatsCounter["DroppedFrames"] = "droppedFrames";
|
|
24
|
+
ClapprStatsCounter["Fps"] = "fps";
|
|
25
|
+
ClapprStatsCounter["ChangeLevel"] = "changeLevel";
|
|
26
|
+
ClapprStatsCounter["Seek"] = "seek";
|
|
27
|
+
ClapprStatsCounter["Fullscreen"] = "fullscreen";
|
|
28
|
+
ClapprStatsCounter["DvrUsage"] = "dvrUsage";
|
|
29
|
+
})(ClapprStatsCounter || (ClapprStatsCounter = {}));
|
|
30
30
|
/**
|
|
31
31
|
* @beta
|
|
32
32
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function newMetrics():
|
|
1
|
+
import type { ClapprStatsMetrics } from './types';
|
|
2
|
+
export declare function newMetrics(): ClapprStatsMetrics;
|
|
3
3
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,wBAAgB,UAAU,IAAI,kBAAkB,CAqC/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/clips/clips.scss';
|
|
3
3
|
/**
|
|
4
|
-
* Configuration options for the {@link
|
|
4
|
+
* Configuration options for the {@link Clips} plugin.
|
|
5
5
|
* @beta
|
|
6
6
|
*/
|
|
7
7
|
export interface ClipsPluginSettings {
|
|
@@ -43,12 +43,16 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
43
43
|
*/
|
|
44
44
|
bindEvents(): void;
|
|
45
45
|
private onCoreReady;
|
|
46
|
-
private
|
|
46
|
+
private onActiveContainerChanged;
|
|
47
47
|
private click;
|
|
48
|
-
private shouldRender;
|
|
49
48
|
/**
|
|
50
49
|
* @internal
|
|
51
50
|
*/
|
|
52
51
|
render(): this;
|
|
52
|
+
private onMediacontrolRendered;
|
|
53
|
+
private onMetadataLoaded;
|
|
54
|
+
private mount;
|
|
55
|
+
private onDvrStateChanged;
|
|
56
|
+
private toggleState;
|
|
53
57
|
}
|
|
54
58
|
//# 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,
|
|
1
|
+
{"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAA;AAMvE,OAAO,gDAAgD,CAAA;AAMvD;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAEpD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,wBAAwB;IAahC,OAAO,CAAC,KAAK;IAQb;;OAEG;IACM,MAAM;IAUf,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,WAAW;CASpB"}
|