|
@@ -1,7 +1,7 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import { getAmplitudeIdentity } from '../analytics';
|
4
|
|
-import { CONFERENCE_UNIQUE_ID_SET } from '../base/conference';
|
|
4
|
+import { CONFERENCE_UNIQUE_ID_SET, getRoomName } from '../base/conference';
|
5
|
5
|
import { LIB_WILL_INIT } from '../base/lib-jitsi-meet';
|
6
|
6
|
import { getLocalParticipant } from '../base/participants';
|
7
|
7
|
import { MiddlewareRegistry } from '../base/redux';
|
|
@@ -22,6 +22,7 @@ MiddlewareRegistry.register(store => next => action => {
|
22
|
22
|
const config = state['features/base/config'];
|
23
|
23
|
const { analytics } = config;
|
24
|
24
|
|
|
25
|
+
|
25
|
26
|
switch (action.type) {
|
26
|
27
|
case LIB_WILL_INIT: {
|
27
|
28
|
if (isRtcstatsEnabled(state)) {
|
|
@@ -30,14 +31,17 @@ MiddlewareRegistry.register(store => next => action => {
|
30
|
31
|
// init, we need to add these proxies before it initializes, otherwise lib-jitsi-meet will use the
|
31
|
32
|
// original non proxy versions of these functions.
|
32
|
33
|
try {
|
33
|
|
- // Default poll interval is 1000ms if not provided in the config.
|
|
34
|
+ // Default poll interval is 1000ms and standard stats will be used, if not provided in the config.
|
34
|
35
|
const pollInterval = analytics.rtcstatsPollInterval || 1000;
|
|
36
|
+ const useLegacy = analytics.rtcstatsUseLegacy || false;
|
|
37
|
+
|
35
|
38
|
|
36
|
39
|
// Initialize but don't connect to the rtcstats server wss, as it will start sending data for all
|
37
|
40
|
// media calls made even before the conference started.
|
38
|
41
|
RTCStats.init({
|
39
|
|
- rtcstatsEndpoint: analytics.rtcstatsEndpoint,
|
40
|
|
- rtcstatsPollInterval: pollInterval
|
|
42
|
+ endpoint: analytics.rtcstatsEndpoint,
|
|
43
|
+ useLegacy,
|
|
44
|
+ pollInterval
|
41
|
45
|
});
|
42
|
46
|
} catch (error) {
|
43
|
47
|
logger.error('Failed to initialize RTCStats: ', error);
|
|
@@ -68,6 +72,7 @@ MiddlewareRegistry.register(store => next => action => {
|
68
|
72
|
RTCStats.sendIdentityData({
|
69
|
73
|
...getAmplitudeIdentity(),
|
70
|
74
|
...config,
|
|
75
|
+ confName: getRoomName(state),
|
71
|
76
|
displayName: localParticipant?.name,
|
72
|
77
|
meetingUniqueId
|
73
|
78
|
});
|