@webex/plugin-meetings 3.0.0 → 3.1.0
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 +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +5 -4
- package/dist/constants.js +8 -4
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +16 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/mediaSharesUtils.js +15 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +5 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.d.ts +61 -0
- package/dist/media/MediaConnectionAwaiter.js +163 -0
- package/dist/media/MediaConnectionAwaiter.js.map +1 -0
- package/dist/media/index.js +4 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +4 -24
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/index.d.ts +26 -7
- package/dist/meeting/index.js +893 -677
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.d.ts +2 -8
- package/dist/meeting/muteState.js +37 -25
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.d.ts +3 -0
- package/dist/meeting/request.js +32 -23
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +1 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +4 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.d.ts +8 -0
- package/dist/meetings/index.js +20 -0
- package/dist/meetings/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.d.ts +2 -1
- package/dist/multistream/mediaRequestManager.js +1 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.d.ts +2 -0
- package/dist/multistream/remoteMediaGroup.js +16 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.d.ts +15 -0
- package/dist/multistream/remoteMediaManager.js +179 -65
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.d.ts +9 -1
- package/dist/multistream/sendSlotManager.js +22 -0
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.d.ts +1 -0
- package/dist/reachability/clusterReachability.js +29 -15
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.d.ts +4 -0
- package/dist/reachability/index.js +18 -2
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +12 -10
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.d.ts +7 -0
- package/dist/reachability/util.js +19 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.d.ts +10 -2
- package/dist/roap/index.js +15 -0
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +3 -3
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.d.ts +64 -17
- package/dist/roap/turnDiscovery.js +307 -126
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/index.js +53 -30
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +22 -22
- package/src/config.ts +1 -0
- package/src/constants.ts +7 -3
- package/src/index.ts +1 -0
- package/src/interpretation/index.ts +18 -1
- package/src/locus-info/mediaSharesUtils.ts +16 -0
- package/src/locus-info/selfUtils.ts +5 -0
- package/src/media/MediaConnectionAwaiter.ts +174 -0
- package/src/media/index.ts +3 -1
- package/src/media/properties.ts +6 -31
- package/src/meeting/index.ts +321 -106
- package/src/meeting/muteState.ts +34 -20
- package/src/meeting/request.ts +18 -2
- package/src/meeting/util.ts +1 -0
- package/src/meeting-info/utilv2.ts +2 -1
- package/src/meetings/index.ts +18 -0
- package/src/multistream/mediaRequestManager.ts +4 -1
- package/src/multistream/remoteMediaGroup.ts +19 -0
- package/src/multistream/remoteMediaManager.ts +101 -16
- package/src/multistream/sendSlotManager.ts +28 -0
- package/src/reachability/clusterReachability.ts +20 -5
- package/src/reachability/index.ts +24 -1
- package/src/reachability/request.ts +15 -11
- package/src/reachability/util.ts +21 -0
- package/src/reconnection-manager/index.ts +1 -1
- package/src/roap/index.ts +25 -3
- package/src/roap/request.ts +3 -3
- package/src/roap/turnDiscovery.ts +244 -78
- package/src/statsAnalyzer/index.ts +63 -27
- package/test/integration/spec/journey.js +14 -14
- package/test/integration/spec/space-meeting.js +1 -1
- package/test/unit/spec/interpretation/index.ts +39 -3
- package/test/unit/spec/locus-info/index.js +28 -19
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +9 -0
- package/test/unit/spec/locus-info/selfUtils.js +42 -12
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +344 -0
- package/test/unit/spec/media/index.ts +89 -78
- package/test/unit/spec/media/properties.ts +16 -70
- package/test/unit/spec/meeting/index.js +638 -139
- package/test/unit/spec/meeting/muteState.js +219 -67
- package/test/unit/spec/meeting/request.js +21 -0
- package/test/unit/spec/meeting/utils.js +6 -1
- package/test/unit/spec/meeting-info/utilv2.js +6 -0
- package/test/unit/spec/meetings/index.js +40 -20
- package/test/unit/spec/multistream/mediaRequestManager.ts +20 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +79 -1
- package/test/unit/spec/multistream/remoteMediaManager.ts +199 -1
- package/test/unit/spec/multistream/sendSlotManager.ts +50 -18
- package/test/unit/spec/reachability/clusterReachability.ts +86 -22
- package/test/unit/spec/reachability/index.ts +197 -60
- package/test/unit/spec/reachability/request.js +15 -7
- package/test/unit/spec/reachability/util.ts +32 -2
- package/test/unit/spec/reconnection-manager/index.js +28 -0
- package/test/unit/spec/roap/index.ts +61 -6
- package/test/unit/spec/roap/turnDiscovery.ts +298 -16
- package/test/unit/spec/stats-analyzer/index.js +179 -0
- package/dist/member/member.types.d.ts +0 -11
- package/dist/member/member.types.js +0 -17
- package/dist/member/member.types.js.map +0 -1
- package/src/member/member.types.ts +0 -13
- /package/test/unit/spec/locus-info/{lib/selfConstant.js → selfConstant.js} +0 -0
|
@@ -72,7 +72,7 @@ export declare class MuteState {
|
|
|
72
72
|
* @param {Boolean} [mute] true for muting, false for unmuting request
|
|
73
73
|
* @returns {void}
|
|
74
74
|
*/
|
|
75
|
-
handleLocalStreamMuteStateChange(meeting?:
|
|
75
|
+
handleLocalStreamMuteStateChange(meeting?: any): void;
|
|
76
76
|
/**
|
|
77
77
|
* Applies the current mute state to the local stream (by enabling or disabling it accordingly)
|
|
78
78
|
*
|
|
@@ -116,12 +116,6 @@ export declare class MuteState {
|
|
|
116
116
|
* @returns {Promise}
|
|
117
117
|
*/
|
|
118
118
|
private sendRemoteMuteRequestToServer;
|
|
119
|
-
/** Sets the mute state of the local stream according to what server thinks is our state
|
|
120
|
-
* @param {Object} meeting - the meeting object
|
|
121
|
-
* @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local stream
|
|
122
|
-
* @returns {void}
|
|
123
|
-
*/
|
|
124
|
-
private applyServerMuteToLocalStream;
|
|
125
119
|
/** Applies the current value for unmute allowed to the underlying stream
|
|
126
120
|
*
|
|
127
121
|
* @param {Meeting} meeting
|
|
@@ -147,7 +141,7 @@ export declare class MuteState {
|
|
|
147
141
|
* @param {Object} [meeting] the meeting object
|
|
148
142
|
* @returns {undefined}
|
|
149
143
|
*/
|
|
150
|
-
handleServerLocalUnmuteRequired(meeting?:
|
|
144
|
+
handleServerLocalUnmuteRequired(meeting?: any): void;
|
|
151
145
|
/**
|
|
152
146
|
* Returns true if the user is locally or remotely muted.
|
|
153
147
|
* It only checks the mute status, ignoring the fact whether audio/video is enabled.
|
|
@@ -153,12 +153,28 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
|
153
153
|
*/
|
|
154
154
|
}, {
|
|
155
155
|
key: "handleLocalStreamMuteStateChange",
|
|
156
|
-
value: function handleLocalStreamMuteStateChange(meeting
|
|
156
|
+
value: function handleLocalStreamMuteStateChange(meeting) {
|
|
157
157
|
if (this.ignoreMuteStateChange) {
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
|
|
161
|
+
// either user or system may have triggered a mute state change, but localMute should reflect both
|
|
162
|
+
var newMuteState;
|
|
163
|
+
var userMuteState;
|
|
164
|
+
var systemMuteState;
|
|
165
|
+
if (this.type === _constants.AUDIO) {
|
|
166
|
+
var _meeting$mediaPropert5, _meeting$mediaPropert6, _meeting$mediaPropert7;
|
|
167
|
+
newMuteState = (_meeting$mediaPropert5 = meeting.mediaProperties.audioStream) === null || _meeting$mediaPropert5 === void 0 ? void 0 : _meeting$mediaPropert5.muted;
|
|
168
|
+
userMuteState = (_meeting$mediaPropert6 = meeting.mediaProperties.audioStream) === null || _meeting$mediaPropert6 === void 0 ? void 0 : _meeting$mediaPropert6.userMuted;
|
|
169
|
+
systemMuteState = (_meeting$mediaPropert7 = meeting.mediaProperties.audioStream) === null || _meeting$mediaPropert7 === void 0 ? void 0 : _meeting$mediaPropert7.systemMuted;
|
|
170
|
+
} else {
|
|
171
|
+
var _meeting$mediaPropert8, _meeting$mediaPropert9, _meeting$mediaPropert10;
|
|
172
|
+
newMuteState = (_meeting$mediaPropert8 = meeting.mediaProperties.videoStream) === null || _meeting$mediaPropert8 === void 0 ? void 0 : _meeting$mediaPropert8.muted;
|
|
173
|
+
userMuteState = (_meeting$mediaPropert9 = meeting.mediaProperties.videoStream) === null || _meeting$mediaPropert9 === void 0 ? void 0 : _meeting$mediaPropert9.userMuted;
|
|
174
|
+
systemMuteState = (_meeting$mediaPropert10 = meeting.mediaProperties.videoStream) === null || _meeting$mediaPropert10 === void 0 ? void 0 : _meeting$mediaPropert10.systemMuted;
|
|
175
|
+
}
|
|
176
|
+
_loggerProxy.default.logger.info("Meeting:muteState#handleLocalStreamMuteStateChange --> ".concat(this.type, ": local stream new mute state: ").concat(newMuteState, " (user mute: ").concat(userMuteState, ", system mute: ").concat(systemMuteState, ")"));
|
|
177
|
+
this.state.client.localMute = newMuteState;
|
|
162
178
|
this.applyClientStateToServer(meeting);
|
|
163
179
|
}
|
|
164
180
|
|
|
@@ -231,7 +247,9 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
|
231
247
|
}).catch(function (e) {
|
|
232
248
|
_this.state.syncToServerInProgress = false;
|
|
233
249
|
_loggerProxy.default.logger.warn("Meeting:muteState#applyClientStateToServer --> ".concat(_this.type, ": error: ").concat(e));
|
|
234
|
-
|
|
250
|
+
|
|
251
|
+
// failed to apply client state to server, so revert stream mute state to server state
|
|
252
|
+
_this.muteLocalStream(meeting, _this.state.server.localMute || _this.state.server.remoteMute, 'clientRequestFailed');
|
|
235
253
|
});
|
|
236
254
|
}
|
|
237
255
|
|
|
@@ -286,20 +304,6 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
|
286
304
|
});
|
|
287
305
|
}
|
|
288
306
|
|
|
289
|
-
/** Sets the mute state of the local stream according to what server thinks is our state
|
|
290
|
-
* @param {Object} meeting - the meeting object
|
|
291
|
-
* @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local stream
|
|
292
|
-
* @returns {void}
|
|
293
|
-
*/
|
|
294
|
-
}, {
|
|
295
|
-
key: "applyServerMuteToLocalStream",
|
|
296
|
-
value: function applyServerMuteToLocalStream(meeting, serverMuteReason) {
|
|
297
|
-
var muted = this.state.server.localMute || this.state.server.remoteMute;
|
|
298
|
-
|
|
299
|
-
// update the local stream mute state, but not this.state.client.localMute
|
|
300
|
-
this.muteLocalStream(meeting, muted, serverMuteReason);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
307
|
/** Applies the current value for unmute allowed to the underlying stream
|
|
304
308
|
*
|
|
305
309
|
* @param {Meeting} meeting
|
|
@@ -310,11 +314,11 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
|
310
314
|
key: "applyUnmuteAllowedToStream",
|
|
311
315
|
value: function applyUnmuteAllowedToStream(meeting) {
|
|
312
316
|
if (this.type === _constants.AUDIO) {
|
|
313
|
-
var _meeting$
|
|
314
|
-
(_meeting$
|
|
317
|
+
var _meeting$mediaPropert11;
|
|
318
|
+
(_meeting$mediaPropert11 = meeting.mediaProperties.audioStream) === null || _meeting$mediaPropert11 === void 0 ? void 0 : _meeting$mediaPropert11.setUnmuteAllowed(this.state.server.unmuteAllowed);
|
|
315
319
|
} else {
|
|
316
|
-
var _meeting$
|
|
317
|
-
(_meeting$
|
|
320
|
+
var _meeting$mediaPropert12;
|
|
321
|
+
(_meeting$mediaPropert12 = meeting.mediaProperties.videoStream) === null || _meeting$mediaPropert12 === void 0 ? void 0 : _meeting$mediaPropert12.setUnmuteAllowed(this.state.server.unmuteAllowed);
|
|
318
322
|
}
|
|
319
323
|
}
|
|
320
324
|
|
|
@@ -338,7 +342,7 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
|
338
342
|
}
|
|
339
343
|
if (muted !== undefined) {
|
|
340
344
|
this.state.server.remoteMute = muted;
|
|
341
|
-
this.
|
|
345
|
+
this.muteLocalStream(meeting, muted, 'remotelyMuted');
|
|
342
346
|
}
|
|
343
347
|
}
|
|
344
348
|
|
|
@@ -361,8 +365,16 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
|
361
365
|
|
|
362
366
|
// todo: I'm seeing "you can now unmute yourself " popup when this happens - but same thing happens on web.w.c so we can ignore for now
|
|
363
367
|
this.state.server.remoteMute = false;
|
|
364
|
-
|
|
365
|
-
|
|
368
|
+
|
|
369
|
+
// change user mute state to false, but keep localMute true if overall mute state is still true
|
|
370
|
+
this.muteLocalStream(meeting, false, 'localUnmuteRequired');
|
|
371
|
+
if (this.type === _constants.AUDIO) {
|
|
372
|
+
var _meeting$mediaPropert13;
|
|
373
|
+
this.state.client.localMute = (_meeting$mediaPropert13 = meeting.mediaProperties.audioStream) === null || _meeting$mediaPropert13 === void 0 ? void 0 : _meeting$mediaPropert13.muted;
|
|
374
|
+
} else {
|
|
375
|
+
var _meeting$mediaPropert14;
|
|
376
|
+
this.state.client.localMute = (_meeting$mediaPropert14 = meeting.mediaProperties.videoStream) === null || _meeting$mediaPropert14 === void 0 ? void 0 : _meeting$mediaPropert14.muted;
|
|
377
|
+
}
|
|
366
378
|
this.applyClientStateToServer(meeting);
|
|
367
379
|
}
|
|
368
380
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_parameter","_util","_constants","createMuteState","exports","type","meeting","enabled","LoggerProxy","logger","info","concat","id","muteState","MuteState","_meeting$remoteVideoM","_meeting$unmuteVideoA","_classCallCheck2","default","_defineProperty2","AUDIO","VIDEO","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","_createClass2","key","value","init","_meeting$mediaPropert","_meeting$mediaPropert2","applyUnmuteAllowedToStream","muteLocalStream","initialMute","mediaProperties","audioStream","muted","videoStream","undefined","applyClientStateToServer","handleLocalStreamChange","enable","mute","reason","_meeting$mediaPropert3","setServerMuted","_meeting$mediaPropert4","handleLocalStreamMuteStateChange","applyClientStateLocally","getClientLocalMuteState","_this","localMuteState","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","_promise","resolve","then","sendRemoteMuteRequestToServer","catch","e","warn","applyServerMuteToLocalStream","_this2","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","handleLocusDelta","remoteUpdateError","reject","_this3","members","muteMember","selfId","serverMuteReason","_meeting$mediaPropert5","setUnmuteAllowed","_meeting$mediaPropert6","handleServerRemoteMuteUpdate","handleServerLocalUnmuteRequired","isMuted","isRemotelyMuted","isUnmuteAllowed","isLocallyMuted"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, enabled: boolean) => {\n // todo: remove the meeting argument (SPARK-399695)\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, enabled);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n state: {\n client: {\n enabled: boolean; // indicates if audio/video is enabled at all or not\n localMute: boolean;\n };\n server: {localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean};\n syncToServerInProgress: boolean;\n };\n\n type: any;\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} enabled - whether the client audio/video is enabled at all\n */\n constructor(type: string, meeting: any, enabled: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n enabled,\n localMute: true,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n this.applyUnmuteAllowedToStream(meeting);\n\n // if we are remotely muted, we need to apply that to the local stream now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalStream(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioStream?.muted\n : meeting.mediaProperties.videoStream?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local stream initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n } else {\n // there is no stream, so it's like we are locally muted\n // (this is important especially for transcoded meetings, in which the SDP m-line direction always stays \"sendrecv\")\n this.state.client.localMute = true;\n }\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * This method needs to be called whenever the local audio/video stream has changed.\n * It reapplies the remote mute state onto the new stream and also reads the current\n * local mute state from the stream and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalStreamChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Enables/disables audio/video\n *\n * @param {Object} meeting - the meeting object\n * @param {boolean} enable\n * @returns {void}\n */\n public enable(meeting: any, enable: boolean) {\n this.state.client.enabled = enable;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Mutes/unmutes local stream\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the stream, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalStream(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoStream?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * This method should be called when the local stream mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalStreamMuteStateChange(meeting?: object, mute?: boolean) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalStreamMuteStateChange --> ${this.type}: local stream new mute state: ${mute}`\n );\n\n this.state.client.localMute = mute;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local stream (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n this.muteLocalStream(meeting, this.state.client.localMute, reason);\n }\n\n /** Returns true if client is locally muted - it takes into account not just the client local mute state,\n * but also whether audio/video is enabled at all\n *\n * @returns {boolean}\n */\n private getClientLocalMuteState() {\n return this.state.client.enabled ? this.state.client.localMute : true;\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: any) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteState = this.getClientLocalMuteState();\n const localMuteRequiresSync = localMuteState !== this.state.server.localMute;\n const remoteMuteRequiresSync = !localMuteState && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${localMuteState} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n LoggerProxy.logger.warn(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: error: ${e}`\n );\n\n this.applyServerMuteToLocalStream(meeting, 'clientRequestFailed');\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.getClientLocalMuteState() : undefined;\n const videoMuted = this.type === VIDEO ? this.getClientLocalMuteState() : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.handleLocusDelta(locus, meeting);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.getClientLocalMuteState();\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Sets the mute state of the local stream according to what server thinks is our state\n * @param {Object} meeting - the meeting object\n * @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local stream\n * @returns {void}\n */\n private applyServerMuteToLocalStream(meeting: any, serverMuteReason: ServerMuteReason) {\n const muted = this.state.server.localMute || this.state.server.remoteMute;\n\n // update the local stream mute state, but not this.state.client.localMute\n this.muteLocalStream(meeting, muted, serverMuteReason);\n }\n\n /** Applies the current value for unmute allowed to the underlying stream\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private applyUnmuteAllowedToStream(meeting: any) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToStream(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.applyServerMuteToLocalStream(meeting, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n if (!this.state.client.enabled) {\n LoggerProxy.logger.warn(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received while ${this.type} is disabled -> local unmute will not result in ${this.type} being sent`\n );\n } else {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n }\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n this.applyClientStateLocally(meeting, 'localUnmuteRequired');\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted.\n * It only checks the mute status, ignoring the fact whether audio/video is enabled.\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted or audio/video is disabled\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.getClientLocalMuteState();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA;AACO,IAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAIE,IAAI,EAAEC,OAAO,EAAEC,OAAgB,EAAK;EAClE;;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,0CAAAC,MAAA,CACoBN,IAAI,0CAAAM,MAAA,CAAuCL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,EAAE,CACjG,CAAC;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACT,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAAC;EAEvD,OAAOM,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOaC,SAAS,GAAAV,OAAA,CAAAU,SAAA;EAapB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,SAAAA,UAAYT,IAAY,EAAEC,OAAY,EAAEC,OAAgB,EAAE;IAAA,IAAAQ,qBAAA,EAAAC,qBAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,SAAA;IAAA,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AC;MACH,CAAC,MAAM;QACLG,oBAAW,CAACC,MAAM,CAACC,IAAI,0DAAAC,MAAA,CACoC,IAAI,CAACN,IAAI,8DACpE,CAAC;MACH;;MAEA;MACA,IAAI,CAACmB,KAAK,CAACG,MAAM,CAACC,UAAU,GAAG,KAAK;MACpC,IAAI,CAACJ,KAAK,CAACC,MAAM,CAACC,SAAS,GAAG,KAAK;MAEnC,IAAI,CAAC+B,uBAAuB,CAACnD,OAAO,EAAE,qBAAqB,CAAC;MAC5D,IAAI,CAAC0C,wBAAwB,CAAC1C,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA6B,GAAA;IAAAC,KAAA,EAQA,SAAAyD,QAAA,EAAiB;MACf,OACE,IAAI,CAACrE,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAA0D,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACtE,KAAK,CAACG,MAAM,CAACC,UAAU;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAA2D,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACvE,KAAK,CAACG,MAAM,CAACI,aAAa;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAI,GAAA;IAAAC,KAAA,EAOA,SAAA4D,eAAA,EAAwB;MACtB,OAAO,IAAI,CAACtC,uBAAuB,CAAC,CAAC;IACvC;EAAC;EAAA,OAAA5C,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_parameter","_util","_constants","createMuteState","exports","type","meeting","enabled","LoggerProxy","logger","info","concat","id","muteState","MuteState","_meeting$remoteVideoM","_meeting$unmuteVideoA","_classCallCheck2","default","_defineProperty2","AUDIO","VIDEO","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","_createClass2","key","value","init","_meeting$mediaPropert","_meeting$mediaPropert2","applyUnmuteAllowedToStream","muteLocalStream","initialMute","mediaProperties","audioStream","muted","videoStream","undefined","applyClientStateToServer","handleLocalStreamChange","enable","mute","reason","_meeting$mediaPropert3","setServerMuted","_meeting$mediaPropert4","handleLocalStreamMuteStateChange","newMuteState","userMuteState","systemMuteState","_meeting$mediaPropert5","_meeting$mediaPropert6","_meeting$mediaPropert7","userMuted","systemMuted","_meeting$mediaPropert8","_meeting$mediaPropert9","_meeting$mediaPropert10","applyClientStateLocally","getClientLocalMuteState","_this","localMuteState","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","_promise","resolve","then","sendRemoteMuteRequestToServer","catch","e","warn","_this2","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","handleLocusDelta","remoteUpdateError","reject","_this3","members","muteMember","selfId","_meeting$mediaPropert11","setUnmuteAllowed","_meeting$mediaPropert12","handleServerRemoteMuteUpdate","handleServerLocalUnmuteRequired","_meeting$mediaPropert13","_meeting$mediaPropert14","isMuted","isRemotelyMuted","isUnmuteAllowed","isLocallyMuted"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, enabled: boolean) => {\n // todo: remove the meeting argument (SPARK-399695)\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, enabled);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n state: {\n client: {\n enabled: boolean; // indicates if audio/video is enabled at all or not\n localMute: boolean;\n };\n server: {localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean};\n syncToServerInProgress: boolean;\n };\n\n type: any;\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} enabled - whether the client audio/video is enabled at all\n */\n constructor(type: string, meeting: any, enabled: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n enabled,\n localMute: true,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n this.applyUnmuteAllowedToStream(meeting);\n\n // if we are remotely muted, we need to apply that to the local stream now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalStream(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioStream?.muted\n : meeting.mediaProperties.videoStream?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local stream initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n } else {\n // there is no stream, so it's like we are locally muted\n // (this is important especially for transcoded meetings, in which the SDP m-line direction always stays \"sendrecv\")\n this.state.client.localMute = true;\n }\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * This method needs to be called whenever the local audio/video stream has changed.\n * It reapplies the remote mute state onto the new stream and also reads the current\n * local mute state from the stream and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalStreamChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Enables/disables audio/video\n *\n * @param {Object} meeting - the meeting object\n * @param {boolean} enable\n * @returns {void}\n */\n public enable(meeting: any, enable: boolean) {\n this.state.client.enabled = enable;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Mutes/unmutes local stream\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the stream, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalStream(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoStream?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * This method should be called when the local stream mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalStreamMuteStateChange(meeting?: any) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n\n // either user or system may have triggered a mute state change, but localMute should reflect both\n let newMuteState: boolean;\n let userMuteState: boolean;\n let systemMuteState: boolean;\n if (this.type === AUDIO) {\n newMuteState = meeting.mediaProperties.audioStream?.muted;\n userMuteState = meeting.mediaProperties.audioStream?.userMuted;\n systemMuteState = meeting.mediaProperties.audioStream?.systemMuted;\n } else {\n newMuteState = meeting.mediaProperties.videoStream?.muted;\n userMuteState = meeting.mediaProperties.videoStream?.userMuted;\n systemMuteState = meeting.mediaProperties.videoStream?.systemMuted;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalStreamMuteStateChange --> ${this.type}: local stream new mute state: ${newMuteState} (user mute: ${userMuteState}, system mute: ${systemMuteState})`\n );\n\n this.state.client.localMute = newMuteState;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local stream (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n this.muteLocalStream(meeting, this.state.client.localMute, reason);\n }\n\n /** Returns true if client is locally muted - it takes into account not just the client local mute state,\n * but also whether audio/video is enabled at all\n *\n * @returns {boolean}\n */\n private getClientLocalMuteState() {\n return this.state.client.enabled ? this.state.client.localMute : true;\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: any) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteState = this.getClientLocalMuteState();\n const localMuteRequiresSync = localMuteState !== this.state.server.localMute;\n const remoteMuteRequiresSync = !localMuteState && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${localMuteState} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n LoggerProxy.logger.warn(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: error: ${e}`\n );\n\n // failed to apply client state to server, so revert stream mute state to server state\n this.muteLocalStream(\n meeting,\n this.state.server.localMute || this.state.server.remoteMute,\n 'clientRequestFailed'\n );\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.getClientLocalMuteState() : undefined;\n const videoMuted = this.type === VIDEO ? this.getClientLocalMuteState() : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.handleLocusDelta(locus, meeting);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.getClientLocalMuteState();\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Applies the current value for unmute allowed to the underlying stream\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private applyUnmuteAllowedToStream(meeting: any) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToStream(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.muteLocalStream(meeting, muted, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: any) {\n if (!this.state.client.enabled) {\n LoggerProxy.logger.warn(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received while ${this.type} is disabled -> local unmute will not result in ${this.type} being sent`\n );\n } else {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n }\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n\n // change user mute state to false, but keep localMute true if overall mute state is still true\n this.muteLocalStream(meeting, false, 'localUnmuteRequired');\n if (this.type === AUDIO) {\n this.state.client.localMute = meeting.mediaProperties.audioStream?.muted;\n } else {\n this.state.client.localMute = meeting.mediaProperties.videoStream?.muted;\n }\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted.\n * It only checks the mute status, ignoring the fact whether audio/video is enabled.\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted or audio/video is disabled\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.getClientLocalMuteState();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA;AACO,IAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAIE,IAAI,EAAEC,OAAO,EAAEC,OAAgB,EAAK;EAClE;;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,0CAAAC,MAAA,CACoBN,IAAI,0CAAAM,MAAA,CAAuCL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,EAAE,CACjG,CAAC;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACT,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAAC;EAEvD,OAAOM,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOaC,SAAS,GAAAV,OAAA,CAAAU,SAAA;EAapB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,SAAAA,UAAYT,IAAY,EAAEC,OAAY,EAAEC,OAAgB,EAAE;IAAA,IAAAQ,qBAAA,EAAAC,qBAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,SAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IACxD,IAAIb,IAAI,KAAKe,gBAAK,IAA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AAS,IAAA6E,uBAAA,GAAGjG,OAAO,CAACqC,eAAe,CAACG,WAAW,cAAAyD,uBAAA,uBAAnCA,uBAAA,CAAqC1D,KAAK;MAC1E;MAEA,IAAI,CAACG,wBAAwB,CAAC1C,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA6B,GAAA;IAAAC,KAAA,EAQA,SAAAoE,QAAA,EAAiB;MACf,OACE,IAAI,CAAChF,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAAqE,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACjF,KAAK,CAACG,MAAM,CAACC,UAAU;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAAsE,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAAClF,KAAK,CAACG,MAAM,CAACI,aAAa;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAI,GAAA;IAAAC,KAAA,EAOA,SAAAuE,eAAA,EAAwB;MACtB,OAAO,IAAI,CAACtC,uBAAuB,CAAC,CAAC;IACvC;EAAC;EAAA,OAAAvD,SAAA;AAAA"}
|
|
@@ -38,6 +38,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
38
38
|
* @param {String} options.locale,
|
|
39
39
|
* @param {Array} options.deviceCapabilities
|
|
40
40
|
* @param {boolean} options.liveAnnotationSupported
|
|
41
|
+
* @param {String} options.alias
|
|
41
42
|
* @returns {Promise}
|
|
42
43
|
*/
|
|
43
44
|
joinMeeting(options: {
|
|
@@ -57,11 +58,13 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
57
58
|
meetingNumber: any;
|
|
58
59
|
permissionToken: any;
|
|
59
60
|
preferTranscoding: any;
|
|
61
|
+
reachability: any;
|
|
60
62
|
breakoutsSupported: boolean;
|
|
61
63
|
locale?: string;
|
|
62
64
|
deviceCapabilities?: Array<string>;
|
|
63
65
|
liveAnnotationSupported: boolean;
|
|
64
66
|
ipVersion?: IP_VERSION;
|
|
67
|
+
alias?: string;
|
|
65
68
|
}): Promise<any>;
|
|
66
69
|
/**
|
|
67
70
|
* Send a request to refresh the captcha
|
package/dist/meeting/request.js
CHANGED
|
@@ -12,8 +12,8 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
12
12
|
value: true
|
|
13
13
|
});
|
|
14
14
|
exports.default = void 0;
|
|
15
|
-
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
16
15
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
16
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
17
17
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
18
18
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
19
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/objectWithoutProperties"));
|
|
@@ -126,15 +126,16 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
|
|
|
126
126
|
* @param {String} options.locale,
|
|
127
127
|
* @param {Array} options.deviceCapabilities
|
|
128
128
|
* @param {boolean} options.liveAnnotationSupported
|
|
129
|
+
* @param {String} options.alias
|
|
129
130
|
* @returns {Promise}
|
|
130
131
|
*/
|
|
131
132
|
function () {
|
|
132
133
|
var _joinMeeting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
|
|
133
|
-
var asResourceOccupant, inviteeAddress, meetingNumber, permissionToken, deviceUrl, locusUrl, locusClusterUrl, resourceId, correlationId, ensureConversation, moderator, pin, moveToResource, roapMessage, preferTranscoding, breakoutsSupported, locale, _options$deviceCapabi, deviceCapabilities, liveAnnotationSupported, ipVersion, url, joinCookie, body, clusterUrl;
|
|
134
|
+
var asResourceOccupant, inviteeAddress, meetingNumber, permissionToken, deviceUrl, locusUrl, locusClusterUrl, resourceId, correlationId, ensureConversation, moderator, pin, moveToResource, roapMessage, reachability, preferTranscoding, breakoutsSupported, locale, _options$deviceCapabi, deviceCapabilities, liveAnnotationSupported, ipVersion, alias, url, joinCookie, body, clusterUrl;
|
|
134
135
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
135
136
|
while (1) switch (_context2.prev = _context2.next) {
|
|
136
137
|
case 0:
|
|
137
|
-
asResourceOccupant = options.asResourceOccupant, inviteeAddress = options.inviteeAddress, meetingNumber = options.meetingNumber, permissionToken = options.permissionToken, deviceUrl = options.deviceUrl, locusUrl = options.locusUrl, locusClusterUrl = options.locusClusterUrl, resourceId = options.resourceId, correlationId = options.correlationId, ensureConversation = options.ensureConversation, moderator = options.moderator, pin = options.pin, moveToResource = options.moveToResource, roapMessage = options.roapMessage, preferTranscoding = options.preferTranscoding, breakoutsSupported = options.breakoutsSupported, locale = options.locale, _options$deviceCapabi = options.deviceCapabilities, deviceCapabilities = _options$deviceCapabi === void 0 ? [] : _options$deviceCapabi, liveAnnotationSupported = options.liveAnnotationSupported, ipVersion = options.ipVersion;
|
|
138
|
+
asResourceOccupant = options.asResourceOccupant, inviteeAddress = options.inviteeAddress, meetingNumber = options.meetingNumber, permissionToken = options.permissionToken, deviceUrl = options.deviceUrl, locusUrl = options.locusUrl, locusClusterUrl = options.locusClusterUrl, resourceId = options.resourceId, correlationId = options.correlationId, ensureConversation = options.ensureConversation, moderator = options.moderator, pin = options.pin, moveToResource = options.moveToResource, roapMessage = options.roapMessage, reachability = options.reachability, preferTranscoding = options.preferTranscoding, breakoutsSupported = options.breakoutsSupported, locale = options.locale, _options$deviceCapabi = options.deviceCapabilities, deviceCapabilities = _options$deviceCapabi === void 0 ? [] : _options$deviceCapabi, liveAnnotationSupported = options.liveAnnotationSupported, ipVersion = options.ipVersion, alias = options.alias;
|
|
138
139
|
_loggerProxy.default.logger.info('Meeting:request#joinMeeting --> Joining a meeting', correlationId);
|
|
139
140
|
url = '';
|
|
140
141
|
_context2.next = 5;
|
|
@@ -161,6 +162,9 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
|
|
|
161
162
|
ipver: ipVersion
|
|
162
163
|
}
|
|
163
164
|
};
|
|
165
|
+
if (alias) {
|
|
166
|
+
body.alias = alias;
|
|
167
|
+
}
|
|
164
168
|
if (breakoutsSupported) {
|
|
165
169
|
deviceCapabilities.push(_constants.BREAKOUTS.BREAKOUTS_SUPPORTED);
|
|
166
170
|
}
|
|
@@ -202,44 +206,44 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
|
|
|
202
206
|
body.pin = pin;
|
|
203
207
|
}
|
|
204
208
|
if (!locusUrl) {
|
|
205
|
-
_context2.next =
|
|
209
|
+
_context2.next = 21;
|
|
206
210
|
break;
|
|
207
211
|
}
|
|
208
212
|
url = "".concat(locusUrl, "/").concat(_constants.PARTICIPANT);
|
|
209
|
-
_context2.next =
|
|
213
|
+
_context2.next = 38;
|
|
210
214
|
break;
|
|
211
|
-
case
|
|
215
|
+
case 21:
|
|
212
216
|
if (!(inviteeAddress || meetingNumber)) {
|
|
213
|
-
_context2.next =
|
|
217
|
+
_context2.next = 38;
|
|
214
218
|
break;
|
|
215
219
|
}
|
|
216
|
-
_context2.prev =
|
|
220
|
+
_context2.prev = 22;
|
|
217
221
|
if (!locusClusterUrl) {
|
|
218
|
-
_context2.next =
|
|
222
|
+
_context2.next = 27;
|
|
219
223
|
break;
|
|
220
224
|
}
|
|
221
225
|
clusterUrl = "https://".concat(locusClusterUrl, "/locus/api/v1");
|
|
222
|
-
_context2.next =
|
|
226
|
+
_context2.next = 30;
|
|
223
227
|
break;
|
|
224
|
-
case
|
|
225
|
-
_context2.next =
|
|
228
|
+
case 27:
|
|
229
|
+
_context2.next = 29;
|
|
226
230
|
return this.webex.internal.services.waitForCatalog('postauth');
|
|
227
|
-
case
|
|
231
|
+
case 29:
|
|
228
232
|
// @ts-ignore
|
|
229
233
|
clusterUrl = this.webex.internal.services.get('locus');
|
|
230
|
-
case
|
|
234
|
+
case 30:
|
|
231
235
|
url = "".concat(clusterUrl, "/").concat(_constants.LOCI, "/").concat(_constants.CALL);
|
|
232
236
|
body.invitee = {
|
|
233
237
|
address: inviteeAddress || "wbxmn:".concat(meetingNumber)
|
|
234
238
|
};
|
|
235
|
-
_context2.next =
|
|
239
|
+
_context2.next = 38;
|
|
236
240
|
break;
|
|
237
|
-
case
|
|
238
|
-
_context2.prev =
|
|
239
|
-
_context2.t0 = _context2["catch"](
|
|
241
|
+
case 34:
|
|
242
|
+
_context2.prev = 34;
|
|
243
|
+
_context2.t0 = _context2["catch"](22);
|
|
240
244
|
_loggerProxy.default.logger.error("Meeting:request#joinMeeting Error Joining ".concat(inviteeAddress || meetingNumber, " --> ").concat(_context2.t0));
|
|
241
245
|
throw _context2.t0;
|
|
242
|
-
case
|
|
246
|
+
case 38:
|
|
243
247
|
// TODO: -- this will be resolved in SDK request
|
|
244
248
|
url = url.concat("?".concat(_constants.ALTERNATE_REDIRECT_TRUE));
|
|
245
249
|
if (resourceId === inviteeAddress) {
|
|
@@ -247,8 +251,13 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
|
|
|
247
251
|
requestedMedia: [_constants._SLIDES_]
|
|
248
252
|
};
|
|
249
253
|
}
|
|
250
|
-
if (roapMessage) {
|
|
251
|
-
body.localMedias =
|
|
254
|
+
if (roapMessage || reachability) {
|
|
255
|
+
body.localMedias = [{
|
|
256
|
+
localSdp: (0, _stringify.default)({
|
|
257
|
+
roapMessage: roapMessage,
|
|
258
|
+
reachability: reachability
|
|
259
|
+
})
|
|
260
|
+
}];
|
|
252
261
|
}
|
|
253
262
|
|
|
254
263
|
/// @ts-ignore
|
|
@@ -257,11 +266,11 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
|
|
|
257
266
|
uri: url,
|
|
258
267
|
body: body
|
|
259
268
|
}));
|
|
260
|
-
case
|
|
269
|
+
case 42:
|
|
261
270
|
case "end":
|
|
262
271
|
return _context2.stop();
|
|
263
272
|
}
|
|
264
|
-
}, _callee2, this, [[
|
|
273
|
+
}, _callee2, this, [[22, 34]]);
|
|
265
274
|
}));
|
|
266
275
|
function joinMeeting(_x) {
|
|
267
276
|
return _joinMeeting.apply(this, arguments);
|