@webex/plugin-meetings 3.3.1-next.2 → 3.3.1-next.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/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +7 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/media/MediaConnectionAwaiter.js +50 -13
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +16 -6
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/connectionStateHandler.js +67 -0
- package/dist/meeting/connectionStateHandler.js.map +1 -0
- package/dist/meeting/index.js +98 -46
- package/dist/meeting/index.js.map +1 -1
- package/dist/metrics/constants.js +2 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +57 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/reachability/clusterReachability.js +108 -53
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +415 -56
- package/dist/reachability/index.js.map +1 -1
- package/dist/statsAnalyzer/index.js +81 -27
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +36 -10
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +18 -4
- package/dist/types/mediaQualityMetrics/config.d.ts +11 -0
- package/dist/types/meeting/connectionStateHandler.d.ts +30 -0
- package/dist/types/meeting/index.d.ts +2 -0
- package/dist/types/metrics/constants.d.ts +1 -0
- package/dist/types/metrics/index.d.ts +15 -0
- package/dist/types/reachability/clusterReachability.d.ts +31 -3
- package/dist/types/reachability/index.d.ts +93 -2
- package/dist/types/statsAnalyzer/index.d.ts +15 -6
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +17 -4
- package/dist/webinar/index.js +1 -1
- package/package.json +23 -22
- package/src/breakouts/index.ts +7 -1
- package/src/media/MediaConnectionAwaiter.ts +66 -11
- package/src/mediaQualityMetrics/config.ts +14 -3
- package/src/meeting/connectionStateHandler.ts +65 -0
- package/src/meeting/index.ts +72 -14
- package/src/metrics/constants.ts +1 -0
- package/src/metrics/index.ts +44 -0
- package/src/reachability/clusterReachability.ts +86 -25
- package/src/reachability/index.ts +316 -27
- package/src/statsAnalyzer/index.ts +85 -24
- package/src/statsAnalyzer/mqaUtil.ts +55 -7
- package/test/unit/spec/breakouts/index.ts +51 -32
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +90 -32
- package/test/unit/spec/meeting/connectionStateHandler.ts +102 -0
- package/test/unit/spec/meeting/index.js +158 -36
- package/test/unit/spec/metrics/index.js +126 -0
- package/test/unit/spec/reachability/clusterReachability.ts +116 -22
- package/test/unit/spec/reachability/index.ts +1153 -84
- package/test/unit/spec/stats-analyzer/index.js +647 -319
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
3
|
*/
|
|
4
|
+
import { Defer } from '@webex/common';
|
|
4
5
|
import ReachabilityRequest from './request';
|
|
5
6
|
import { ClusterReachability, ClusterReachabilityResult } from './clusterReachability';
|
|
7
|
+
import EventsScope from '../common/events/events-scope';
|
|
6
8
|
export type ReachabilityMetrics = {
|
|
7
9
|
reachability_public_udp_success: number;
|
|
8
10
|
reachability_public_udp_failed: number;
|
|
@@ -40,13 +42,37 @@ export type ReachabilityResults = Record<string, ClusterReachabilityResult & {
|
|
|
40
42
|
* @class Reachability
|
|
41
43
|
* @export
|
|
42
44
|
*/
|
|
43
|
-
export default class Reachability {
|
|
45
|
+
export default class Reachability extends EventsScope {
|
|
44
46
|
namespace: string;
|
|
45
47
|
webex: object;
|
|
46
48
|
reachabilityRequest: ReachabilityRequest;
|
|
47
49
|
clusterReachability: {
|
|
48
50
|
[key: string]: ClusterReachability;
|
|
49
51
|
};
|
|
52
|
+
reachabilityDefer?: Defer;
|
|
53
|
+
vmnTimer?: ReturnType<typeof setTimeout>;
|
|
54
|
+
publicCloudTimer?: ReturnType<typeof setTimeout>;
|
|
55
|
+
overallTimer?: ReturnType<typeof setTimeout>;
|
|
56
|
+
expectedResultsCount: {
|
|
57
|
+
videoMesh: {
|
|
58
|
+
udp: number;
|
|
59
|
+
};
|
|
60
|
+
public: {
|
|
61
|
+
udp: number;
|
|
62
|
+
tcp: number;
|
|
63
|
+
xtls: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
resultsCount: {
|
|
67
|
+
videoMesh: {
|
|
68
|
+
udp: number;
|
|
69
|
+
};
|
|
70
|
+
public: {
|
|
71
|
+
udp: number;
|
|
72
|
+
tcp: number;
|
|
73
|
+
xtls: number;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
50
76
|
/**
|
|
51
77
|
* Creates an instance of Reachability.
|
|
52
78
|
* @param {object} webex
|
|
@@ -111,10 +137,75 @@ export default class Reachability {
|
|
|
111
137
|
* @memberof Reachability
|
|
112
138
|
*/
|
|
113
139
|
private logUnreachableClusters;
|
|
140
|
+
/**
|
|
141
|
+
* Returns true if we've obtained all the reachability results for all the public clusters
|
|
142
|
+
* In other words, it means that all public clusters are reachable over each protocol,
|
|
143
|
+
* because we only get a "result" if we managed to reach a cluster
|
|
144
|
+
*
|
|
145
|
+
* @returns {boolean}
|
|
146
|
+
*/
|
|
147
|
+
private areAllPublicClusterResultsReady;
|
|
148
|
+
/**
|
|
149
|
+
* Returns true if we've obtained all the reachability results for all the clusters
|
|
150
|
+
*
|
|
151
|
+
* @returns {boolean}
|
|
152
|
+
*/
|
|
153
|
+
private areAllResultsReady;
|
|
154
|
+
/**
|
|
155
|
+
* Resolves the promise returned by gatherReachability() method
|
|
156
|
+
* @returns {void}
|
|
157
|
+
*/
|
|
158
|
+
private resolveReachabilityPromise;
|
|
159
|
+
/**
|
|
160
|
+
* Aborts all cluster reachability checks that are in progress
|
|
161
|
+
*
|
|
162
|
+
* @returns {void}
|
|
163
|
+
*/
|
|
164
|
+
private abortClusterReachability;
|
|
165
|
+
/**
|
|
166
|
+
* Helper function for calculating min/max/average values of latency
|
|
167
|
+
*
|
|
168
|
+
* @param {Array<any>} results
|
|
169
|
+
* @param {string} protocol
|
|
170
|
+
* @param {boolean} isVideoMesh
|
|
171
|
+
* @returns {{min:number, max: number, average: number}}
|
|
172
|
+
*/
|
|
173
|
+
protected getStatistics(results: Array<ClusterReachabilityResult & {
|
|
174
|
+
isVideoMesh: boolean;
|
|
175
|
+
}>, protocol: 'udp' | 'tcp' | 'xtls', isVideoMesh: boolean): {
|
|
176
|
+
min: number;
|
|
177
|
+
max: number;
|
|
178
|
+
average: number;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Sends a metric with all the statistics about how long reachability took
|
|
182
|
+
*
|
|
183
|
+
* @returns {void}
|
|
184
|
+
*/
|
|
185
|
+
protected sendMetric(): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Starts all the timers used for various timeouts
|
|
188
|
+
*
|
|
189
|
+
* @returns {void}
|
|
190
|
+
*/
|
|
191
|
+
private startTimers;
|
|
192
|
+
/**
|
|
193
|
+
* Stores given reachability results in local storage
|
|
194
|
+
*
|
|
195
|
+
* @param {ReachabilityResults} results
|
|
196
|
+
* @returns {Promise<void>}
|
|
197
|
+
*/
|
|
198
|
+
private storeResults;
|
|
199
|
+
/**
|
|
200
|
+
* Resets all the internal counters that keep track of the results
|
|
201
|
+
*
|
|
202
|
+
* @returns {void}
|
|
203
|
+
*/
|
|
204
|
+
private resetResultCounters;
|
|
114
205
|
/**
|
|
115
206
|
* Performs reachability checks for all clusters
|
|
116
207
|
* @param {ClusterList} clusterList
|
|
117
|
-
* @returns {Promise<
|
|
208
|
+
* @returns {Promise<void>} promise that's resolved as soon as the checks are started
|
|
118
209
|
*/
|
|
119
210
|
private performReachabilityChecks;
|
|
120
211
|
}
|
|
@@ -36,17 +36,26 @@ export declare class StatsAnalyzer extends EventsScope {
|
|
|
36
36
|
statsStarted: any;
|
|
37
37
|
successfulCandidatePair: any;
|
|
38
38
|
localIpAddress: string;
|
|
39
|
+
shareVideoEncoderImplementation?: string;
|
|
39
40
|
receiveSlotCallback: ReceiveSlotCallback;
|
|
41
|
+
isMultistream: boolean;
|
|
40
42
|
/**
|
|
41
43
|
* Creates a new instance of StatsAnalyzer
|
|
42
44
|
* @constructor
|
|
43
45
|
* @public
|
|
44
|
-
* @param {Object} config SDK Configuration Object
|
|
45
|
-
* @param {Function} receiveSlotCallback Callback used to access receive slots.
|
|
46
|
-
* @param {Object} networkQualityMonitor
|
|
47
|
-
* @param {Object} statsResults Default properties for stats
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
* @param {Object} config - SDK Configuration Object
|
|
47
|
+
* @param {Function} receiveSlotCallback - Callback used to access receive slots.
|
|
48
|
+
* @param {Object} networkQualityMonitor - Class for assessing network characteristics (jitter, packetLoss, latency)
|
|
49
|
+
* @param {Object} statsResults - Default properties for stats
|
|
50
|
+
* @param {boolean | undefined} isMultistream - Param indicating if the media connection is multistream or not
|
|
51
|
+
*/
|
|
52
|
+
constructor({ config, receiveSlotCallback, networkQualityMonitor, statsResults, isMultistream, }: {
|
|
53
|
+
config: any;
|
|
54
|
+
receiveSlotCallback: ReceiveSlotCallback;
|
|
55
|
+
networkQualityMonitor: any;
|
|
56
|
+
statsResults?: any;
|
|
57
|
+
isMultistream?: boolean;
|
|
58
|
+
});
|
|
50
59
|
/**
|
|
51
60
|
* Resets cumulative stats arrays.
|
|
52
61
|
*
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare const getAudioReceiverMqa: ({ audioReceiver, statsResults, lastMqaDataSent, baseMediaType, }: {
|
|
1
|
+
export declare const getAudioReceiverMqa: ({ audioReceiver, statsResults, lastMqaDataSent, baseMediaType, isMultistream, }: {
|
|
2
2
|
audioReceiver: any;
|
|
3
3
|
statsResults: any;
|
|
4
4
|
lastMqaDataSent: any;
|
|
5
5
|
baseMediaType: any;
|
|
6
|
+
isMultistream: any;
|
|
6
7
|
}) => void;
|
|
7
8
|
export declare const getAudioReceiverStreamMqa: ({ audioReceiverStream, statsResults, lastMqaDataSent, mediaType, }: {
|
|
8
9
|
audioReceiverStream: any;
|
|
@@ -10,11 +11,12 @@ export declare const getAudioReceiverStreamMqa: ({ audioReceiverStream, statsRes
|
|
|
10
11
|
lastMqaDataSent: any;
|
|
11
12
|
mediaType: any;
|
|
12
13
|
}) => void;
|
|
13
|
-
export declare const getAudioSenderMqa: ({ audioSender, statsResults, lastMqaDataSent, baseMediaType }: {
|
|
14
|
+
export declare const getAudioSenderMqa: ({ audioSender, statsResults, lastMqaDataSent, baseMediaType, isMultistream, }: {
|
|
14
15
|
audioSender: any;
|
|
15
16
|
statsResults: any;
|
|
16
17
|
lastMqaDataSent: any;
|
|
17
18
|
baseMediaType: any;
|
|
19
|
+
isMultistream: any;
|
|
18
20
|
}) => void;
|
|
19
21
|
export declare const getAudioSenderStreamMqa: ({ audioSenderStream, statsResults, lastMqaDataSent, mediaType, }: {
|
|
20
22
|
audioSenderStream: any;
|
|
@@ -22,11 +24,12 @@ export declare const getAudioSenderStreamMqa: ({ audioSenderStream, statsResults
|
|
|
22
24
|
lastMqaDataSent: any;
|
|
23
25
|
mediaType: any;
|
|
24
26
|
}) => void;
|
|
25
|
-
export declare const getVideoReceiverMqa: ({ videoReceiver, statsResults, lastMqaDataSent, baseMediaType, }: {
|
|
27
|
+
export declare const getVideoReceiverMqa: ({ videoReceiver, statsResults, lastMqaDataSent, baseMediaType, isMultistream, }: {
|
|
26
28
|
videoReceiver: any;
|
|
27
29
|
statsResults: any;
|
|
28
30
|
lastMqaDataSent: any;
|
|
29
31
|
baseMediaType: any;
|
|
32
|
+
isMultistream: any;
|
|
30
33
|
}) => void;
|
|
31
34
|
export declare const getVideoReceiverStreamMqa: ({ videoReceiverStream, statsResults, lastMqaDataSent, mediaType, }: {
|
|
32
35
|
videoReceiverStream: any;
|
|
@@ -34,11 +37,12 @@ export declare const getVideoReceiverStreamMqa: ({ videoReceiverStream, statsRes
|
|
|
34
37
|
lastMqaDataSent: any;
|
|
35
38
|
mediaType: any;
|
|
36
39
|
}) => void;
|
|
37
|
-
export declare const getVideoSenderMqa: ({ videoSender, statsResults, lastMqaDataSent, baseMediaType }: {
|
|
40
|
+
export declare const getVideoSenderMqa: ({ videoSender, statsResults, lastMqaDataSent, baseMediaType, isMultistream, }: {
|
|
38
41
|
videoSender: any;
|
|
39
42
|
statsResults: any;
|
|
40
43
|
lastMqaDataSent: any;
|
|
41
44
|
baseMediaType: any;
|
|
45
|
+
isMultistream: any;
|
|
42
46
|
}) => void;
|
|
43
47
|
export declare const getVideoSenderStreamMqa: ({ videoSenderStream, statsResults, lastMqaDataSent, mediaType, }: {
|
|
44
48
|
videoSenderStream: any;
|
|
@@ -46,3 +50,12 @@ export declare const getVideoSenderStreamMqa: ({ videoSenderStream, statsResults
|
|
|
46
50
|
lastMqaDataSent: any;
|
|
47
51
|
mediaType: any;
|
|
48
52
|
}) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if stream stats should be updated based on request status and elapsed time.
|
|
55
|
+
*
|
|
56
|
+
* @param {Object} statsResults - Stats results object.
|
|
57
|
+
* @param {string} mediaType - Media type (e.g., 'audio', 'video').
|
|
58
|
+
* @param {string} direction - Stats direction (e.g., 'send', 'receive').
|
|
59
|
+
* @returns {boolean} Whether stats should be updated.
|
|
60
|
+
*/
|
|
61
|
+
export declare const isStreamRequested: (statsResults: any, mediaType: string, direction: string) => boolean;
|
package/dist/webinar/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
|
|
|
62
62
|
updateCanManageWebcast: function updateCanManageWebcast(canManageWebcast) {
|
|
63
63
|
this.set('canManageWebcast', canManageWebcast);
|
|
64
64
|
},
|
|
65
|
-
version: "3.3.1-next.
|
|
65
|
+
version: "3.3.1-next.21"
|
|
66
66
|
});
|
|
67
67
|
var _default = exports.default = Webinar;
|
|
68
68
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
44
44
|
"@webex/jest-config-legacy": "0.0.0",
|
|
45
45
|
"@webex/legacy-tools": "0.0.0",
|
|
46
|
-
"@webex/plugin-meetings": "3.3.1-next.
|
|
47
|
-
"@webex/plugin-rooms": "3.3.1-next.
|
|
48
|
-
"@webex/test-helper-chai": "3.3.1-next.
|
|
49
|
-
"@webex/test-helper-mocha": "3.3.1-next.
|
|
50
|
-
"@webex/test-helper-mock-webex": "3.3.1-next.
|
|
51
|
-
"@webex/test-helper-retry": "3.3.1-next.
|
|
52
|
-
"@webex/test-helper-test-users": "3.3.1-next.
|
|
46
|
+
"@webex/plugin-meetings": "3.3.1-next.21",
|
|
47
|
+
"@webex/plugin-rooms": "3.3.1-next.5",
|
|
48
|
+
"@webex/test-helper-chai": "3.3.1-next.4",
|
|
49
|
+
"@webex/test-helper-mocha": "3.3.1-next.4",
|
|
50
|
+
"@webex/test-helper-mock-webex": "3.3.1-next.4",
|
|
51
|
+
"@webex/test-helper-retry": "3.3.1-next.4",
|
|
52
|
+
"@webex/test-helper-test-users": "3.3.1-next.4",
|
|
53
53
|
"chai": "^4.3.4",
|
|
54
54
|
"chai-as-promised": "^7.1.1",
|
|
55
55
|
"eslint": "^8.24.0",
|
|
@@ -61,20 +61,21 @@
|
|
|
61
61
|
"typescript": "^4.7.4"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@webex/common": "3.3.1-next.
|
|
65
|
-
"@webex/internal-media-core": "2.
|
|
66
|
-
"@webex/internal-plugin-conversation": "3.3.1-next.
|
|
67
|
-
"@webex/internal-plugin-device": "3.3.1-next.
|
|
68
|
-
"@webex/internal-plugin-llm": "3.3.1-next.
|
|
69
|
-
"@webex/internal-plugin-mercury": "3.3.1-next.
|
|
70
|
-
"@webex/internal-plugin-metrics": "3.3.1-next.
|
|
71
|
-
"@webex/internal-plugin-support": "3.3.1-next.
|
|
72
|
-
"@webex/internal-plugin-user": "3.3.1-next.
|
|
73
|
-
"@webex/internal-plugin-voicea": "3.3.1-next.
|
|
74
|
-
"@webex/media-helpers": "3.3.1-next.
|
|
75
|
-
"@webex/plugin-people": "3.3.1-next.
|
|
76
|
-
"@webex/plugin-rooms": "3.3.1-next.
|
|
77
|
-
"@webex/
|
|
64
|
+
"@webex/common": "3.3.1-next.4",
|
|
65
|
+
"@webex/internal-media-core": "2.7.1",
|
|
66
|
+
"@webex/internal-plugin-conversation": "3.3.1-next.5",
|
|
67
|
+
"@webex/internal-plugin-device": "3.3.1-next.4",
|
|
68
|
+
"@webex/internal-plugin-llm": "3.3.1-next.6",
|
|
69
|
+
"@webex/internal-plugin-mercury": "3.3.1-next.5",
|
|
70
|
+
"@webex/internal-plugin-metrics": "3.3.1-next.4",
|
|
71
|
+
"@webex/internal-plugin-support": "3.3.1-next.5",
|
|
72
|
+
"@webex/internal-plugin-user": "3.3.1-next.4",
|
|
73
|
+
"@webex/internal-plugin-voicea": "3.3.1-next.21",
|
|
74
|
+
"@webex/media-helpers": "3.3.1-next.7",
|
|
75
|
+
"@webex/plugin-people": "3.3.1-next.5",
|
|
76
|
+
"@webex/plugin-rooms": "3.3.1-next.5",
|
|
77
|
+
"@webex/web-capabilities": "^1.3.0",
|
|
78
|
+
"@webex/webex-core": "3.3.1-next.4",
|
|
78
79
|
"ampersand-collection": "^2.0.2",
|
|
79
80
|
"bowser": "^2.11.0",
|
|
80
81
|
"btoa": "^1.2.1",
|
|
@@ -91,5 +92,5 @@
|
|
|
91
92
|
"//": [
|
|
92
93
|
"TODO: upgrade jwt-decode when moving to node 18"
|
|
93
94
|
],
|
|
94
|
-
"version": "3.3.1-next.
|
|
95
|
+
"version": "3.3.1-next.21"
|
|
95
96
|
}
|
package/src/breakouts/index.ts
CHANGED
|
@@ -148,7 +148,6 @@ const Breakouts = WebexPlugin.extend({
|
|
|
148
148
|
this.triggerReturnToMainEvent(breakout);
|
|
149
149
|
});
|
|
150
150
|
this.listenToCurrentSessionTypeChange();
|
|
151
|
-
this.listenToBroadcastMessages();
|
|
152
151
|
this.listenToBreakoutRosters();
|
|
153
152
|
this.listenToBreakoutHelp();
|
|
154
153
|
// @ts-ignore
|
|
@@ -161,6 +160,7 @@ const Breakouts = WebexPlugin.extend({
|
|
|
161
160
|
*/
|
|
162
161
|
cleanUp() {
|
|
163
162
|
this.stopListening();
|
|
163
|
+
this.hasSubscribedToMessage = undefined;
|
|
164
164
|
},
|
|
165
165
|
|
|
166
166
|
/**
|
|
@@ -170,6 +170,7 @@ const Breakouts = WebexPlugin.extend({
|
|
|
170
170
|
*/
|
|
171
171
|
locusUrlUpdate(locusUrl) {
|
|
172
172
|
this.set('locusUrl', locusUrl);
|
|
173
|
+
this.listenToBroadcastMessages();
|
|
173
174
|
const {isInMainSession, mainLocusUrl} = this;
|
|
174
175
|
if (isInMainSession || !mainLocusUrl) {
|
|
175
176
|
this.set('mainLocusUrl', locusUrl);
|
|
@@ -255,6 +256,10 @@ const Breakouts = WebexPlugin.extend({
|
|
|
255
256
|
* @returns {void}
|
|
256
257
|
*/
|
|
257
258
|
listenToBroadcastMessages() {
|
|
259
|
+
if (!this.webex.internal.llm.isConnected() || this.hasSubscribedToMessage) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
258
263
|
this.listenTo(this.webex.internal.llm, 'event:breakout.message', (event) => {
|
|
259
264
|
const {
|
|
260
265
|
data: {senderUserId, sentTime, message},
|
|
@@ -270,6 +275,7 @@ const Breakouts = WebexPlugin.extend({
|
|
|
270
275
|
sessionId: this.currentBreakoutSession.sessionId,
|
|
271
276
|
});
|
|
272
277
|
});
|
|
278
|
+
this.hasSubscribedToMessage = true;
|
|
273
279
|
},
|
|
274
280
|
|
|
275
281
|
/**
|
|
@@ -15,8 +15,10 @@ export default class MediaConnectionAwaiter {
|
|
|
15
15
|
private timer: any;
|
|
16
16
|
private defer: Defer;
|
|
17
17
|
private retried: boolean;
|
|
18
|
+
private iceConnected: boolean;
|
|
18
19
|
private onTimeoutCallback: () => void;
|
|
19
|
-
private
|
|
20
|
+
private peerConnectionStateCallback: () => void;
|
|
21
|
+
private iceConnectionStateCallback: () => void;
|
|
20
22
|
private iceGatheringStateCallback: () => void;
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -26,9 +28,11 @@ export default class MediaConnectionAwaiter {
|
|
|
26
28
|
this.webrtcMediaConnection = webrtcMediaConnection;
|
|
27
29
|
this.defer = new Defer();
|
|
28
30
|
this.retried = false;
|
|
31
|
+
this.iceConnected = false;
|
|
29
32
|
this.onTimeoutCallback = this.onTimeout.bind(this);
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
33
|
+
this.peerConnectionStateCallback = this.peerConnectionStateHandler.bind(this);
|
|
34
|
+
this.iceConnectionStateCallback = this.iceConnectionStateHandler.bind(this);
|
|
35
|
+
this.iceGatheringStateCallback = this.iceGatheringStateHandler.bind(this);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
/**
|
|
@@ -59,17 +63,24 @@ export default class MediaConnectionAwaiter {
|
|
|
59
63
|
Event.ICE_GATHERING_STATE_CHANGED,
|
|
60
64
|
this.iceGatheringStateCallback
|
|
61
65
|
);
|
|
62
|
-
this.webrtcMediaConnection.off(
|
|
66
|
+
this.webrtcMediaConnection.off(
|
|
67
|
+
Event.PEER_CONNECTION_STATE_CHANGED,
|
|
68
|
+
this.peerConnectionStateCallback
|
|
69
|
+
);
|
|
70
|
+
this.webrtcMediaConnection.off(
|
|
71
|
+
Event.ICE_CONNECTION_STATE_CHANGED,
|
|
72
|
+
this.iceConnectionStateCallback
|
|
73
|
+
);
|
|
63
74
|
}
|
|
64
75
|
|
|
65
76
|
/**
|
|
66
|
-
*
|
|
77
|
+
* On connection state change.
|
|
67
78
|
*
|
|
68
79
|
* @returns {void}
|
|
69
80
|
*/
|
|
70
|
-
|
|
81
|
+
connectionStateChange(): void {
|
|
71
82
|
LoggerProxy.logger.log(
|
|
72
|
-
`Media:MediaConnectionAwaiter#
|
|
83
|
+
`Media:MediaConnectionAwaiter#connectionStateChange --> connection state: ${this.webrtcMediaConnection.getConnectionState()}`
|
|
73
84
|
);
|
|
74
85
|
|
|
75
86
|
if (!this.isConnected()) {
|
|
@@ -83,16 +94,50 @@ export default class MediaConnectionAwaiter {
|
|
|
83
94
|
this.defer.resolve();
|
|
84
95
|
}
|
|
85
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Listener for peer connection state change.
|
|
99
|
+
*
|
|
100
|
+
* @returns {void}
|
|
101
|
+
*/
|
|
102
|
+
peerConnectionStateHandler(): void {
|
|
103
|
+
const peerConnectionState = this.webrtcMediaConnection.getPeerConnectionState();
|
|
104
|
+
|
|
105
|
+
LoggerProxy.logger.log(
|
|
106
|
+
`Media:MediaConnectionAwaiter#peerConnectionStateHandler --> Peer connection state change -> ${peerConnectionState}`
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
this.connectionStateChange();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Listener for ICE connection state change.
|
|
114
|
+
*
|
|
115
|
+
* @returns {void}
|
|
116
|
+
*/
|
|
117
|
+
iceConnectionStateHandler(): void {
|
|
118
|
+
const iceConnectionState = this.webrtcMediaConnection.getIceConnectionState();
|
|
119
|
+
|
|
120
|
+
LoggerProxy.logger.log(
|
|
121
|
+
`Media:MediaConnectionAwaiter#iceConnectionStateHandler --> ICE connection state change -> ${iceConnectionState}`
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
if (iceConnectionState === 'connected' && !this.iceConnected) {
|
|
125
|
+
this.iceConnected = true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
this.connectionStateChange();
|
|
129
|
+
}
|
|
130
|
+
|
|
86
131
|
/**
|
|
87
132
|
* Listener for ICE gathering state change.
|
|
88
133
|
*
|
|
89
134
|
* @returns {void}
|
|
90
135
|
*/
|
|
91
|
-
|
|
136
|
+
iceGatheringStateHandler(): void {
|
|
92
137
|
const iceGatheringState = this.webrtcMediaConnection.getIceGatheringState();
|
|
93
138
|
|
|
94
139
|
LoggerProxy.logger.log(
|
|
95
|
-
`Media:MediaConnectionAwaiter#
|
|
140
|
+
`Media:MediaConnectionAwaiter#iceGatheringStateHandler --> ICE gathering state change -> ${iceGatheringState}`
|
|
96
141
|
);
|
|
97
142
|
|
|
98
143
|
if (!this.isIceGatheringCompleted()) {
|
|
@@ -147,7 +192,9 @@ export default class MediaConnectionAwaiter {
|
|
|
147
192
|
|
|
148
193
|
this.clearCallbacks();
|
|
149
194
|
|
|
150
|
-
this.defer.reject(
|
|
195
|
+
this.defer.reject({
|
|
196
|
+
iceConnected: this.iceConnected,
|
|
197
|
+
});
|
|
151
198
|
}
|
|
152
199
|
|
|
153
200
|
/**
|
|
@@ -160,7 +207,15 @@ export default class MediaConnectionAwaiter {
|
|
|
160
207
|
return Promise.resolve();
|
|
161
208
|
}
|
|
162
209
|
|
|
163
|
-
this.webrtcMediaConnection.on(
|
|
210
|
+
this.webrtcMediaConnection.on(
|
|
211
|
+
Event.PEER_CONNECTION_STATE_CHANGED,
|
|
212
|
+
this.peerConnectionStateCallback
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
this.webrtcMediaConnection.on(
|
|
216
|
+
Event.ICE_CONNECTION_STATE_CHANGED,
|
|
217
|
+
this.iceConnectionStateCallback
|
|
218
|
+
);
|
|
164
219
|
|
|
165
220
|
this.webrtcMediaConnection.on(
|
|
166
221
|
Event.ICE_GATHERING_STATE_CHANGED,
|
|
@@ -4,10 +4,21 @@ export const emptyMqaInterval = {
|
|
|
4
4
|
intervalMetadata: {
|
|
5
5
|
peerReflexiveIP: '0.0.0.0',
|
|
6
6
|
peripherals: [],
|
|
7
|
+
cpuInfo: {
|
|
8
|
+
numberOfCores: 1, // default value from spec if CpuInfo.getNumLogicalCores cannot be determined
|
|
9
|
+
description: 'NA',
|
|
10
|
+
architecture: 'unknown',
|
|
11
|
+
},
|
|
7
12
|
processAverageCPU: 0,
|
|
8
13
|
processMaximumCPU: 0,
|
|
9
14
|
systemAverageCPU: 0,
|
|
10
15
|
systemMaximumCPU: 0,
|
|
16
|
+
screenWidth: 0,
|
|
17
|
+
screenHeight: 0,
|
|
18
|
+
screenResolution: 0,
|
|
19
|
+
appWindowWidth: 0,
|
|
20
|
+
appWindowHeight: 0,
|
|
21
|
+
appWindowSize: 0,
|
|
11
22
|
},
|
|
12
23
|
networkType: '',
|
|
13
24
|
intervalNumber: 0,
|
|
@@ -126,7 +137,7 @@ export const emptyVideoReceive = {
|
|
|
126
137
|
mariRtxEnabled: false,
|
|
127
138
|
mariQosEnabled: false,
|
|
128
139
|
mariLiteEnabled: false,
|
|
129
|
-
multistreamEnabled:
|
|
140
|
+
multistreamEnabled: false,
|
|
130
141
|
},
|
|
131
142
|
dtlsBitrate: 0, // Not avaliable
|
|
132
143
|
dtlsPackets: 0, // Not avaliable
|
|
@@ -170,7 +181,7 @@ export const emptyVideoReceiveStream = {
|
|
|
170
181
|
ssci: 0, // Not avaliable
|
|
171
182
|
},
|
|
172
183
|
h264CodecProfile: 'BP',
|
|
173
|
-
isActiveSpeaker:
|
|
184
|
+
isActiveSpeaker: false,
|
|
174
185
|
optimalFrameSize: 0, // Not avaliable
|
|
175
186
|
receivedFrameSize: 0,
|
|
176
187
|
receivedHeight: 0,
|
|
@@ -193,7 +204,7 @@ export const emptyVideoTransmit = {
|
|
|
193
204
|
mariRtxEnabled: false,
|
|
194
205
|
mariQosEnabled: false,
|
|
195
206
|
mariLiteEnabled: false,
|
|
196
|
-
multistreamEnabled: false,
|
|
207
|
+
multistreamEnabled: false,
|
|
197
208
|
},
|
|
198
209
|
dtlsBitrate: 0, // Not avaliable
|
|
199
210
|
dtlsPackets: 0, // Not avaliable
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {Event, ConnectionState} from '@webex/internal-media-core';
|
|
2
|
+
import EventsScope from '../common/events/events-scope';
|
|
3
|
+
import {Enum} from '../constants';
|
|
4
|
+
|
|
5
|
+
export const ConnectionStateEvent = {
|
|
6
|
+
stateChanged: 'connectionState:changed',
|
|
7
|
+
} as const;
|
|
8
|
+
|
|
9
|
+
export type ConnectionStateEvent = Enum<typeof ConnectionStateEvent>;
|
|
10
|
+
|
|
11
|
+
export interface ConnectionStateChangedEvent {
|
|
12
|
+
/**
|
|
13
|
+
* Current overall connection state
|
|
14
|
+
*/
|
|
15
|
+
state: ConnectionState;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @class ConnectionStateHandler
|
|
20
|
+
*/
|
|
21
|
+
export class ConnectionStateHandler extends EventsScope {
|
|
22
|
+
private webrtcMediaConnection: any;
|
|
23
|
+
|
|
24
|
+
private mediaConnectionState: ConnectionState;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {WebRTCMeeting} webrtcMediaConnection
|
|
28
|
+
*/
|
|
29
|
+
constructor(webrtcMediaConnection) {
|
|
30
|
+
super();
|
|
31
|
+
|
|
32
|
+
this.webrtcMediaConnection = webrtcMediaConnection;
|
|
33
|
+
|
|
34
|
+
this.webrtcMediaConnection.on(
|
|
35
|
+
Event.PEER_CONNECTION_STATE_CHANGED,
|
|
36
|
+
this.handleConnectionStateChange.bind(this)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
this.webrtcMediaConnection.on(
|
|
40
|
+
Event.ICE_CONNECTION_STATE_CHANGED,
|
|
41
|
+
this.handleConnectionStateChange.bind(this)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Handler for connection state change.
|
|
47
|
+
*
|
|
48
|
+
* @returns {void}
|
|
49
|
+
*/
|
|
50
|
+
private handleConnectionStateChange(): void {
|
|
51
|
+
const newConnectionState = this.webrtcMediaConnection.getConnectionState();
|
|
52
|
+
|
|
53
|
+
if (newConnectionState !== this.mediaConnectionState) {
|
|
54
|
+
this.mediaConnectionState = newConnectionState;
|
|
55
|
+
this.emit(
|
|
56
|
+
{
|
|
57
|
+
file: 'connectionStateHandler',
|
|
58
|
+
function: 'handleConnectionStateChange',
|
|
59
|
+
},
|
|
60
|
+
ConnectionStateEvent.stateChanged,
|
|
61
|
+
{state: this.mediaConnectionState}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|