@webex/plugin-meetings 3.0.0-beta.1 → 3.0.0-beta.11
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/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +5 -29
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +15 -74
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +4 -0
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +71 -210
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js +22 -0
- package/dist/media/internal-media-core-wrapper.js.map +1 -0
- package/dist/media/properties.js +32 -25
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +0 -27
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +1146 -602
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +83 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +5 -44
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +136 -25
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +24 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +82 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +133 -0
- package/dist/multistream/mediaRequestManager.js.map +1 -0
- package/dist/multistream/multistreamMedia.js +116 -0
- package/dist/multistream/multistreamMedia.js.map +1 -0
- package/dist/multistream/receiveSlot.js +209 -0
- package/dist/multistream/receiveSlot.js.map +1 -0
- package/dist/multistream/receiveSlotManager.js +195 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -0
- package/dist/multistream/remoteMedia.js +289 -0
- package/dist/multistream/remoteMedia.js.map +1 -0
- package/dist/multistream/remoteMediaGroup.js +243 -0
- package/dist/multistream/remoteMediaGroup.js.map +1 -0
- package/dist/multistream/remoteMediaManager.js +1113 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -0
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js +111 -0
- package/dist/reactions/reactions.js.map +1 -0
- package/dist/reactions/reactions.type.js +40 -0
- package/dist/reactions/reactions.type.js.map +1 -0
- package/dist/reconnection-manager/index.js +130 -132
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +58 -231
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -116
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +20 -6
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +2 -0
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +58 -37
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +21 -20
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -20
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +2 -0
- package/src/constants.ts +139 -179
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +7 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +130 -205
- package/src/media/internal-media-core-wrapper.ts +9 -0
- package/src/media/{properties.js → properties.ts} +35 -29
- package/src/media/util.ts +16 -0
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +993 -474
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +148 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +9 -51
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +118 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +28 -5
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +94 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/multistream/mediaRequestManager.ts +166 -0
- package/src/multistream/multistreamMedia.ts +92 -0
- package/src/multistream/receiveSlot.ts +141 -0
- package/src/multistream/receiveSlotManager.ts +142 -0
- package/src/multistream/remoteMedia.ts +228 -0
- package/src/multistream/remoteMediaGroup.ts +224 -0
- package/src/multistream/remoteMediaManager.ts +911 -0
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reactions/reactions.ts +104 -0
- package/src/reactions/reactions.type.ts +36 -0
- package/src/reconnection-manager/{index.js → index.ts} +81 -65
- package/src/roap/index.ts +229 -0
- package/src/roap/{request.js → request.ts} +15 -74
- package/src/roap/turnDiscovery.ts +26 -11
- package/src/statsAnalyzer/{global.js → global.ts} +2 -0
- package/src/statsAnalyzer/{index.js → index.ts} +66 -61
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/journey.js +1 -1
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +17 -1
- package/test/unit/spec/media/index.ts +207 -0
- package/test/unit/spec/media/properties.ts +73 -82
- package/test/unit/spec/meeting/effectsState.js +1 -3
- package/test/unit/spec/meeting/index.js +672 -245
- package/test/unit/spec/meeting/muteState.js +7 -0
- package/test/unit/spec/meeting/request.js +25 -1
- package/test/unit/spec/meeting/utils.js +63 -2
- package/test/unit/spec/meetings/index.js +0 -4
- package/test/unit/spec/members/index.js +164 -2
- package/test/unit/spec/multistream/mediaRequestManager.ts +515 -0
- package/test/unit/spec/multistream/receiveSlot.ts +104 -0
- package/test/unit/spec/multistream/receiveSlotManager.ts +173 -0
- package/test/unit/spec/multistream/remoteMedia.ts +225 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +396 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +1309 -0
- package/test/unit/spec/reconnection-manager/index.js +68 -2
- package/test/unit/spec/roap/index.ts +63 -35
- package/test/unit/spec/stats-analyzer/index.js +19 -22
- package/dist/peer-connection-manager/index.js +0 -794
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -124
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/roap/collection.js +0 -73
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -337
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/state.js +0 -164
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/util.js +0 -102
- package/dist/roap/util.js.map +0 -1
- package/src/media/util.js +0 -38
- package/src/peer-connection-manager/index.js +0 -723
- package/src/peer-connection-manager/util.ts +0 -117
- package/src/roap/collection.js +0 -63
- package/src/roap/handler.js +0 -252
- package/src/roap/index.js +0 -380
- package/src/roap/state.js +0 -149
- package/src/roap/util.js +0 -93
- package/test/unit/spec/peerconnection-manager/index.js +0 -188
- package/test/unit/spec/peerconnection-manager/utils.js +0 -48
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
- package/test/unit/spec/roap/util.js +0 -30
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore - Types not available for @webex/common
|
|
1
2
|
import {Defer} from '@webex/common';
|
|
2
3
|
|
|
3
4
|
import Metrics from '../metrics';
|
|
@@ -6,9 +7,16 @@ import LoggerProxy from '../common/logs/logger-proxy';
|
|
|
6
7
|
import {ROAP} from '../constants';
|
|
7
8
|
|
|
8
9
|
import RoapRequest from './request';
|
|
10
|
+
import Meeting from '../meeting';
|
|
9
11
|
|
|
10
12
|
const TURN_DISCOVERY_TIMEOUT = 10; // in seconds
|
|
11
13
|
|
|
14
|
+
// Roap spec says that seq should start from 1, but TURN discovery works fine with seq=0
|
|
15
|
+
// and this is handy for us, because TURN discovery is always done before the first SDP exchange,
|
|
16
|
+
// so we can do it with seq=0 or not do it at all and then we create the RoapMediaConnection
|
|
17
|
+
// and do the SDP offer with seq=1
|
|
18
|
+
const TURN_DISCOVERY_SEQ = 0;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Handles the process of finding out TURN server information from Linus.
|
|
14
22
|
* This is achieved by sending a TURN_DISCOVERY_REQUEST.
|
|
@@ -48,7 +56,7 @@ export default class TurnDiscovery {
|
|
|
48
56
|
* @private
|
|
49
57
|
* @memberof Roap
|
|
50
58
|
*/
|
|
51
|
-
waitForTurnDiscoveryResponse() {
|
|
59
|
+
private waitForTurnDiscoveryResponse() {
|
|
52
60
|
if (!this.defer) {
|
|
53
61
|
LoggerProxy.logger.warn('Roap:turnDiscovery#waitForTurnDiscoveryResponse --> TURN discovery is not in progress');
|
|
54
62
|
|
|
@@ -76,7 +84,8 @@ export default class TurnDiscovery {
|
|
|
76
84
|
* @public
|
|
77
85
|
* @memberof Roap
|
|
78
86
|
*/
|
|
79
|
-
handleTurnDiscoveryResponse(roapMessage) {
|
|
87
|
+
public handleTurnDiscoveryResponse(roapMessage: object) {
|
|
88
|
+
// @ts-ignore - Fix missing type
|
|
80
89
|
const {headers} = roapMessage;
|
|
81
90
|
|
|
82
91
|
if (!this.defer) {
|
|
@@ -125,9 +134,7 @@ export default class TurnDiscovery {
|
|
|
125
134
|
* @private
|
|
126
135
|
* @memberof Roap
|
|
127
136
|
*/
|
|
128
|
-
sendRoapTurnDiscoveryRequest(meeting, isReconnecting) {
|
|
129
|
-
const seq = meeting.roapSeq + 1;
|
|
130
|
-
|
|
137
|
+
sendRoapTurnDiscoveryRequest(meeting: Meeting, isReconnecting: boolean) {
|
|
131
138
|
if (this.defer) {
|
|
132
139
|
LoggerProxy.logger.warn('Roap:turnDiscovery#sendRoapTurnDiscoveryRequest --> already in progress');
|
|
133
140
|
|
|
@@ -139,7 +146,7 @@ export default class TurnDiscovery {
|
|
|
139
146
|
const roapMessage = {
|
|
140
147
|
messageType: ROAP.ROAP_TYPES.TURN_DISCOVERY_REQUEST,
|
|
141
148
|
version: ROAP.ROAP_VERSION,
|
|
142
|
-
seq,
|
|
149
|
+
seq: TURN_DISCOVERY_SEQ,
|
|
143
150
|
};
|
|
144
151
|
|
|
145
152
|
LoggerProxy.logger.info('Roap:turnDiscovery#sendRoapTurnDiscoveryRequest --> sending TURN_DISCOVERY_REQUEST');
|
|
@@ -148,15 +155,15 @@ export default class TurnDiscovery {
|
|
|
148
155
|
.sendRoap({
|
|
149
156
|
roapMessage,
|
|
150
157
|
correlationId: meeting.correlationId,
|
|
158
|
+
// @ts-ignore - Fix missing type
|
|
151
159
|
locusSelfUrl: meeting.selfUrl,
|
|
160
|
+
// @ts-ignore - Fix missing type
|
|
152
161
|
mediaId: isReconnecting ? '' : meeting.mediaId,
|
|
153
162
|
audioMuted: meeting.isAudioMuted(),
|
|
154
163
|
videoMuted: meeting.isVideoMuted(),
|
|
155
164
|
meetingId: meeting.id
|
|
156
165
|
})
|
|
157
166
|
.then(({mediaConnections}) => {
|
|
158
|
-
meeting.setRoapSeq(seq);
|
|
159
|
-
|
|
160
167
|
if (mediaConnections) {
|
|
161
168
|
meeting.updateMediaConnections(mediaConnections);
|
|
162
169
|
}
|
|
@@ -170,16 +177,18 @@ export default class TurnDiscovery {
|
|
|
170
177
|
* @param {Meeting} meeting
|
|
171
178
|
* @returns {Promise}
|
|
172
179
|
*/
|
|
173
|
-
sendRoapOK(meeting) {
|
|
180
|
+
sendRoapOK(meeting: Meeting) {
|
|
174
181
|
LoggerProxy.logger.info('Roap:turnDiscovery#sendRoapOK --> sending OK');
|
|
175
182
|
|
|
176
183
|
return this.roapRequest.sendRoap({
|
|
177
184
|
roapMessage: {
|
|
178
185
|
messageType: ROAP.ROAP_TYPES.OK,
|
|
179
186
|
version: ROAP.ROAP_VERSION,
|
|
180
|
-
seq:
|
|
187
|
+
seq: TURN_DISCOVERY_SEQ,
|
|
181
188
|
},
|
|
189
|
+
// @ts-ignore - fix type
|
|
182
190
|
locusSelfUrl: meeting.selfUrl,
|
|
191
|
+
// @ts-ignore - fix type
|
|
183
192
|
mediaId: meeting.mediaId,
|
|
184
193
|
correlationId: meeting.correlationId,
|
|
185
194
|
audioMuted: meeting.isAudioMuted(),
|
|
@@ -196,12 +205,17 @@ export default class TurnDiscovery {
|
|
|
196
205
|
* | <----TURN_DISCOVERY_RESPONSE----- |
|
|
197
206
|
* | --------------OK----------------> |
|
|
198
207
|
*
|
|
208
|
+
* This TURN discovery roap exchange is always done with seq=0.
|
|
209
|
+
* The RoapMediaConnection SDP exchange always starts with seq=1,
|
|
210
|
+
* so it works fine no matter if TURN discovery is done or not.
|
|
211
|
+
*
|
|
199
212
|
* @param {Meeting} meeting
|
|
200
213
|
* @param {Boolean} isReconnecting should be set to true if this is a new
|
|
201
214
|
* media connection just after a reconnection
|
|
202
215
|
* @returns {Promise}
|
|
203
216
|
*/
|
|
204
|
-
doTurnDiscovery(meeting, isReconnecting) {
|
|
217
|
+
doTurnDiscovery(meeting: Meeting, isReconnecting: boolean) {
|
|
218
|
+
// @ts-ignore - fix type
|
|
205
219
|
const isAnyClusterReachable = meeting.webex.meetings.reachability.isAnyClusterReachable();
|
|
206
220
|
|
|
207
221
|
if (isAnyClusterReachable) {
|
|
@@ -209,6 +223,7 @@ export default class TurnDiscovery {
|
|
|
209
223
|
return Promise.resolve({turnServerInfo: undefined, turnDiscoverySkippedReason: 'reachability'});
|
|
210
224
|
}
|
|
211
225
|
|
|
226
|
+
// @ts-ignore - fix type
|
|
212
227
|
if (!meeting.config.experimental.enableTurnDiscovery) {
|
|
213
228
|
LoggerProxy.logger.info('Roap:turnDiscovery#doTurnDiscovery --> TURN discovery disabled in config, skipping it');
|
|
214
229
|
|
|
@@ -2,6 +2,7 @@ const STATS_DEFAULT = {
|
|
|
2
2
|
encryption: 'sha-256',
|
|
3
3
|
audio: {
|
|
4
4
|
send: {
|
|
5
|
+
trackLabel: '',
|
|
5
6
|
maxPacketLossRatio: 0,
|
|
6
7
|
availableBandwidth: 0,
|
|
7
8
|
bytesSent: 0,
|
|
@@ -17,6 +18,7 @@ const STATS_DEFAULT = {
|
|
|
17
18
|
},
|
|
18
19
|
video: {
|
|
19
20
|
send: {
|
|
21
|
+
trackLabel: '',
|
|
20
22
|
maxPacketLossRatio: 0,
|
|
21
23
|
availableBandwidth: 0,
|
|
22
24
|
meanRemoteJitter: [],
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {cloneDeep} from 'lodash';
|
|
2
|
+
import {MediaConnection as MC} from '@webex/internal-media-core';
|
|
2
3
|
|
|
3
4
|
import EventsScope from '../common/events/events-scope';
|
|
4
|
-
import {DEFAULT_GET_STATS_FILTER,
|
|
5
|
+
import {DEFAULT_GET_STATS_FILTER, STATS, MQA_INTEVAL, NETWORK_TYPE, MEDIA_DEVICES, _UNKNOWN_} from '../constants';
|
|
5
6
|
import mqaData from '../mediaQualityMetrics/config';
|
|
6
7
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
7
8
|
|
|
@@ -29,6 +30,21 @@ export const EVENTS = {
|
|
|
29
30
|
* @extends {EventsScope}
|
|
30
31
|
*/
|
|
31
32
|
export class StatsAnalyzer extends EventsScope {
|
|
33
|
+
config: any;
|
|
34
|
+
correlationId: any;
|
|
35
|
+
lastEmittedStartStopEvent: any;
|
|
36
|
+
lastMqaDataSent: any;
|
|
37
|
+
lastStatsResults: any;
|
|
38
|
+
localMQEStats: any;
|
|
39
|
+
meetingMediaStatus: any;
|
|
40
|
+
mqaInterval: NodeJS.Timeout;
|
|
41
|
+
mqaSentCount: any;
|
|
42
|
+
networkQualityMonitor: any;
|
|
43
|
+
mediaConnection: any;
|
|
44
|
+
statsInterval: NodeJS.Timeout;
|
|
45
|
+
statsResults: any;
|
|
46
|
+
statsStarted: any;
|
|
47
|
+
|
|
32
48
|
/**
|
|
33
49
|
* Creates a new instance of StatsAnalyzer
|
|
34
50
|
* @constructor
|
|
@@ -37,7 +53,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
37
53
|
* @param {Object} networkQualityMonitor class for assessing network characteristics (jitter, packetLoss, latency)
|
|
38
54
|
* @param {Object} statsResults Default properties for stats
|
|
39
55
|
*/
|
|
40
|
-
constructor(config, networkQualityMonitor = {}, statsResults = defaultStats) {
|
|
56
|
+
constructor(config: any, networkQualityMonitor: object = {}, statsResults: object = defaultStats) {
|
|
41
57
|
super();
|
|
42
58
|
this.statsStarted = false;
|
|
43
59
|
this.statsResults = statsResults;
|
|
@@ -170,18 +186,18 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
170
186
|
* @memberof StatsAnalyzer
|
|
171
187
|
* @returns {void}
|
|
172
188
|
*/
|
|
173
|
-
updateMediaStatus(status) {
|
|
189
|
+
public updateMediaStatus(status: object) {
|
|
174
190
|
this.meetingMediaStatus = status;
|
|
175
191
|
}
|
|
176
192
|
|
|
177
193
|
/**
|
|
178
|
-
* captures MQA data from
|
|
194
|
+
* captures MQA data from media connection
|
|
179
195
|
*
|
|
180
196
|
* @public
|
|
181
197
|
* @memberof StatsAnalyzer
|
|
182
198
|
* @returns {void}
|
|
183
199
|
*/
|
|
184
|
-
sendMqaData() {
|
|
200
|
+
public sendMqaData() {
|
|
185
201
|
const audioReceiver = mqaData.intervals[0].audioReceive[0];
|
|
186
202
|
const audioSender = mqaData.intervals[0].audioTransmit[0];
|
|
187
203
|
const videoReceiver = mqaData.intervals[0].videoReceive[0];
|
|
@@ -232,10 +248,11 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
232
248
|
// Adding peripheral information
|
|
233
249
|
mqaData.intervals[0].intervalMetadata.peripherals = [];
|
|
234
250
|
mqaData.intervals[0].intervalMetadata.peripherals.push({information: _UNKNOWN_, name: MEDIA_DEVICES.SPEAKER});
|
|
235
|
-
mqaData.intervals[0].intervalMetadata.peripherals.push({information: this.
|
|
236
|
-
mqaData.intervals[0].intervalMetadata.peripherals.push({information: this.
|
|
251
|
+
mqaData.intervals[0].intervalMetadata.peripherals.push({information: this.statsResults[STATS.AUDIO_CORRELATE][STATS.SEND_DIRECTION].trackLabel || _UNKNOWN_, name: MEDIA_DEVICES.MICROPHONE});
|
|
252
|
+
mqaData.intervals[0].intervalMetadata.peripherals.push({information: this.statsResults[STATS.VIDEO_CORRELATE][STATS.SEND_DIRECTION].trackLabel || _UNKNOWN_, name: MEDIA_DEVICES.CAMERA});
|
|
237
253
|
|
|
238
254
|
|
|
255
|
+
// @ts-ignore
|
|
239
256
|
mqaData.networkType = this.statsResults.connectionType.local.networkType;
|
|
240
257
|
|
|
241
258
|
this.mqaSentCount += 1;
|
|
@@ -257,21 +274,22 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
257
274
|
EVENTS.MEDIA_QUALITY,
|
|
258
275
|
{
|
|
259
276
|
data: mqaData.intervals[0],
|
|
277
|
+
// @ts-ignore
|
|
260
278
|
networkType: mqaData.networkType
|
|
261
279
|
}
|
|
262
280
|
);
|
|
263
281
|
}
|
|
264
282
|
|
|
265
283
|
/**
|
|
266
|
-
* updated the
|
|
284
|
+
* updated the media connection when changed
|
|
267
285
|
*
|
|
268
286
|
* @private
|
|
269
|
-
* @memberof
|
|
270
|
-
* @param {
|
|
287
|
+
* @memberof StatsAnalyzer
|
|
288
|
+
* @param {MC.RoapMediaConnection} mediaConnection
|
|
271
289
|
* @returns {void}
|
|
272
290
|
*/
|
|
273
|
-
|
|
274
|
-
this.
|
|
291
|
+
updateMediaConnection(mediaConnection: any) {
|
|
292
|
+
this.mediaConnection = mediaConnection;
|
|
275
293
|
}
|
|
276
294
|
|
|
277
295
|
/**
|
|
@@ -279,13 +297,13 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
279
297
|
*
|
|
280
298
|
* @public
|
|
281
299
|
* @memberof StatsAnalyzer
|
|
282
|
-
* @param {
|
|
300
|
+
* @param {MC.RoapMediaConnection} mediaConnection
|
|
283
301
|
* @returns {Promise}
|
|
284
302
|
*/
|
|
285
|
-
startAnalyzer(
|
|
303
|
+
public startAnalyzer(mediaConnection: any) {
|
|
286
304
|
if (!this.statsStarted) {
|
|
287
305
|
this.statsStarted = true;
|
|
288
|
-
this.
|
|
306
|
+
this.mediaConnection = mediaConnection;
|
|
289
307
|
|
|
290
308
|
return this.getStatsAndParse()
|
|
291
309
|
.then(() => {
|
|
@@ -310,7 +328,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
310
328
|
* @memberof StatsAnalyzer
|
|
311
329
|
* @returns {void}
|
|
312
330
|
*/
|
|
313
|
-
stopAnalyzer() {
|
|
331
|
+
public stopAnalyzer() {
|
|
314
332
|
const sendOneLastMqa = this.mqaInterval && this.statsInterval;
|
|
315
333
|
|
|
316
334
|
if (this.statsInterval) {
|
|
@@ -326,10 +344,10 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
326
344
|
if (sendOneLastMqa) {
|
|
327
345
|
return this.getStatsAndParse().then(() => {
|
|
328
346
|
this.sendMqaData();
|
|
329
|
-
this.
|
|
347
|
+
this.mediaConnection = null;
|
|
330
348
|
});
|
|
331
349
|
}
|
|
332
|
-
this.
|
|
350
|
+
this.mediaConnection = null;
|
|
333
351
|
|
|
334
352
|
return Promise.resolve();
|
|
335
353
|
}
|
|
@@ -344,7 +362,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
344
362
|
* @returns {void}
|
|
345
363
|
* @memberof StatsAnalyzer
|
|
346
364
|
*/
|
|
347
|
-
parseGetStatsResult(getStatsResult, type, isSender) {
|
|
365
|
+
private parseGetStatsResult(getStatsResult: any, type: string, isSender: boolean) {
|
|
348
366
|
if (!getStatsResult) {
|
|
349
367
|
return;
|
|
350
368
|
}
|
|
@@ -361,6 +379,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
361
379
|
break;
|
|
362
380
|
case 'remote-inbound-rtp':
|
|
363
381
|
case 'remote-outbound-rtp':
|
|
382
|
+
// @ts-ignore
|
|
364
383
|
this.compareSentAndReceived(getStatsResult, type, isSender);
|
|
365
384
|
break;
|
|
366
385
|
case 'remotecandidate':
|
|
@@ -371,6 +390,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
371
390
|
this.parseCandidate(getStatsResult, type, isSender, false);
|
|
372
391
|
break;
|
|
373
392
|
case 'media-source':
|
|
393
|
+
// @ts-ignore
|
|
374
394
|
this.parseAudioSource(getStatsResult, type);
|
|
375
395
|
break;
|
|
376
396
|
default:
|
|
@@ -386,7 +406,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
386
406
|
* @param {boolean} isSender
|
|
387
407
|
* @returns {void}
|
|
388
408
|
*/
|
|
389
|
-
filterAndParseGetStatsResults(getStatsResults
|
|
409
|
+
private filterAndParseGetStatsResults(getStatsResults: Array<any>, type: string, isSender: boolean) {
|
|
390
410
|
const {types} = DEFAULT_GET_STATS_FILTER;
|
|
391
411
|
|
|
392
412
|
getStatsResults.forEach((result) => {
|
|
@@ -402,7 +422,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
402
422
|
* @param {boolean} type
|
|
403
423
|
* @returns {void}
|
|
404
424
|
*/
|
|
405
|
-
parseAudioSource(result, type) {
|
|
425
|
+
parseAudioSource(result: any, type: any) {
|
|
406
426
|
if (!result) {
|
|
407
427
|
return;
|
|
408
428
|
}
|
|
@@ -427,7 +447,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
427
447
|
* @memberof StatsAnalyzer
|
|
428
448
|
* @returns {void}
|
|
429
449
|
*/
|
|
430
|
-
emitStartStopEvents = (mediaType, previousValue, currentValue, isLocal) => {
|
|
450
|
+
emitStartStopEvents = (mediaType: string, previousValue: number, currentValue: number, isLocal: boolean) => {
|
|
431
451
|
if (mediaType !== 'audio' && mediaType !== 'video' && mediaType !== 'share') {
|
|
432
452
|
throw new Error(`Unsupported mediaType: ${mediaType}`);
|
|
433
453
|
}
|
|
@@ -475,7 +495,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
475
495
|
* @memberof StatsAnalyzer
|
|
476
496
|
* @returns {void}
|
|
477
497
|
*/
|
|
478
|
-
compareLastStatsResult() {
|
|
498
|
+
private compareLastStatsResult() {
|
|
479
499
|
if (this.lastStatsResults !== null && this.meetingMediaStatus) {
|
|
480
500
|
// compare audio stats sent
|
|
481
501
|
let mediaType = STATS.AUDIO_CORRELATE;
|
|
@@ -633,54 +653,39 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
633
653
|
* @memberof StatsAnalyzer
|
|
634
654
|
* @returns {Promise}
|
|
635
655
|
*/
|
|
636
|
-
getStatsAndParse() {
|
|
637
|
-
if (!this.
|
|
656
|
+
private getStatsAndParse() {
|
|
657
|
+
if (!this.mediaConnection) {
|
|
638
658
|
return Promise.resolve();
|
|
639
659
|
}
|
|
640
660
|
|
|
641
|
-
if (this.
|
|
642
|
-
LoggerProxy.logger.trace('StatsAnalyzer:index#getStatsAndParse -->
|
|
661
|
+
if (this.mediaConnection && this.mediaConnection.getConnectionState() === MC.ConnectionState.Failed) {
|
|
662
|
+
LoggerProxy.logger.trace('StatsAnalyzer:index#getStatsAndParse --> media connection is in failed state');
|
|
643
663
|
|
|
644
664
|
return Promise.resolve();
|
|
645
665
|
}
|
|
646
666
|
|
|
647
667
|
LoggerProxy.logger.trace('StatsAnalyzer:index#getStatsAndParse --> Collecting Stats');
|
|
648
668
|
|
|
649
|
-
return
|
|
650
|
-
this.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
this.
|
|
655
|
-
|
|
656
|
-
}),
|
|
657
|
-
|
|
658
|
-
this.peerConnection.audioTransceiver.sender.getStats().then((res) => {
|
|
659
|
-
this.filterAndParseGetStatsResults(res, STATS.AUDIO_CORRELATE, true);
|
|
660
|
-
}),
|
|
661
|
-
|
|
662
|
-
this.peerConnection.audioTransceiver.receiver.getStats().then((res) => {
|
|
663
|
-
this.filterAndParseGetStatsResults(res, STATS.AUDIO_CORRELATE, false);
|
|
664
|
-
}),
|
|
665
|
-
|
|
666
|
-
// TODO: add checks for screen share
|
|
667
|
-
this.peerConnection.shareTransceiver.sender.getStats().then((res) => {
|
|
668
|
-
this.filterAndParseGetStatsResults(res, STATS.SHARE_CORRELATE, true);
|
|
669
|
-
}),
|
|
669
|
+
return this.mediaConnection.getTransceiverStats().then((transceiverStats) => {
|
|
670
|
+
this.filterAndParseGetStatsResults(transceiverStats.video.sender, STATS.VIDEO_CORRELATE, true);
|
|
671
|
+
this.filterAndParseGetStatsResults(transceiverStats.video.receiver, STATS.VIDEO_CORRELATE, false);
|
|
672
|
+
this.filterAndParseGetStatsResults(transceiverStats.audio.sender, STATS.AUDIO_CORRELATE, true);
|
|
673
|
+
this.filterAndParseGetStatsResults(transceiverStats.audio.receiver, STATS.AUDIO_CORRELATE, false);
|
|
674
|
+
this.filterAndParseGetStatsResults(transceiverStats.screenShareVideo.sender, STATS.SHARE_CORRELATE, true);
|
|
675
|
+
this.filterAndParseGetStatsResults(transceiverStats.screenShareVideo.receiver, STATS.SHARE_CORRELATE, false);
|
|
670
676
|
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
677
|
+
// updates the current direction of media
|
|
678
|
+
this.statsResults[STATS.AUDIO_CORRELATE].direction = transceiverStats.audio.currentDirection;
|
|
679
|
+
this.statsResults[STATS.VIDEO_CORRELATE].direction = transceiverStats.video.currentDirection;
|
|
680
|
+
this.statsResults[STATS.SHARE_CORRELATE].direction = transceiverStats.screenShareVideo.currentDirection;
|
|
674
681
|
|
|
675
|
-
|
|
676
|
-
this.statsResults[STATS.
|
|
677
|
-
this.statsResults[STATS.VIDEO_CORRELATE].direction = this.peerConnection.videoTransceiver.currentDirection;
|
|
678
|
-
this.statsResults[STATS.SHARE_CORRELATE].direction = this.peerConnection.shareTransceiver.currentDirection;
|
|
682
|
+
this.statsResults[STATS.AUDIO_CORRELATE][STATS.SEND_DIRECTION].trackLabel = transceiverStats.audio.localTrackLabel;
|
|
683
|
+
this.statsResults[STATS.VIDEO_CORRELATE][STATS.SEND_DIRECTION].trackLabel = transceiverStats.video.localTrackLabel;
|
|
679
684
|
|
|
680
|
-
// Process Stats results every 5 seconds
|
|
681
685
|
this.compareLastStatsResult();
|
|
682
686
|
|
|
683
687
|
// Save the last results to compare with the current
|
|
688
|
+
// DO Deep copy, for some reason it takes the reference all the time rather then old value set
|
|
684
689
|
this.lastStatsResults = JSON.parse(JSON.stringify(this.statsResults));
|
|
685
690
|
|
|
686
691
|
LoggerProxy.logger.trace('StatsAnalyzer:index#getStatsAndParse --> Finished Collecting Stats');
|
|
@@ -694,7 +699,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
694
699
|
* @param {*} type
|
|
695
700
|
* @returns {void}
|
|
696
701
|
*/
|
|
697
|
-
processOutboundRTPResult(result, type) {
|
|
702
|
+
private processOutboundRTPResult(result: any, type: any) {
|
|
698
703
|
const mediaType = type || STATS.AUDIO_CORRELATE;
|
|
699
704
|
const sendrecvType = STATS.SEND_DIRECTION;
|
|
700
705
|
|
|
@@ -758,7 +763,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
758
763
|
* @param {*} type
|
|
759
764
|
* @returns {void}
|
|
760
765
|
*/
|
|
761
|
-
processInboundRTPResult(result, type) {
|
|
766
|
+
private processInboundRTPResult(result: any, type: any) {
|
|
762
767
|
const mediaType = type || STATS.AUDIO_CORRELATE;
|
|
763
768
|
const sendrecvType = STATS.RECEIVE_DIRECTION;
|
|
764
769
|
|
|
@@ -860,7 +865,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
860
865
|
*
|
|
861
866
|
* @returns {void}
|
|
862
867
|
*/
|
|
863
|
-
parseCandidate = (result, type, isSender, isRemote) => {
|
|
868
|
+
parseCandidate = (result: any, type: any, isSender: boolean, isRemote: boolean) => {
|
|
864
869
|
if (!result || !result.id) {
|
|
865
870
|
return;
|
|
866
871
|
}
|
|
@@ -935,7 +940,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
935
940
|
* @returns {void}
|
|
936
941
|
* @memberof StatsAnalyzer
|
|
937
942
|
*/
|
|
938
|
-
processTrackResult(result, mediaType) {
|
|
943
|
+
private processTrackResult(result: any, mediaType: any) {
|
|
939
944
|
if (!result || result.type !== 'track') {
|
|
940
945
|
return;
|
|
941
946
|
}
|
|
@@ -979,7 +984,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
979
984
|
* @returns {void}
|
|
980
985
|
* @memberof StatsAnalyzer
|
|
981
986
|
*/
|
|
982
|
-
compareSentAndReceived(result, type) {
|
|
987
|
+
private compareSentAndReceived(result: any, type: any) {
|
|
983
988
|
if (!type) {
|
|
984
989
|
return;
|
|
985
990
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import {mean, max} from 'lodash';
|
|
3
2
|
|
|
4
3
|
import {STATS} from '../constants';
|
|
@@ -17,6 +16,7 @@ export const getAudioReceiverMqa = ({audioReceiver, statsResults, lastMqaDataSen
|
|
|
17
16
|
audioReceiver.common.mediaHopByHopLost = (statsResults[mediaType][sendrecvType].totalPacketsLost - lastMqaDataSent[mediaType][sendrecvType].totalPacketsLost) || 0;
|
|
18
17
|
audioReceiver.common.rtpHopByHopLost = statsResults[mediaType][sendrecvType].totalPacketsLost - lastMqaDataSent[mediaType][sendrecvType].totalPacketsLost || 0;
|
|
19
18
|
|
|
19
|
+
// @ts-ignore
|
|
20
20
|
audioReceiver.streams[0].common.maxRtpJitter = max(statsResults[mediaType][sendrecvType].meanRtpJitter) * 1000 || 0;
|
|
21
21
|
audioReceiver.streams[0].common.meanRtpJitter = mean(statsResults[mediaType][sendrecvType].meanRtpJitter) * 1000 || 0;
|
|
22
22
|
audioReceiver.streams[0].common.rtpJitter = audioReceiver.streams[0].common.maxRtpJitter;
|
|
@@ -43,6 +43,7 @@ export const getAudioSenderMqa = ({audioSender, statsResults, lastMqaDataSent})
|
|
|
43
43
|
audioSender.common.common.direction = statsResults[mediaType].direction;
|
|
44
44
|
audioSender.common.transportType = statsResults.connectionType.local.transport[0];
|
|
45
45
|
|
|
46
|
+
// @ts-ignore
|
|
46
47
|
audioSender.common.maxRemoteJitter = max(statsResults[mediaType][sendrecvType].meanRemoteJitter) * 1000 || 0;
|
|
47
48
|
audioSender.common.meanRemoteJitter = mean(statsResults[mediaType][sendrecvType].meanRemoteJitter) * 1000 || 0;
|
|
48
49
|
|
|
@@ -56,6 +57,7 @@ export const getAudioSenderMqa = ({audioSender, statsResults, lastMqaDataSent})
|
|
|
56
57
|
|
|
57
58
|
audioSender.common.remoteLossRate = totalpacketsLostForaMin > 0 ? (totalpacketsLostForaMin * 100 / audioSender.common.rtpPackets) : 0; // This is the packets sent with in last min || 0;
|
|
58
59
|
|
|
60
|
+
// @ts-ignore
|
|
59
61
|
audioSender.common.maxRoundTripTime = max(statsResults[mediaType][sendrecvType].meanRoundTripTime) * 1000 || 0;
|
|
60
62
|
audioSender.common.meanRoundTripTime = mean(statsResults[mediaType][sendrecvType].meanRoundTripTime) * 1000 || 0;
|
|
61
63
|
audioSender.common.roundTripTime = audioSender.common.maxRoundTripTime;
|
|
@@ -97,6 +99,7 @@ export const getVideoReceiverMqa = ({
|
|
|
97
99
|
|
|
98
100
|
// calculate this values
|
|
99
101
|
|
|
102
|
+
// @ts-ignore
|
|
100
103
|
videoReceiver.common.maxRemoteJitter = max(statsResults[mediaType][sendrecvType].meanRemoteJitter) * 1000 || 0;
|
|
101
104
|
videoReceiver.common.meanRemoteJitter = mean(statsResults[mediaType][sendrecvType].meanRemoteJitter) * 1000 || 0;
|
|
102
105
|
|
|
@@ -134,6 +137,7 @@ export const getVideoSenderMqa = ({
|
|
|
134
137
|
videoSender.common.common.direction = statsResults[mediaType].direction;
|
|
135
138
|
videoSender.common.transportType = statsResults.connectionType.local.transport[0];
|
|
136
139
|
|
|
140
|
+
// @ts-ignore
|
|
137
141
|
videoSender.common.maxRemoteJitter = max(statsResults[mediaType][sendrecvType].meanRemoteJitter) * 1000 || 0;
|
|
138
142
|
videoSender.common.meanRemoteJitter = mean(statsResults[mediaType][sendrecvType].meanRemoteJitter) * 1000 || 0;
|
|
139
143
|
|
|
@@ -146,6 +150,7 @@ export const getVideoSenderMqa = ({
|
|
|
146
150
|
|
|
147
151
|
videoSender.common.remoteLossRate = totalpacketsLostForaMin > 0 ? (totalpacketsLostForaMin) * 100 / (videoSender.common.rtpPackets + totalpacketsLostForaMin) : 0; // This is the packets sent with in last min || 0;
|
|
148
152
|
|
|
153
|
+
// @ts-ignore
|
|
149
154
|
videoSender.common.maxRoundTripTime = max(statsResults[mediaType][sendrecvType].meanRoundTripTime) * 1000 || 0;
|
|
150
155
|
videoSender.common.meanRoundTripTime = mean(statsResults[mediaType][sendrecvType].meanRoundTripTime) * 1000 || 0;
|
|
151
156
|
videoSender.common.roundTripTime = videoSender.common.maxRoundTripTime;
|
|
@@ -6,6 +6,12 @@ import {v4 as uuidv4} from 'uuid';
|
|
|
6
6
|
* @class Transcription
|
|
7
7
|
*/
|
|
8
8
|
export default class Transcription {
|
|
9
|
+
webSocketUrl: any;
|
|
10
|
+
sessionID: any;
|
|
11
|
+
members: any;
|
|
12
|
+
memberCSIs: any;
|
|
13
|
+
webSocket: any;
|
|
14
|
+
|
|
9
15
|
/**
|
|
10
16
|
* @param {string} webSocketUrl
|
|
11
17
|
* @param {sessionID} sessionId
|
|
@@ -13,7 +19,7 @@ export default class Transcription {
|
|
|
13
19
|
* @constructor
|
|
14
20
|
* @memberof Transcription
|
|
15
21
|
*/
|
|
16
|
-
constructor(webSocketUrl, sessionId, members) {
|
|
22
|
+
constructor(webSocketUrl: string, sessionId: any, members: object) {
|
|
17
23
|
this.webSocketUrl = webSocketUrl;
|
|
18
24
|
this.sessionID = sessionId;
|
|
19
25
|
this.members = members;
|
|
@@ -32,7 +38,7 @@ export default class Transcription {
|
|
|
32
38
|
* @param {string} sessionID
|
|
33
39
|
* @returns {void}
|
|
34
40
|
*/
|
|
35
|
-
connect(token) {
|
|
41
|
+
connect(token: string) {
|
|
36
42
|
this.webSocket.onopen = () => {
|
|
37
43
|
this.webSocket.send(JSON.stringify({
|
|
38
44
|
id: uuidv4(),
|
|
@@ -46,10 +52,10 @@ export default class Transcription {
|
|
|
46
52
|
/**
|
|
47
53
|
* Sets callback to invoke when the web socket connection is closed.
|
|
48
54
|
*
|
|
49
|
-
* @param {
|
|
55
|
+
* @param {Function} callback
|
|
50
56
|
* @returns {void}
|
|
51
57
|
*/
|
|
52
|
-
onCloseSocket(callback) {
|
|
58
|
+
onCloseSocket(callback: Function) {
|
|
53
59
|
if (callback) {
|
|
54
60
|
this.webSocket.onclose = (event) => {
|
|
55
61
|
callback(event);
|
|
@@ -61,10 +67,10 @@ export default class Transcription {
|
|
|
61
67
|
* Sets callback to invoke when a web socket connection error occurs.
|
|
62
68
|
* An event parameter will be send to the callback.
|
|
63
69
|
*
|
|
64
|
-
* @param {
|
|
70
|
+
* @param {Function} callback
|
|
65
71
|
* @returns {void}
|
|
66
72
|
*/
|
|
67
|
-
onErrorSocket(callback) {
|
|
73
|
+
onErrorSocket(callback: Function) {
|
|
68
74
|
if (callback) {
|
|
69
75
|
this.webSocket.onerror = (event) => {
|
|
70
76
|
callback(event);
|
|
@@ -79,7 +85,7 @@ export default class Transcription {
|
|
|
79
85
|
* @param {object} csis
|
|
80
86
|
* @returns {object}
|
|
81
87
|
*/
|
|
82
|
-
getSpeaker(csis) {
|
|
88
|
+
private getSpeaker(csis: any) {
|
|
83
89
|
for (const csi of csis) {
|
|
84
90
|
const member = this.memberCSIs[csi];
|
|
85
91
|
|
|
@@ -89,7 +95,7 @@ export default class Transcription {
|
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
return Object.values(this.members.membersCollection.members)
|
|
92
|
-
.find((member) => {
|
|
98
|
+
.find((member: any) => {
|
|
93
99
|
const memberCSIs = member.participant.status.csis;
|
|
94
100
|
let selfIsSpeaking = false;
|
|
95
101
|
|
|
@@ -108,10 +114,10 @@ export default class Transcription {
|
|
|
108
114
|
/**
|
|
109
115
|
* Sends transcription data to given callback as it arrives.
|
|
110
116
|
*
|
|
111
|
-
* @param {
|
|
117
|
+
* @param {Function} callback
|
|
112
118
|
* @returns {void}
|
|
113
119
|
*/
|
|
114
|
-
subscribe(callback) {
|
|
120
|
+
subscribe(callback: Function) {
|
|
115
121
|
let data, csis, speaker, transcription;
|
|
116
122
|
|
|
117
123
|
this.webSocket.onmessage = (event) => {
|
|
@@ -144,4 +150,3 @@ export default class Transcription {
|
|
|
144
150
|
this.webSocket.close();
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
|
-
|
|
@@ -364,7 +364,7 @@ skipInNode(describe)('plugin-meetings', () => {
|
|
|
364
364
|
stream: response[0]
|
|
365
365
|
})
|
|
366
366
|
.then(() => {
|
|
367
|
-
console.log('AUDIO ', alice.meeting.mediaProperties.
|
|
367
|
+
console.log('AUDIO ', alice.meeting.mediaProperties.audioTrack);
|
|
368
368
|
assert.equal(alice.meeting.mediaProperties.audioTrack.id, response[0].getAudioTracks()[0].id);
|
|
369
369
|
assert.equal(alice.meeting.mediaProperties.videoTrack.id, oldVideoTrackId);
|
|
370
370
|
})),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import {assert} from '@webex/test-helper-chai';
|
|
3
3
|
import {skipInNode, jenkinsOnly} from '@webex/test-helper-mocha';
|
|
4
4
|
import {patterns} from '@webex/common';
|
|
5
|
-
|
|
6
5
|
import MeetingInfoUtil from '@webex/plugin-meetings/src/meeting-info/utilv2';
|
|
7
6
|
|
|
8
7
|
import CMR from '../../utils/cmr';
|
|
@@ -10,7 +9,7 @@ import testUtils from '../../utils/testUtils';
|
|
|
10
9
|
|
|
11
10
|
require('dotenv').config();
|
|
12
11
|
|
|
13
|
-
const webexTestUsers = require('../../utils/webex-test-users
|
|
12
|
+
const webexTestUsers = require('../../utils/webex-test-users');
|
|
14
13
|
|
|
15
14
|
let userSet, alice, bob, chris, guest;
|
|
16
15
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
|
2
2
|
import Sinon from 'sinon';
|
|
3
|
-
|
|
4
3
|
import InfoUtils from '@webex/plugin-meetings/src/locus-info/infoUtils';
|
|
5
4
|
|
|
6
5
|
|
|
@@ -75,6 +74,23 @@ describe('plugin-meetings', () => {
|
|
|
75
74
|
userDisplayHints: ['HINT_3', 'HINT_1', 'HINT_2', 'LOWER_SOMEONE_ELSES_HAND']
|
|
76
75
|
});
|
|
77
76
|
});
|
|
77
|
+
|
|
78
|
+
it('only adds datachannel url when present', () => {
|
|
79
|
+
assert.deepEqual(InfoUtils.parse({datachannelUrl: 'some url'}, []), {
|
|
80
|
+
coHost: {LOWER_SOMEONE_ELSES_HAND: true},
|
|
81
|
+
moderator: {LOWER_SOMEONE_ELSES_HAND: true},
|
|
82
|
+
datachannelUrl: 'some url',
|
|
83
|
+
policy: {},
|
|
84
|
+
userDisplayHints: []
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
assert.deepEqual(InfoUtils.parse({}, []), {
|
|
88
|
+
coHost: {LOWER_SOMEONE_ELSES_HAND: true},
|
|
89
|
+
moderator: {LOWER_SOMEONE_ELSES_HAND: true},
|
|
90
|
+
policy: {},
|
|
91
|
+
userDisplayHints: []
|
|
92
|
+
});
|
|
93
|
+
});
|
|
78
94
|
});
|
|
79
95
|
|
|
80
96
|
describe('parseDisplayHintsSection', () => {
|