@webex/plugin-meetings 3.12.0-next.174 → 3.12.0-next.175
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/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/common/errors/webex-errors.js +7 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/constants.js +6 -5
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/media/MediaConnectionAwaiter.js +225 -175
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/meeting/index.js +2 -1
- package/dist/meeting/index.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +6 -2
- package/dist/types/constants.d.ts +2 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -53
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/common/errors/webex-errors.ts +8 -2
- package/src/constants.ts +2 -1
- package/src/media/MediaConnectionAwaiter.ts +223 -207
- package/src/media/ai-docs/media-spec.md +10 -10
- package/src/meeting/index.ts +2 -0
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +426 -19
- package/test/unit/spec/media/properties.ts +3 -3
- package/test/unit/spec/meeting/index.js +17 -6
|
@@ -94,6 +94,7 @@ declare class AddMediaFailed extends WebexMeetingsError {
|
|
|
94
94
|
selectedCandidatePairChanges?: number;
|
|
95
95
|
numTransports?: number;
|
|
96
96
|
iceConnected?: boolean;
|
|
97
|
+
iceConnectedAtLeastOnce?: boolean;
|
|
97
98
|
/**
|
|
98
99
|
* Creates a new AddMediaFailed error
|
|
99
100
|
* @param {Object} options
|
|
@@ -101,7 +102,8 @@ declare class AddMediaFailed extends WebexMeetingsError {
|
|
|
101
102
|
* @param {string} [options.connectionType] - The ICE connection type at the time of failure (e.g. 'UDP', 'TURN-TLS')
|
|
102
103
|
* @param {number} [options.selectedCandidatePairChanges] - Number of times the selected candidate pair changed
|
|
103
104
|
* @param {number} [options.numTransports] - Number of ICE transports
|
|
104
|
-
* @param {boolean} [options.iceConnected] - Whether ICE
|
|
105
|
+
* @param {boolean} [options.iceConnected] - Whether ICE is connected at the time of failure
|
|
106
|
+
* @param {boolean} [options.iceConnectedAtLeastOnce] - Whether ICE connected at least once before failure
|
|
105
107
|
*/
|
|
106
108
|
constructor(options?: {
|
|
107
109
|
cause?: Error;
|
|
@@ -109,10 +111,11 @@ declare class AddMediaFailed extends WebexMeetingsError {
|
|
|
109
111
|
selectedCandidatePairChanges?: number;
|
|
110
112
|
numTransports?: number;
|
|
111
113
|
iceConnected?: boolean;
|
|
114
|
+
iceConnectedAtLeastOnce?: boolean;
|
|
112
115
|
});
|
|
113
116
|
/**
|
|
114
117
|
* Returns true if the failure was due to a DTLS handshake failure
|
|
115
|
-
* (ICE connected
|
|
118
|
+
* (ICE is still connected but the overall media connection failed).
|
|
116
119
|
*/
|
|
117
120
|
get isDtlsHandshakeFailure(): boolean;
|
|
118
121
|
}
|
|
@@ -123,6 +126,7 @@ export { AddMediaFailed };
|
|
|
123
126
|
*/
|
|
124
127
|
declare class MediaConnectionTimedOutError extends Error {
|
|
125
128
|
iceConnected: boolean;
|
|
129
|
+
iceConnectedAtLeastOnce?: boolean;
|
|
126
130
|
cause?: any;
|
|
127
131
|
constructor(message: string, iceConnected: boolean, cause?: any);
|
|
128
132
|
}
|
|
@@ -137,7 +137,8 @@ export declare const INTENT_TO_JOIN: number[];
|
|
|
137
137
|
export declare const ICE_TIMEOUT = 2000;
|
|
138
138
|
export declare const ICE_FAIL_TIMEOUT = 3000;
|
|
139
139
|
export declare const RETRY_TIMEOUT = 3000;
|
|
140
|
-
export declare const
|
|
140
|
+
export declare const ICE_CONNECTION_TIMEOUT = 20000;
|
|
141
|
+
export declare const DTLS_CONNECTION_TIMEOUT = 7000;
|
|
141
142
|
export declare const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
|
|
142
143
|
export declare const WEBINAR_ERROR_WEBCAST: number[];
|
|
143
144
|
export declare const WEBINAR_ERROR_REGISTRATION_ID: number[];
|
|
@@ -4,96 +4,104 @@ export interface MediaConnectionAwaiterProps {
|
|
|
4
4
|
}
|
|
5
5
|
export interface FailureResult {
|
|
6
6
|
iceConnected: boolean;
|
|
7
|
+
iceConnectedAtLeastOnce: boolean;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Waits for ICE and DTLS connectivity using explicit lifecycle states.
|
|
10
11
|
*/
|
|
11
12
|
export default class MediaConnectionAwaiter {
|
|
12
|
-
private
|
|
13
|
-
private
|
|
13
|
+
private props;
|
|
14
|
+
private state;
|
|
15
|
+
private timer?;
|
|
16
|
+
private iceConnectedAtLeastOnce;
|
|
14
17
|
private defer;
|
|
15
|
-
private retried;
|
|
16
|
-
private iceConnected;
|
|
17
|
-
private correlationId;
|
|
18
|
-
private onTimeoutCallback;
|
|
19
|
-
private peerConnectionStateCallback;
|
|
20
|
-
private iceConnectionStateCallback;
|
|
21
|
-
private iceGatheringStateCallback;
|
|
22
18
|
/**
|
|
23
|
-
* @param {MediaConnectionAwaiterProps}
|
|
19
|
+
* @param {MediaConnectionAwaiterProps} props
|
|
24
20
|
*/
|
|
25
|
-
constructor(
|
|
21
|
+
constructor(props: MediaConnectionAwaiterProps);
|
|
26
22
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @returns {boolean}
|
|
23
|
+
* Registers listeners and starts the wait once, settling terminal connections immediately.
|
|
24
|
+
* @returns {Promise<void>} Rejects with FailureResult on failure
|
|
30
25
|
*/
|
|
31
|
-
|
|
26
|
+
waitForMediaConnectionConnected(): Promise<void>;
|
|
32
27
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
28
|
+
* Applies a transition to a new state and owns its deadline or terminal settlement.
|
|
29
|
+
* @param {EnteredState} next - State to enter; an active wait cannot return to idle
|
|
30
|
+
* @param {string} reason - Trigger or reason for the transition
|
|
31
|
+
* @returns {void}
|
|
36
32
|
*/
|
|
37
|
-
private
|
|
33
|
+
private enter;
|
|
38
34
|
/**
|
|
39
|
-
* Returns
|
|
40
|
-
*
|
|
35
|
+
* Returns whether the promise has settled.
|
|
41
36
|
* @returns {boolean}
|
|
42
37
|
*/
|
|
43
|
-
private
|
|
38
|
+
private isTerminal;
|
|
44
39
|
/**
|
|
45
|
-
* Returns
|
|
46
|
-
*
|
|
47
|
-
* @returns {boolean}
|
|
40
|
+
* Returns the current state only if it owns a connection deadline.
|
|
41
|
+
* @returns {ActiveState | undefined}
|
|
48
42
|
*/
|
|
49
|
-
private
|
|
43
|
+
private getActiveState;
|
|
44
|
+
/**
|
|
45
|
+
* Logs current browser state and transitions when connectivity or phase changes.
|
|
46
|
+
* @param {string} trigger - Callback or operation that triggered evaluation
|
|
47
|
+
* @returns {boolean} Whether a state transition occurred
|
|
48
|
+
*/
|
|
49
|
+
private evaluate;
|
|
50
|
+
/**
|
|
51
|
+
* Listener for peer connection state changes.
|
|
52
|
+
* @returns {void}
|
|
53
|
+
*/
|
|
54
|
+
peerConnectionStateHandler: () => void;
|
|
50
55
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
56
|
+
* Listener for ICE connection state changes.
|
|
53
57
|
* @returns {void}
|
|
54
58
|
*/
|
|
55
|
-
|
|
59
|
+
iceConnectionStateHandler: () => void;
|
|
56
60
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
61
|
+
* Restarts only an unchanged ICE phase when gathering completes.
|
|
59
62
|
* @returns {void}
|
|
60
63
|
*/
|
|
61
|
-
|
|
64
|
+
iceGatheringStateHandler: () => void;
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
66
|
+
* Rechecks connectivity before applying the deadline or the ICE gathering retry.
|
|
65
67
|
* @returns {void}
|
|
66
68
|
*/
|
|
67
|
-
|
|
69
|
+
onTimeout: () => void;
|
|
68
70
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
+
* Arms an active phase's deadline and logs every start or restart.
|
|
72
|
+
* @param {ActiveState} state - Active state whose deadline is being started
|
|
73
|
+
* @param {string} reason - Why the deadline is being started or restarted
|
|
71
74
|
* @returns {void}
|
|
72
75
|
*/
|
|
73
|
-
|
|
76
|
+
private armTimer;
|
|
74
77
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
78
|
+
* Releases the deadline and registered listeners on either terminal transition.
|
|
77
79
|
* @returns {void}
|
|
78
80
|
*/
|
|
79
|
-
|
|
81
|
+
private teardown;
|
|
80
82
|
/**
|
|
81
|
-
*
|
|
82
|
-
* issues where browser doesn't update the RTCPeerConnection's iceConnectionState or connectionState
|
|
83
|
-
*
|
|
83
|
+
* Registers each callback once with a stable function reference.
|
|
84
84
|
* @returns {void}
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
private registerCallbacks;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
88
|
+
* Removes callbacks when the wait reaches a terminal state.
|
|
90
89
|
* @returns {void}
|
|
91
90
|
*/
|
|
92
|
-
|
|
91
|
+
private unregisterCallbacks;
|
|
93
92
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @returns {Promise<void>} In case of failure, the promise is rejected with FailureResult
|
|
93
|
+
* Returns whether ICE gathering has completed.
|
|
94
|
+
* @returns {boolean}
|
|
97
95
|
*/
|
|
98
|
-
|
|
96
|
+
private isIceGatheringCompleted;
|
|
97
|
+
/**
|
|
98
|
+
* Captures current and historical ICE connectivity for failures and metrics.
|
|
99
|
+
* @returns {FailureResult}
|
|
100
|
+
*/
|
|
101
|
+
private getConnectivity;
|
|
102
|
+
/**
|
|
103
|
+
* Sends connectivity diagnostics when a deadline expires.
|
|
104
|
+
* @returns {Promise<void>}
|
|
105
|
+
*/
|
|
106
|
+
private sendMetric;
|
|
99
107
|
}
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -161,6 +161,7 @@ class AddMediaFailed extends WebexMeetingsError {
|
|
|
161
161
|
selectedCandidatePairChanges?: number;
|
|
162
162
|
numTransports?: number;
|
|
163
163
|
iceConnected?: boolean;
|
|
164
|
+
iceConnectedAtLeastOnce?: boolean;
|
|
164
165
|
|
|
165
166
|
/**
|
|
166
167
|
* Creates a new AddMediaFailed error
|
|
@@ -169,7 +170,8 @@ class AddMediaFailed extends WebexMeetingsError {
|
|
|
169
170
|
* @param {string} [options.connectionType] - The ICE connection type at the time of failure (e.g. 'UDP', 'TURN-TLS')
|
|
170
171
|
* @param {number} [options.selectedCandidatePairChanges] - Number of times the selected candidate pair changed
|
|
171
172
|
* @param {number} [options.numTransports] - Number of ICE transports
|
|
172
|
-
* @param {boolean} [options.iceConnected] - Whether ICE
|
|
173
|
+
* @param {boolean} [options.iceConnected] - Whether ICE is connected at the time of failure
|
|
174
|
+
* @param {boolean} [options.iceConnectedAtLeastOnce] - Whether ICE connected at least once before failure
|
|
173
175
|
*/
|
|
174
176
|
constructor(
|
|
175
177
|
options: {
|
|
@@ -178,6 +180,7 @@ class AddMediaFailed extends WebexMeetingsError {
|
|
|
178
180
|
selectedCandidatePairChanges?: number;
|
|
179
181
|
numTransports?: number;
|
|
180
182
|
iceConnected?: boolean;
|
|
183
|
+
iceConnectedAtLeastOnce?: boolean;
|
|
181
184
|
} = {}
|
|
182
185
|
) {
|
|
183
186
|
super(AddMediaFailed.CODE, 'Failed to add media');
|
|
@@ -186,11 +189,12 @@ class AddMediaFailed extends WebexMeetingsError {
|
|
|
186
189
|
this.selectedCandidatePairChanges = options.selectedCandidatePairChanges;
|
|
187
190
|
this.numTransports = options.numTransports;
|
|
188
191
|
this.iceConnected = options.iceConnected;
|
|
192
|
+
this.iceConnectedAtLeastOnce = options.iceConnectedAtLeastOnce;
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
/**
|
|
192
196
|
* Returns true if the failure was due to a DTLS handshake failure
|
|
193
|
-
* (ICE connected
|
|
197
|
+
* (ICE is still connected but the overall media connection failed).
|
|
194
198
|
*/
|
|
195
199
|
get isDtlsHandshakeFailure(): boolean {
|
|
196
200
|
return this.iceConnected === true;
|
|
@@ -205,6 +209,7 @@ WebExMeetingsErrors[AddMediaFailed.CODE] = AddMediaFailed;
|
|
|
205
209
|
*/
|
|
206
210
|
class MediaConnectionTimedOutError extends Error {
|
|
207
211
|
iceConnected: boolean;
|
|
212
|
+
iceConnectedAtLeastOnce?: boolean;
|
|
208
213
|
|
|
209
214
|
cause?: any;
|
|
210
215
|
|
|
@@ -212,6 +217,7 @@ class MediaConnectionTimedOutError extends Error {
|
|
|
212
217
|
super(message);
|
|
213
218
|
this.name = 'MediaConnectionTimedOutError';
|
|
214
219
|
this.iceConnected = iceConnected;
|
|
220
|
+
this.iceConnectedAtLeastOnce = cause?.iceConnectedAtLeastOnce;
|
|
215
221
|
this.cause = cause;
|
|
216
222
|
}
|
|
217
223
|
}
|
package/src/constants.ts
CHANGED
|
@@ -201,7 +201,8 @@ export const ICE_FAIL_TIMEOUT = 3000;
|
|
|
201
201
|
|
|
202
202
|
export const RETRY_TIMEOUT = 3000;
|
|
203
203
|
|
|
204
|
-
export const
|
|
204
|
+
export const ICE_CONNECTION_TIMEOUT = 20000;
|
|
205
|
+
export const DTLS_CONNECTION_TIMEOUT = 7000;
|
|
205
206
|
export const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
|
|
206
207
|
export const WEBINAR_ERROR_WEBCAST = [403026];
|
|
207
208
|
export const WEBINAR_ERROR_REGISTRATION_ID = [403037, 403137];
|