@webex/plugin-meetings 3.8.0-next.69 → 3.8.0-next.70
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/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +330 -356
- package/dist/member/util.js.map +1 -1
- package/dist/types/member/util.d.ts +159 -1
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/member/index.ts +2 -2
- package/src/member/util.ts +351 -351
package/src/member/util.ts
CHANGED
@@ -27,384 +27,384 @@ import {
|
|
27
27
|
} from '../constants';
|
28
28
|
import ParameterError from '../common/errors/parameter';
|
29
29
|
|
30
|
-
const MemberUtil
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
return participant.canReclaimHostRole || false;
|
44
|
-
};
|
45
|
-
|
46
|
-
/**
|
47
|
-
* @param {Object} participant - The locus participant object.
|
48
|
-
* @returns {[ServerRoleShape]}
|
49
|
-
*/
|
50
|
-
MemberUtil.getControlsRoles = (participant: ParticipantWithRoles): Array<ServerRoleShape> =>
|
51
|
-
participant?.controls?.role?.roles;
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Checks if the participant has the brb status enabled.
|
55
|
-
*
|
56
|
-
* @param {ParticipantWithBrb} participant - The locus participant object.
|
57
|
-
* @returns {boolean} - True if the participant has brb enabled, false otherwise.
|
58
|
-
*/
|
59
|
-
MemberUtil.isBrb = (participant: ParticipantWithBrb): boolean =>
|
60
|
-
participant.controls?.brb?.enabled || false;
|
61
|
-
|
62
|
-
/**
|
63
|
-
* @param {Object} participant - The locus participant object.
|
64
|
-
* @param {ServerRoles} controlRole the search role
|
65
|
-
* @returns {Boolean}
|
66
|
-
*/
|
67
|
-
MemberUtil.hasRole = (participant: any, controlRole: ServerRoles): boolean =>
|
68
|
-
MemberUtil.getControlsRoles(participant)?.some(
|
69
|
-
(role) => role.type === controlRole && role.hasRole
|
70
|
-
);
|
71
|
-
|
72
|
-
/**
|
73
|
-
* @param {Object} participant - The locus participant object.
|
74
|
-
* @returns {Boolean}
|
75
|
-
*/
|
76
|
-
MemberUtil.hasCohost = (participant: ParticipantWithRoles): boolean =>
|
77
|
-
MemberUtil.hasRole(participant, ServerRoles.Cohost) || false;
|
78
|
-
|
79
|
-
/**
|
80
|
-
* @param {Object} participant - The locus participant object.
|
81
|
-
* @returns {Boolean}
|
82
|
-
*/
|
83
|
-
MemberUtil.hasModerator = (participant: ParticipantWithRoles): boolean =>
|
84
|
-
MemberUtil.hasRole(participant, ServerRoles.Moderator) || false;
|
85
|
-
|
86
|
-
/**
|
87
|
-
* @param {Object} participant - The locus participant object.
|
88
|
-
* @returns {Boolean}
|
89
|
-
*/
|
90
|
-
MemberUtil.hasPresenter = (participant: ParticipantWithRoles): boolean =>
|
91
|
-
MemberUtil.hasRole(participant, ServerRoles.Presenter) || false;
|
92
|
-
|
93
|
-
/**
|
94
|
-
* @param {Object} participant - The locus participant object.
|
95
|
-
* @returns {IExternalRoles}
|
96
|
-
*/
|
97
|
-
MemberUtil.extractControlRoles = (participant: ParticipantWithRoles): IExternalRoles => {
|
98
|
-
const roles = {
|
99
|
-
cohost: MemberUtil.hasCohost(participant),
|
100
|
-
moderator: MemberUtil.hasModerator(participant),
|
101
|
-
presenter: MemberUtil.hasPresenter(participant),
|
102
|
-
};
|
103
|
-
|
104
|
-
return roles;
|
105
|
-
};
|
30
|
+
const MemberUtil = {
|
31
|
+
/**
|
32
|
+
* @param {Object} participant - The locus participant object.
|
33
|
+
* @returns {Boolean}
|
34
|
+
*/
|
35
|
+
canReclaimHost: (participant) => {
|
36
|
+
if (!participant) {
|
37
|
+
throw new ParameterError(
|
38
|
+
'canReclaimHostRole could not be processed, participant is undefined.'
|
39
|
+
);
|
40
|
+
}
|
106
41
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
MemberUtil.
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
participant
|
154
|
-
(
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
MemberUtil.
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
}
|
42
|
+
return participant.canReclaimHostRole || false;
|
43
|
+
},
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @param {Object} participant - The locus participant object.
|
47
|
+
* @returns {[ServerRoleShape]}
|
48
|
+
*/
|
49
|
+
getControlsRoles: (participant: ParticipantWithRoles): Array<ServerRoleShape> =>
|
50
|
+
participant?.controls?.role?.roles,
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Checks if the participant has the brb status enabled.
|
54
|
+
*
|
55
|
+
* @param {ParticipantWithBrb} participant - The locus participant object.
|
56
|
+
* @returns {boolean} - True if the participant has brb enabled, false otherwise.
|
57
|
+
*/
|
58
|
+
isBrb: (participant: ParticipantWithBrb): boolean => participant.controls?.brb?.enabled || false,
|
59
|
+
|
60
|
+
/**
|
61
|
+
* @param {Object} participant - The locus participant object.
|
62
|
+
* @param {ServerRoles} controlRole the search role
|
63
|
+
* @returns {Boolean}
|
64
|
+
*/
|
65
|
+
hasRole: (participant: any, controlRole: ServerRoles): boolean =>
|
66
|
+
MemberUtil.getControlsRoles(participant)?.some(
|
67
|
+
(role) => role.type === controlRole && role.hasRole
|
68
|
+
),
|
69
|
+
|
70
|
+
/**
|
71
|
+
* @param {Object} participant - The locus participant object.
|
72
|
+
* @returns {Boolean}
|
73
|
+
*/
|
74
|
+
hasCohost: (participant: ParticipantWithRoles): boolean =>
|
75
|
+
MemberUtil.hasRole(participant, ServerRoles.Cohost) || false,
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @param {Object} participant - The locus participant object.
|
79
|
+
* @returns {Boolean}
|
80
|
+
*/
|
81
|
+
hasModerator: (participant: ParticipantWithRoles): boolean =>
|
82
|
+
MemberUtil.hasRole(participant, ServerRoles.Moderator) || false,
|
83
|
+
|
84
|
+
/**
|
85
|
+
* @param {Object} participant - The locus participant object.
|
86
|
+
* @returns {Boolean}
|
87
|
+
*/
|
88
|
+
hasPresenter: (participant: ParticipantWithRoles): boolean =>
|
89
|
+
MemberUtil.hasRole(participant, ServerRoles.Presenter) || false,
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @param {Object} participant - The locus participant object.
|
93
|
+
* @returns {IExternalRoles}
|
94
|
+
*/
|
95
|
+
extractControlRoles: (participant: ParticipantWithRoles): IExternalRoles => {
|
96
|
+
const roles = {
|
97
|
+
cohost: MemberUtil.hasCohost(participant),
|
98
|
+
moderator: MemberUtil.hasModerator(participant),
|
99
|
+
presenter: MemberUtil.hasPresenter(participant),
|
100
|
+
};
|
101
|
+
|
102
|
+
return roles;
|
103
|
+
},
|
104
|
+
|
105
|
+
/**
|
106
|
+
* @param {Object} participant - The locus participant object.
|
107
|
+
* @returns {Boolean}
|
108
|
+
*/
|
109
|
+
isUser: (participant: any) => participant && participant.type === _USER_,
|
110
|
+
|
111
|
+
isModerator: (participant) => participant && participant.moderator,
|
112
|
+
|
113
|
+
/**
|
114
|
+
* @param {Object} participant - The locus participant object.
|
115
|
+
* @returns {Boolean}
|
116
|
+
*/
|
117
|
+
isGuest: (participant: any) => participant && participant.guest,
|
118
|
+
|
119
|
+
/**
|
120
|
+
* @param {Object} participant - The locus participant object.
|
121
|
+
* @returns {Boolean}
|
122
|
+
*/
|
123
|
+
isDevice: (participant: any) => participant && participant.type === _RESOURCE_ROOM_,
|
124
|
+
|
125
|
+
isModeratorAssignmentProhibited: (participant) =>
|
126
|
+
participant && participant.moderatorAssignmentNotAllowed,
|
127
|
+
|
128
|
+
isPresenterAssignmentProhibited: (participant) =>
|
129
|
+
participant && participant.presenterAssignmentNotAllowed,
|
130
|
+
|
131
|
+
/**
|
132
|
+
* checks to see if the participant id is the same as the passed id
|
133
|
+
* there are multiple ids that can be used
|
134
|
+
* @param {Object} participant - The locus participant object.
|
135
|
+
* @param {String} id
|
136
|
+
* @returns {Boolean}
|
137
|
+
*/
|
138
|
+
isSame: (participant: any, id: string) =>
|
139
|
+
participant && (participant.id === id || (participant.person && participant.person.id === id)),
|
140
|
+
|
141
|
+
/**
|
142
|
+
* checks to see if the participant id is the same as the passed id for associated devices
|
143
|
+
* there are multiple ids that can be used
|
144
|
+
* @param {Object} participant - The locus participant object.
|
145
|
+
* @param {String} id
|
146
|
+
* @returns {Boolean}
|
147
|
+
*/
|
148
|
+
isAssociatedSame: (participant: any, id: string) =>
|
149
|
+
participant &&
|
150
|
+
participant.associatedUsers &&
|
151
|
+
participant.associatedUsers.some(
|
152
|
+
(user) => user.id === id || (user.person && user.person.id === id)
|
153
|
+
),
|
154
|
+
|
155
|
+
/**
|
156
|
+
* @param {Object} participant - The locus participant object.
|
157
|
+
* @param {Boolean} isGuest
|
158
|
+
* @param {String} status
|
159
|
+
* @returns {Boolean}
|
160
|
+
*/
|
161
|
+
isNotAdmitted: (participant: any, isGuest: boolean, status: string): boolean =>
|
162
|
+
participant &&
|
163
|
+
participant.guest &&
|
164
|
+
((participant.devices &&
|
165
|
+
participant.devices[0] &&
|
166
|
+
participant.devices[0].intent &&
|
167
|
+
participant.devices[0].intent.type === _WAIT_ &&
|
168
|
+
// @ts-ignore
|
169
|
+
isGuest &&
|
170
|
+
status === _IN_LOBBY_) ||
|
171
|
+
// @ts-ignore
|
172
|
+
!status === _IN_MEETING_),
|
173
|
+
|
174
|
+
/**
|
175
|
+
* @param {Object} participant - The locus participant object.
|
176
|
+
* @returns {Boolean}
|
177
|
+
*/
|
178
|
+
isAudioMuted: (participant: any) => {
|
179
|
+
if (!participant) {
|
180
|
+
throw new ParameterError('Audio could not be processed, participant is undefined.');
|
181
|
+
}
|
187
182
|
|
188
|
-
|
189
|
-
|
190
|
-
* @returns {Boolean}
|
191
|
-
*/
|
192
|
-
MemberUtil.isVideoMuted = (participant: any): boolean => {
|
193
|
-
if (!participant) {
|
194
|
-
throw new ParameterError('Video could not be processed, participant is undefined.');
|
195
|
-
}
|
183
|
+
return MemberUtil.isMuted(participant, AUDIO_STATUS, AUDIO);
|
184
|
+
},
|
196
185
|
|
197
|
-
|
198
|
-
}
|
186
|
+
/**
|
187
|
+
* @param {Object} participant - The locus participant object.
|
188
|
+
* @returns {Boolean}
|
189
|
+
*/
|
190
|
+
isVideoMuted: (participant: any): boolean => {
|
191
|
+
if (!participant) {
|
192
|
+
throw new ParameterError('Video could not be processed, participant is undefined.');
|
193
|
+
}
|
199
194
|
|
200
|
-
|
201
|
-
|
202
|
-
* @returns {Boolean}
|
203
|
-
*/
|
204
|
-
MemberUtil.isHandRaised = (participant: any) => {
|
205
|
-
if (!participant) {
|
206
|
-
throw new ParameterError('Raise hand could not be processed, participant is undefined.');
|
207
|
-
}
|
195
|
+
return MemberUtil.isMuted(participant, VIDEO_STATUS, VIDEO);
|
196
|
+
},
|
208
197
|
|
209
|
-
|
210
|
-
}
|
198
|
+
/**
|
199
|
+
* @param {Object} participant - The locus participant object.
|
200
|
+
* @returns {Boolean}
|
201
|
+
*/
|
202
|
+
isHandRaised: (participant: any) => {
|
203
|
+
if (!participant) {
|
204
|
+
throw new ParameterError('Raise hand could not be processed, participant is undefined.');
|
205
|
+
}
|
211
206
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
207
|
+
return participant.controls?.hand?.raised || false;
|
208
|
+
},
|
209
|
+
|
210
|
+
/**
|
211
|
+
* @param {Object} participant - The locus participant object.
|
212
|
+
* @returns {Boolean}
|
213
|
+
*/
|
214
|
+
isBreakoutsSupported: (participant) => {
|
215
|
+
if (!participant) {
|
216
|
+
throw new ParameterError(
|
217
|
+
'Breakout support could not be processed, participant is undefined.'
|
218
|
+
);
|
219
|
+
}
|
220
220
|
|
221
|
-
|
222
|
-
}
|
221
|
+
return !participant.doesNotSupportBreakouts;
|
222
|
+
},
|
223
|
+
|
224
|
+
/**
|
225
|
+
* @param {Object} participant - The locus participant object.
|
226
|
+
* @returns {Boolean}
|
227
|
+
*/
|
228
|
+
isInterpretationSupported: (participant) => {
|
229
|
+
if (!participant) {
|
230
|
+
throw new ParameterError(
|
231
|
+
'Interpretation support could not be processed, participant is undefined.'
|
232
|
+
);
|
233
|
+
}
|
223
234
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
)
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
}
|
235
|
+
return !participant.doesNotSupportSiInterpreter;
|
236
|
+
},
|
237
|
+
|
238
|
+
/**
|
239
|
+
* @param {Object} participant - The locus participant object.
|
240
|
+
* @returns {Boolean}
|
241
|
+
*/
|
242
|
+
isLiveAnnotationSupported: (participant) => {
|
243
|
+
if (!participant) {
|
244
|
+
throw new ParameterError(
|
245
|
+
'LiveAnnotation support could not be processed, participant is undefined.'
|
246
|
+
);
|
247
|
+
}
|
237
248
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
249
|
+
return !participant.annotatorAssignmentNotAllowed;
|
250
|
+
},
|
251
|
+
|
252
|
+
/**
|
253
|
+
* utility method for audio/video muted status
|
254
|
+
* @param {any} participant
|
255
|
+
* @param {String} statusAccessor
|
256
|
+
* @param {String} controlsAccessor
|
257
|
+
* @returns {Boolean | undefined}
|
258
|
+
*/
|
259
|
+
isMuted: (participant: any, statusAccessor: string, controlsAccessor: string) => {
|
260
|
+
// check remote mute
|
261
|
+
const remoteMute = participant?.controls?.[controlsAccessor]?.muted;
|
262
|
+
if (remoteMute === true) {
|
263
|
+
return true;
|
264
|
+
}
|
251
265
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
// check remote mute
|
261
|
-
const remoteMute = participant?.controls?.[controlsAccessor]?.muted;
|
262
|
-
if (remoteMute === true) {
|
263
|
-
return true;
|
264
|
-
}
|
265
|
-
|
266
|
-
// check local mute
|
267
|
-
const localStatus = participant?.status?.[statusAccessor];
|
268
|
-
if (localStatus === _RECEIVE_ONLY_) {
|
269
|
-
return true;
|
270
|
-
}
|
271
|
-
if (localStatus === _SEND_RECEIVE_) {
|
272
|
-
return false;
|
273
|
-
}
|
266
|
+
// check local mute
|
267
|
+
const localStatus = participant?.status?.[statusAccessor];
|
268
|
+
if (localStatus === _RECEIVE_ONLY_) {
|
269
|
+
return true;
|
270
|
+
}
|
271
|
+
if (localStatus === _SEND_RECEIVE_) {
|
272
|
+
return false;
|
273
|
+
}
|
274
274
|
|
275
|
-
|
276
|
-
}
|
275
|
+
return remoteMute;
|
276
|
+
},
|
277
|
+
|
278
|
+
/**
|
279
|
+
* utility method for getting the recording member for later comparison
|
280
|
+
* @param {Object} controls
|
281
|
+
* @returns {String|null}
|
282
|
+
*/
|
283
|
+
getRecordingMember: (controls: any) => {
|
284
|
+
if (!controls) {
|
285
|
+
return null;
|
286
|
+
}
|
287
|
+
if (controls.record && controls.record.recording && controls.record.meta) {
|
288
|
+
return controls.record.meta.modifiedBy;
|
289
|
+
}
|
277
290
|
|
278
|
-
/**
|
279
|
-
* utility method for getting the recording member for later comparison
|
280
|
-
* @param {Object} controls
|
281
|
-
* @returns {String|null}
|
282
|
-
*/
|
283
|
-
MemberUtil.getRecordingMember = (controls: any) => {
|
284
|
-
if (!controls) {
|
285
291
|
return null;
|
286
|
-
}
|
287
|
-
|
288
|
-
|
289
|
-
|
292
|
+
},
|
293
|
+
|
294
|
+
/**
|
295
|
+
* @param {Object} participant - The locus participant object.
|
296
|
+
* @returns {Boolean}
|
297
|
+
*/
|
298
|
+
isRecording: (participant: any) => {
|
299
|
+
if (!participant) {
|
300
|
+
throw new ParameterError('Recording could not be processed, participant is undefined.');
|
301
|
+
}
|
302
|
+
if (participant.controls && participant.controls.localRecord) {
|
303
|
+
return participant.controls.localRecord.recording;
|
304
|
+
}
|
290
305
|
|
291
|
-
|
292
|
-
}
|
306
|
+
return false;
|
307
|
+
},
|
293
308
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
}
|
305
|
-
|
306
|
-
return false;
|
307
|
-
};
|
309
|
+
isRemovable: (isSelf, isGuest, isInMeeting, type) => {
|
310
|
+
if (isGuest || isSelf) {
|
311
|
+
return false;
|
312
|
+
}
|
313
|
+
if (type === _CALL_) {
|
314
|
+
return false;
|
315
|
+
}
|
316
|
+
if (isInMeeting) {
|
317
|
+
return true;
|
318
|
+
}
|
308
319
|
|
309
|
-
MemberUtil.isRemovable = (isSelf, isGuest, isInMeeting, type) => {
|
310
|
-
if (isGuest || isSelf) {
|
311
|
-
return false;
|
312
|
-
}
|
313
|
-
if (type === _CALL_) {
|
314
320
|
return false;
|
315
|
-
}
|
316
|
-
if (isInMeeting) {
|
317
|
-
return true;
|
318
|
-
}
|
321
|
+
},
|
319
322
|
|
320
|
-
|
321
|
-
|
323
|
+
isMutable: (isSelf, isDevice, isInMeeting, isMuted, type) => {
|
324
|
+
if (!isInMeeting) {
|
325
|
+
return false;
|
326
|
+
}
|
327
|
+
if (isMuted) {
|
328
|
+
return false;
|
329
|
+
}
|
330
|
+
if (type === _CALL_) {
|
331
|
+
return false;
|
332
|
+
}
|
333
|
+
if (isSelf || isDevice) {
|
334
|
+
return true;
|
335
|
+
}
|
322
336
|
|
323
|
-
MemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => {
|
324
|
-
if (!isInMeeting) {
|
325
|
-
return false;
|
326
|
-
}
|
327
|
-
if (isMuted) {
|
328
337
|
return false;
|
329
|
-
}
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
338
|
+
},
|
339
|
+
|
340
|
+
/**
|
341
|
+
* @param {Object} participant - The locus participant object.
|
342
|
+
* @returns {String}
|
343
|
+
*/
|
344
|
+
extractStatus: (participant: any) => {
|
345
|
+
if (!(participant && participant.devices && participant.devices.length)) {
|
346
|
+
return _NOT_IN_MEETING_;
|
347
|
+
}
|
348
|
+
if (participant.state === _JOINED_) {
|
349
|
+
return _IN_MEETING_;
|
350
|
+
}
|
351
|
+
if (participant.state === _IDLE_) {
|
352
|
+
if (participant.devices && participant.devices.length > 0) {
|
353
|
+
const foundDevice = participant.devices.find(
|
354
|
+
(device) =>
|
355
|
+
device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_)
|
356
|
+
);
|
336
357
|
|
337
|
-
|
338
|
-
}
|
358
|
+
return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;
|
359
|
+
}
|
339
360
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
MemberUtil.extractStatus = (participant: any) => {
|
345
|
-
if (!(participant && participant.devices && participant.devices.length)) {
|
346
|
-
return _NOT_IN_MEETING_;
|
347
|
-
}
|
348
|
-
if (participant.state === _JOINED_) {
|
349
|
-
return _IN_MEETING_;
|
350
|
-
}
|
351
|
-
if (participant.state === _IDLE_) {
|
352
|
-
if (participant.devices && participant.devices.length > 0) {
|
353
|
-
const foundDevice = participant.devices.find(
|
354
|
-
(device) =>
|
355
|
-
device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_)
|
356
|
-
);
|
357
|
-
|
358
|
-
return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;
|
361
|
+
return _NOT_IN_MEETING_;
|
362
|
+
}
|
363
|
+
if (participant.state === _LEFT_) {
|
364
|
+
return _NOT_IN_MEETING_;
|
359
365
|
}
|
360
366
|
|
361
367
|
return _NOT_IN_MEETING_;
|
362
|
-
}
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
* @returns {String}
|
373
|
-
*/
|
374
|
-
MemberUtil.extractId = (participant: any) => {
|
375
|
-
if (participant) {
|
376
|
-
return participant.id;
|
377
|
-
}
|
378
|
-
|
379
|
-
return null;
|
380
|
-
};
|
368
|
+
},
|
369
|
+
|
370
|
+
/**
|
371
|
+
* @param {Object} participant - The locus participant object.
|
372
|
+
* @returns {String}
|
373
|
+
*/
|
374
|
+
extractId: (participant: any) => {
|
375
|
+
if (participant) {
|
376
|
+
return participant.id;
|
377
|
+
}
|
381
378
|
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
video: participant.status?.videoStatus,
|
395
|
-
};
|
396
|
-
};
|
379
|
+
return null;
|
380
|
+
},
|
381
|
+
|
382
|
+
/**
|
383
|
+
* extracts the media status from nested participant object
|
384
|
+
* @param {Object} participant - The locus participant object.
|
385
|
+
* @returns {Object}
|
386
|
+
*/
|
387
|
+
extractMediaStatus: (participant: any): IMediaStatus => {
|
388
|
+
if (!participant) {
|
389
|
+
throw new ParameterError('Media status could not be extracted, participant is undefined.');
|
390
|
+
}
|
397
391
|
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
392
|
+
return {
|
393
|
+
audio: participant.status?.audioStatus,
|
394
|
+
video: participant.status?.videoStatus,
|
395
|
+
};
|
396
|
+
},
|
397
|
+
|
398
|
+
/**
|
399
|
+
* @param {Object} participant - The locus participant object.
|
400
|
+
* @returns {String}
|
401
|
+
*/
|
402
|
+
extractName: (participant: any) => {
|
403
|
+
if (participant && participant.person) {
|
404
|
+
return participant.person.name;
|
405
|
+
}
|
406
406
|
|
407
|
-
|
407
|
+
return null;
|
408
|
+
},
|
408
409
|
};
|
409
|
-
|
410
410
|
export default MemberUtil;
|