|
@@ -1,13 +1,13 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import { getAmplitudeIdentity } from '../analytics';
|
4
|
|
-import { CONFERENCE_UNIQUE_ID_SET, getRoomName } from '../base/conference';
|
|
4
|
+import { CONFERENCE_UNIQUE_ID_SET, getConferenceOptions, getRoomName } from '../base/conference';
|
5
|
5
|
import { LIB_WILL_INIT } from '../base/lib-jitsi-meet';
|
6
|
|
-import { getLocalParticipant } from '../base/participants';
|
|
6
|
+import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants';
|
7
|
7
|
import { MiddlewareRegistry } from '../base/redux';
|
8
|
8
|
|
9
|
9
|
import RTCStats from './RTCStats';
|
10
|
|
-import { isRtcstatsEnabled } from './functions';
|
|
10
|
+import { canSendRtcstatsData, isRtcstatsEnabled } from './functions';
|
11
|
11
|
import logger from './logger';
|
12
|
12
|
|
13
|
13
|
/**
|
|
@@ -50,12 +50,15 @@ MiddlewareRegistry.register(store => next => action => {
|
50
|
50
|
break;
|
51
|
51
|
}
|
52
|
52
|
case CONFERENCE_UNIQUE_ID_SET: {
|
53
|
|
- if (isRtcstatsEnabled(state) && RTCStats.isInitialized()) {
|
|
53
|
+ if (canSendRtcstatsData(state)) {
|
|
54
|
+
|
54
|
55
|
// Once the conference started connect to the rtcstats server and send data.
|
55
|
56
|
try {
|
56
|
57
|
RTCStats.connect();
|
57
|
58
|
|
58
|
59
|
const localParticipant = getLocalParticipant(state);
|
|
60
|
+ const options = getConferenceOptions(state);
|
|
61
|
+
|
59
|
62
|
|
60
|
63
|
// Unique identifier for a conference session, not to be confused with meeting name
|
61
|
64
|
// i.e. If all participants leave a meeting it will have a different value on the next join.
|
|
@@ -71,7 +74,8 @@ MiddlewareRegistry.register(store => next => action => {
|
71
|
74
|
// conference with a specific version.
|
72
|
75
|
RTCStats.sendIdentityData({
|
73
|
76
|
...getAmplitudeIdentity(),
|
74
|
|
- ...config,
|
|
77
|
+ ...options,
|
|
78
|
+ endpointId: localParticipant?.id,
|
75
|
79
|
confName: getRoomName(state),
|
76
|
80
|
displayName: localParticipant?.name,
|
77
|
81
|
meetingUniqueId
|
|
@@ -83,6 +87,15 @@ MiddlewareRegistry.register(store => next => action => {
|
83
|
87
|
}
|
84
|
88
|
break;
|
85
|
89
|
}
|
|
90
|
+ case DOMINANT_SPEAKER_CHANGED: {
|
|
91
|
+ if (canSendRtcstatsData(state)) {
|
|
92
|
+ const { id, previousSpeakers } = action.participant;
|
|
93
|
+
|
|
94
|
+ RTCStats.sendDominantSpeakerData({ dominantSpeakerEndpoint: id,
|
|
95
|
+ previousSpeakers });
|
|
96
|
+ }
|
|
97
|
+ break;
|
|
98
|
+ }
|
86
|
99
|
}
|
87
|
100
|
|
88
|
101
|
return next(action);
|