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