@webex/plugin-meetings 3.8.0-next.70 → 3.8.0-next.72
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 +70 -6
- package/dist/breakouts/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +12 -11
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +53 -26
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/types/locus-info/index.d.ts +2 -3
- package/dist/types/locus-info/selfUtils.d.ts +19 -50
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/breakouts/index.ts +69 -0
- package/src/locus-info/index.ts +15 -11
- package/src/locus-info/selfUtils.ts +73 -23
- package/test/unit/spec/breakouts/index.ts +167 -95
- package/test/unit/spec/locus-info/index.js +113 -73
- package/test/unit/spec/locus-info/selfUtils.js +98 -24
package/src/locus-info/index.ts
CHANGED
@@ -264,7 +264,7 @@ export default class LocusInfo extends EventsScope {
|
|
264
264
|
this.updateMeetingInfo(locus.info);
|
265
265
|
this.updateEmbeddedApps(locus.embeddedApps);
|
266
266
|
// self and participants generate sipUrl for 1:1 meeting
|
267
|
-
this.updateSelf(locus.self
|
267
|
+
this.updateSelf(locus.self);
|
268
268
|
this.updateHostInfo(locus.host);
|
269
269
|
this.updateMediaShares(locus.mediaShares);
|
270
270
|
this.updateServices(locus.links?.services);
|
@@ -422,6 +422,7 @@ export default class LocusInfo extends EventsScope {
|
|
422
422
|
*/
|
423
423
|
onDeltaLocus(locus: any) {
|
424
424
|
const isReplaceMembers = ControlsUtils.isNeedReplaceMembers(this.controls, locus.controls);
|
425
|
+
this.mergeParticipants(this.participants, locus.participants);
|
425
426
|
this.updateLocusInfo(locus);
|
426
427
|
this.updateParticipants(locus.participants, isReplaceMembers);
|
427
428
|
this.isMeetingActive();
|
@@ -449,7 +450,7 @@ export default class LocusInfo extends EventsScope {
|
|
449
450
|
this.updateMediaShares(locus.mediaShares);
|
450
451
|
this.updateParticipantsUrl(locus.participantsUrl);
|
451
452
|
this.updateReplace(locus.replace);
|
452
|
-
this.updateSelf(locus.self
|
453
|
+
this.updateSelf(locus.self);
|
453
454
|
this.updateLocusUrl(locus.url);
|
454
455
|
this.updateAclUrl(locus.aclUrl);
|
455
456
|
this.updateBasequence(locus.baseSequence);
|
@@ -1357,17 +1358,20 @@ export default class LocusInfo extends EventsScope {
|
|
1357
1358
|
|
1358
1359
|
/**
|
1359
1360
|
* handles when the locus.self is updated
|
1360
|
-
* @param {Object} self the locus.
|
1361
|
-
* @param {Array} participants the locus.participants property
|
1361
|
+
* @param {Object} self the new locus.self
|
1362
1362
|
* @returns {undefined}
|
1363
1363
|
* @memberof LocusInfo
|
1364
1364
|
* emits internal events self_admitted_guest, self_unadmitted_guest, locus_info_update_self
|
1365
1365
|
*/
|
1366
|
-
updateSelf(self: any
|
1367
|
-
|
1368
|
-
if (self && !isEqual(this.self, self)) {
|
1366
|
+
updateSelf(self: any) {
|
1367
|
+
if (self) {
|
1369
1368
|
// @ts-ignore
|
1370
|
-
const parsedSelves = SelfUtils.getSelves(
|
1369
|
+
const parsedSelves = SelfUtils.getSelves(
|
1370
|
+
this.parsedLocus.self,
|
1371
|
+
self,
|
1372
|
+
this.webex.internal.device.url,
|
1373
|
+
this.participants // using this.participants instead of locus.participants here, because with delta DTOs locus.participants will only contain a small subset of participants
|
1374
|
+
);
|
1371
1375
|
|
1372
1376
|
this.updateMeeting(parsedSelves.current);
|
1373
1377
|
this.parsedLocus.self = parsedSelves.current;
|
@@ -1381,7 +1385,7 @@ export default class LocusInfo extends EventsScope {
|
|
1381
1385
|
// TODO: check if we need to save the sipUri here as well
|
1382
1386
|
// this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri));
|
1383
1387
|
const result = SelfUtils.getSipUrl(
|
1384
|
-
this.getLocusPartner(participants, self),
|
1388
|
+
this.getLocusPartner(this.participants, self),
|
1385
1389
|
this.parsedLocus.fullState.type,
|
1386
1390
|
this.parsedLocus.info.sipUri
|
1387
1391
|
);
|
@@ -1527,7 +1531,7 @@ export default class LocusInfo extends EventsScope {
|
|
1527
1531
|
{}
|
1528
1532
|
);
|
1529
1533
|
}
|
1530
|
-
if (parsedSelves.updates.
|
1534
|
+
if (parsedSelves.updates.hasUserEnteredLobby) {
|
1531
1535
|
this.emitScoped(
|
1532
1536
|
{
|
1533
1537
|
file: 'locus-info',
|
@@ -1537,7 +1541,7 @@ export default class LocusInfo extends EventsScope {
|
|
1537
1541
|
self
|
1538
1542
|
);
|
1539
1543
|
}
|
1540
|
-
if (parsedSelves.updates.
|
1544
|
+
if (parsedSelves.updates.hasUserBeenAdmitted) {
|
1541
1545
|
this.emitScoped(
|
1542
1546
|
{
|
1543
1547
|
file: 'locus-info',
|
@@ -24,11 +24,17 @@ const SelfUtils = {
|
|
24
24
|
* parses the relevant values for self: muted, guest, moderator, mediaStatus, state, joinedWith, pstnDevices, creator, id
|
25
25
|
* @param {Object} self
|
26
26
|
* @param {String} deviceId
|
27
|
+
* @param {Array} participants
|
27
28
|
* @returns {undefined}
|
28
29
|
*/
|
29
|
-
parse: (self: any, deviceId: string) => {
|
30
|
+
parse: (self: any, deviceId: string, participants: Array<any>) => {
|
30
31
|
if (self) {
|
31
32
|
const joinedWith = self.devices.find((device) => deviceId === device.url);
|
33
|
+
const pairedWith =
|
34
|
+
joinedWith?.intent?.type === _OBSERVE_ &&
|
35
|
+
participants?.find((participant) => participant.url === joinedWith?.intent?.associatedWith)
|
36
|
+
?.devices[0];
|
37
|
+
|
32
38
|
const pstnDevices = self.devices.filter((device) => PSTN_DEVICE_TYPE === device.deviceType);
|
33
39
|
|
34
40
|
return {
|
@@ -50,6 +56,7 @@ const SelfUtils = {
|
|
50
56
|
// TODO: give a proper name . With same device as login or different login`
|
51
57
|
// Some times we might have joined with both mobile and web
|
52
58
|
joinedWith,
|
59
|
+
pairedWith,
|
53
60
|
pstnDevices,
|
54
61
|
// current media stats is for the current device who has joined
|
55
62
|
currentMediaStatus: SelfUtils.getMediaStatus(joinedWith?.mediaSessions),
|
@@ -59,7 +66,7 @@ const SelfUtils = {
|
|
59
66
|
selfUrl: self.url,
|
60
67
|
removed: self.removed,
|
61
68
|
roles: SelfUtils.getRoles(self),
|
62
|
-
isUserUnadmitted: self
|
69
|
+
isUserUnadmitted: SelfUtils.isLocusUserUnadmitted(self?.state, joinedWith, pairedWith),
|
63
70
|
layout: SelfUtils.getLayout(self),
|
64
71
|
canNotViewTheParticipantList: SelfUtils.canNotViewTheParticipantList(self),
|
65
72
|
isSharingBlocked: SelfUtils.isSharingBlocked(self),
|
@@ -94,13 +101,13 @@ const SelfUtils = {
|
|
94
101
|
|
95
102
|
isSharingBlocked: (self) => !!self?.isSharingBlocked,
|
96
103
|
|
97
|
-
getSelves: (
|
98
|
-
const previous =
|
99
|
-
const current = newSelf && SelfUtils.parse(newSelf, deviceId);
|
104
|
+
getSelves: (oldParsedSelf, newSelf, deviceId, participants: Array<any>) => {
|
105
|
+
const previous = oldParsedSelf;
|
106
|
+
const current = newSelf && SelfUtils.parse(newSelf, deviceId, participants);
|
100
107
|
const updates: any = {};
|
101
108
|
|
102
|
-
updates.
|
103
|
-
updates.
|
109
|
+
updates.hasUserEnteredLobby = SelfUtils.hasUserEnteredLobby(previous, current);
|
110
|
+
updates.hasUserBeenAdmitted = SelfUtils.hasUserBeenAdmitted(previous, current);
|
104
111
|
updates.isVideoMutedByOthersChanged = SelfUtils.videoMutedByOthersChanged(previous, current);
|
105
112
|
updates.isMutedByOthersChanged = SelfUtils.mutedByOthersChanged(previous, current);
|
106
113
|
updates.localAudioUnmuteRequestedByServer = SelfUtils.localAudioUnmuteRequestedByServer(
|
@@ -316,37 +323,68 @@ const SelfUtils = {
|
|
316
323
|
changedSelf.joinedWith.reason === MEETING_END_REASON.MEDIA_RELEASED),
|
317
324
|
|
318
325
|
/**
|
319
|
-
* @param {
|
320
|
-
* @
|
326
|
+
* @param {String | undefined} state meeting state
|
327
|
+
* @param {any} joinedWith device that user has joined with
|
328
|
+
* @param {any} pairedWith device that user is paired with
|
329
|
+
* @returns {Boolean | undefined} true if user is in lobby, false if not, undefined if it cannot be determined
|
321
330
|
*/
|
322
|
-
isLocusUserUnadmitted: (
|
323
|
-
|
331
|
+
isLocusUserUnadmitted: (state?: string, joinedWith?: any, pairedWith?: any) => {
|
332
|
+
if (state === undefined) {
|
333
|
+
return undefined;
|
334
|
+
}
|
335
|
+
if (joinedWith?.intent?.type === _OBSERVE_ && pairedWith) {
|
336
|
+
// we are paired with a device, so need to check the lobby state for that device
|
337
|
+
return pairedWith.intent?.type === _WAIT_ && state === _IDLE_;
|
338
|
+
}
|
339
|
+
|
340
|
+
return joinedWith?.intent?.type === _WAIT_ && state === _IDLE_;
|
341
|
+
},
|
324
342
|
|
325
343
|
/**
|
326
|
-
* @param {
|
344
|
+
* @param {String | undefined} state meeting state
|
345
|
+
* @param {any} joinedWith device that user has joined with
|
346
|
+
* @param {any} pairedWith device that user is paired with
|
327
347
|
* @returns {Boolean}
|
328
348
|
*/
|
329
|
-
isLocusUserAdmitted: (
|
330
|
-
|
349
|
+
isLocusUserAdmitted: (state?: string, joinedWith?: any, pairedWith?: any) => {
|
350
|
+
if (state === undefined) {
|
351
|
+
return undefined;
|
352
|
+
}
|
353
|
+
|
354
|
+
if (joinedWith?.intent?.type === _OBSERVE_ && pairedWith) {
|
355
|
+
// we are paired with a device, so need to check the lobby state for that device
|
356
|
+
return pairedWith.intent?.type !== _WAIT_ && state === _JOINED_;
|
357
|
+
}
|
358
|
+
|
359
|
+
return joinedWith?.intent?.type !== _WAIT_ && state === _JOINED_;
|
360
|
+
},
|
331
361
|
|
332
362
|
/**
|
333
363
|
* @param {Object} oldSelf
|
334
364
|
* @param {Object} changedSelf
|
335
|
-
* @returns {Boolean}
|
365
|
+
* @returns {Boolean} true if user has just been placed in the lobby
|
336
366
|
* @throws {Error} when self is undefined
|
337
367
|
*/
|
338
|
-
|
368
|
+
hasUserEnteredLobby: (oldSelf: any, changedSelf: any) => {
|
339
369
|
if (!changedSelf) {
|
340
370
|
throw new ParameterError(
|
341
371
|
'changedSelf must be defined to determine if self is unadmitted as guest.'
|
342
372
|
);
|
343
373
|
}
|
344
374
|
|
345
|
-
|
346
|
-
|
347
|
-
|
375
|
+
const wasInLobby = SelfUtils.isLocusUserUnadmitted(
|
376
|
+
oldSelf?.state,
|
377
|
+
oldSelf?.joinedWith,
|
378
|
+
oldSelf?.pairedWith
|
379
|
+
);
|
380
|
+
|
381
|
+
const isInLobby = SelfUtils.isLocusUserUnadmitted(
|
382
|
+
changedSelf?.state,
|
383
|
+
changedSelf?.joinedWith,
|
384
|
+
changedSelf?.pairedWith
|
385
|
+
);
|
348
386
|
|
349
|
-
return
|
387
|
+
return !wasInLobby && isInLobby;
|
350
388
|
},
|
351
389
|
|
352
390
|
moderatorChanged: (oldSelf, changedSelf) => {
|
@@ -391,10 +429,10 @@ const SelfUtils = {
|
|
391
429
|
/**
|
392
430
|
* @param {Object} oldSelf
|
393
431
|
* @param {Object} changedSelf
|
394
|
-
* @returns {Boolean}
|
432
|
+
* @returns {Boolean} true if the user has just been admitted from lobby into the meeting
|
395
433
|
* @throws {Error} if changed self was undefined
|
396
434
|
*/
|
397
|
-
|
435
|
+
hasUserBeenAdmitted: (oldSelf: any, changedSelf: any) => {
|
398
436
|
if (!oldSelf) {
|
399
437
|
// if there was no previous locus, it couldn't have been admitted yet
|
400
438
|
return false;
|
@@ -405,7 +443,19 @@ const SelfUtils = {
|
|
405
443
|
);
|
406
444
|
}
|
407
445
|
|
408
|
-
|
446
|
+
const wasInLobby = SelfUtils.isLocusUserUnadmitted(
|
447
|
+
oldSelf?.state,
|
448
|
+
oldSelf?.joinedWith,
|
449
|
+
oldSelf?.pairedWith
|
450
|
+
);
|
451
|
+
|
452
|
+
const isAdmitted = SelfUtils.isLocusUserAdmitted(
|
453
|
+
changedSelf?.state,
|
454
|
+
changedSelf?.joinedWith,
|
455
|
+
changedSelf?.pairedWith
|
456
|
+
);
|
457
|
+
|
458
|
+
return wasInLobby && isAdmitted && isAdmitted !== undefined;
|
409
459
|
},
|
410
460
|
|
411
461
|
videoMutedByOthersChanged: (oldSelf, changedSelf) => {
|