@webex/plugin-meetings 3.8.0-next.7 → 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/common/errors/webex-errors.js +12 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +4 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +17 -121
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +2 -0
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/types.js.map +1 -1
- package/dist/controls-options-manager/util.js +52 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +28 -10
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +20 -1
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +405 -418
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +14 -16
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +94 -6
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/brbState.js +6 -0
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +17 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +541 -302
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +0 -17
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +0 -2
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +30 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +13 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +359 -60
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +114 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +14 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +330 -353
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +23 -0
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +21 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +15 -0
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +9 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/reachability/clusterReachability.js +63 -27
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +112 -47
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +14 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/request.js +19 -3
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/util.js +5 -5
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +45 -27
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js +17 -0
- package/dist/roap/types.js.map +1 -0
- package/dist/types/common/errors/webex-errors.d.ts +7 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/constants.d.ts +12 -85
- package/dist/types/controls-options-manager/enums.d.ts +3 -1
- package/dist/types/controls-options-manager/types.d.ts +7 -1
- package/dist/types/locus-info/index.d.ts +1 -0
- package/dist/types/locus-info/selfUtils.d.ts +247 -1
- package/dist/types/media/properties.d.ts +15 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +16 -0
- package/dist/types/meeting/index.d.ts +32 -1
- package/dist/types/meeting/muteState.d.ts +0 -1
- package/dist/types/meeting/request.d.ts +12 -1
- package/dist/types/meeting/request.type.d.ts +6 -0
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +80 -0
- package/dist/types/meetings/index.d.ts +48 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/util.d.ts +159 -1
- package/dist/types/members/index.d.ts +8 -0
- package/dist/types/members/request.d.ts +19 -0
- package/dist/types/members/util.d.ts +13 -0
- package/dist/types/metrics/constants.d.ts +9 -0
- package/dist/types/reachability/clusterReachability.d.ts +15 -7
- package/dist/types/reachability/index.d.ts +10 -1
- package/dist/types/reachability/reachability.types.d.ts +5 -0
- package/dist/types/roap/index.d.ts +3 -2
- package/dist/types/roap/turnDiscovery.d.ts +5 -17
- package/dist/types/roap/types.d.ts +16 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +24 -23
- package/src/common/errors/webex-errors.ts +8 -1
- package/src/config.ts +2 -0
- package/src/constants.ts +19 -90
- package/src/controls-options-manager/enums.ts +2 -0
- package/src/controls-options-manager/types.ts +11 -1
- package/src/controls-options-manager/util.ts +62 -0
- package/src/locus-info/controlsUtils.ts +44 -14
- package/src/locus-info/index.ts +23 -1
- package/src/locus-info/selfUtils.ts +451 -447
- package/src/media/index.ts +20 -21
- package/src/media/properties.ts +96 -0
- package/src/meeting/brbState.ts +7 -0
- package/src/meeting/in-meeting-actions.ts +32 -0
- package/src/meeting/index.ts +346 -93
- package/src/meeting/locusMediaRequest.ts +0 -18
- package/src/meeting/muteState.ts +0 -2
- package/src/meeting/request.ts +36 -1
- package/src/meeting/request.type.ts +7 -0
- package/src/meeting/util.ts +11 -2
- package/src/meeting-info/meeting-info-v2.ts +247 -6
- package/src/meetings/index.ts +128 -1
- package/src/meetings/util.ts +18 -0
- package/src/member/index.ts +13 -2
- package/src/member/util.ts +351 -348
- package/src/members/index.ts +25 -0
- package/src/members/request.ts +26 -0
- package/src/members/util.ts +16 -0
- package/src/metrics/constants.ts +9 -0
- package/src/reachability/clusterReachability.ts +73 -26
- package/src/reachability/index.ts +70 -1
- package/src/reachability/reachability.types.ts +6 -0
- package/src/reachability/request.ts +7 -0
- package/src/reconnection-manager/index.ts +2 -2
- package/src/recording-controller/util.ts +17 -13
- package/src/roap/index.ts +3 -7
- package/src/roap/turnDiscovery.ts +34 -39
- package/src/roap/types.ts +23 -0
- package/test/unit/spec/controls-options-manager/util.js +120 -0
- package/test/unit/spec/locus-info/controlsUtils.js +103 -9
- package/test/unit/spec/locus-info/index.js +28 -0
- package/test/unit/spec/media/index.ts +98 -16
- package/test/unit/spec/media/properties.ts +130 -0
- package/test/unit/spec/meeting/brbState.ts +19 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +19 -4
- package/test/unit/spec/meeting/index.js +524 -35
- package/test/unit/spec/meeting/locusMediaRequest.ts +0 -30
- package/test/unit/spec/meeting/muteState.js +0 -2
- package/test/unit/spec/meeting/request.js +32 -1
- package/test/unit/spec/meeting/utils.js +119 -18
- package/test/unit/spec/meeting-info/meetinginfov2.js +443 -114
- package/test/unit/spec/meetings/index.js +133 -2
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +24 -0
- package/test/unit/spec/members/index.js +103 -26
- package/test/unit/spec/members/request.js +45 -22
- package/test/unit/spec/members/utils.js +33 -0
- package/test/unit/spec/reachability/clusterReachability.ts +88 -56
- package/test/unit/spec/reachability/index.ts +101 -0
- package/test/unit/spec/reachability/request.js +47 -2
- package/test/unit/spec/reconnection-manager/index.js +4 -4
- package/test/unit/spec/roap/turnDiscovery.ts +110 -28
@@ -17,513 +17,517 @@ import {
|
|
17
17
|
} from '../constants';
|
18
18
|
import ParameterError from '../common/errors/parameter';
|
19
19
|
|
20
|
-
const SelfUtils: any = {};
|
21
20
|
const PSTN_DEVICE_TYPE = 'PROVISIONAL';
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
22
|
+
const SelfUtils = {
|
23
|
+
/**
|
24
|
+
* parses the relevant values for self: muted, guest, moderator, mediaStatus, state, joinedWith, pstnDevices, creator, id
|
25
|
+
* @param {Object} self
|
26
|
+
* @param {String} deviceId
|
27
|
+
* @returns {undefined}
|
28
|
+
*/
|
29
|
+
parse: (self: any, deviceId: string) => {
|
30
|
+
if (self) {
|
31
|
+
const joinedWith = self.devices.find((device) => deviceId === device.url);
|
32
|
+
const pstnDevices = self.devices.filter((device) => PSTN_DEVICE_TYPE === device.deviceType);
|
33
|
+
|
34
|
+
return {
|
35
|
+
remoteVideoMuted: SelfUtils.getRemoteVideoMuted(self),
|
36
|
+
remoteMuted: SelfUtils.getRemoteMuted(self),
|
37
|
+
unmuteAllowed: SelfUtils.getUnmuteAllowed(self),
|
38
|
+
localAudioUnmuteRequested: SelfUtils.getLocalAudioUnmuteRequested(self),
|
39
|
+
localAudioUnmuteRequestedTimeStamp: SelfUtils.getLocalAudioUnmuteRequestedTimeStamp(self),
|
40
|
+
localAudioUnmuteRequired: SelfUtils.getLocalAudioUnmuteRequired(self),
|
41
|
+
lastModified: SelfUtils.getLastModified(self),
|
42
|
+
modifiedBy: SelfUtils.getModifiedBy(self),
|
43
|
+
guest: self.guest,
|
44
|
+
moderator: self.moderator,
|
45
|
+
// cumulative media stats
|
46
|
+
mediaStatus: SelfUtils.getStatus(self.status),
|
47
|
+
// TODO: what should be the status if user has refreshed the page,
|
48
|
+
// check the joinedWith parameter and communicate to the user
|
49
|
+
state: self.state,
|
50
|
+
// TODO: give a proper name . With same device as login or different login`
|
51
|
+
// Some times we might have joined with both mobile and web
|
52
|
+
joinedWith,
|
53
|
+
pstnDevices,
|
54
|
+
// current media stats is for the current device who has joined
|
55
|
+
currentMediaStatus: SelfUtils.getMediaStatus(joinedWith?.mediaSessions),
|
56
|
+
creator: self.isCreator, // check if its used,
|
57
|
+
selfId: self.id,
|
58
|
+
selfIdentity: SelfUtils.getSelfIdentity(self),
|
59
|
+
selfUrl: self.url,
|
60
|
+
removed: self.removed,
|
61
|
+
roles: SelfUtils.getRoles(self),
|
62
|
+
isUserUnadmitted: self.state === _IDLE_ && joinedWith?.intent?.type === _WAIT_,
|
63
|
+
layout: SelfUtils.getLayout(self),
|
64
|
+
canNotViewTheParticipantList: SelfUtils.canNotViewTheParticipantList(self),
|
65
|
+
isSharingBlocked: SelfUtils.isSharingBlocked(self),
|
66
|
+
breakoutSessions: SelfUtils.getBreakoutSessions(self),
|
67
|
+
breakout: SelfUtils.getBreakout(self),
|
68
|
+
interpretation: SelfUtils.getInterpretation(self),
|
69
|
+
brb: SelfUtils.getBrb(self),
|
70
|
+
};
|
71
|
+
}
|
33
72
|
|
34
|
-
return
|
35
|
-
|
36
|
-
remoteMuted: SelfUtils.getRemoteMuted(self),
|
37
|
-
unmuteAllowed: SelfUtils.getUnmuteAllowed(self),
|
38
|
-
localAudioUnmuteRequested: SelfUtils.getLocalAudioUnmuteRequested(self),
|
39
|
-
localAudioUnmuteRequestedTimeStamp: SelfUtils.getLocalAudioUnmuteRequestedTimeStamp(self),
|
40
|
-
localAudioUnmuteRequired: SelfUtils.getLocalAudioUnmuteRequired(self),
|
41
|
-
lastModified: SelfUtils.getLastModified(self),
|
42
|
-
modifiedBy: SelfUtils.getModifiedBy(self),
|
43
|
-
guest: self.guest,
|
44
|
-
moderator: self.moderator,
|
45
|
-
// cumulative media stats
|
46
|
-
mediaStatus: SelfUtils.getStatus(self.status),
|
47
|
-
// TODO: what should be the status if user has refreshed the page,
|
48
|
-
// check the joinedWith parameter and communicate to the user
|
49
|
-
state: self.state,
|
50
|
-
// TODO: give a proper name . With same device as login or different login`
|
51
|
-
// Some times we might have joined with both mobile and web
|
52
|
-
joinedWith,
|
53
|
-
pstnDevices,
|
54
|
-
// current media stats is for the current device who has joined
|
55
|
-
currentMediaStatus: SelfUtils.getMediaStatus(joinedWith?.mediaSessions),
|
56
|
-
creator: self.isCreator, // check if its used,
|
57
|
-
selfId: self.id,
|
58
|
-
selfIdentity: SelfUtils.getSelfIdentity(self),
|
59
|
-
selfUrl: self.url,
|
60
|
-
removed: self.removed,
|
61
|
-
roles: SelfUtils.getRoles(self),
|
62
|
-
isUserUnadmitted: self.state === _IDLE_ && joinedWith?.intent?.type === _WAIT_,
|
63
|
-
layout: SelfUtils.getLayout(self),
|
64
|
-
canNotViewTheParticipantList: SelfUtils.canNotViewTheParticipantList(self),
|
65
|
-
isSharingBlocked: SelfUtils.isSharingBlocked(self),
|
66
|
-
breakoutSessions: SelfUtils.getBreakoutSessions(self),
|
67
|
-
breakout: SelfUtils.getBreakout(self),
|
68
|
-
interpretation: SelfUtils.getInterpretation(self),
|
69
|
-
brb: SelfUtils.getBrb(self),
|
70
|
-
};
|
71
|
-
}
|
73
|
+
return null;
|
74
|
+
},
|
72
75
|
|
73
|
-
|
74
|
-
|
76
|
+
getBreakoutSessions: (self) => self?.controls?.breakout?.sessions,
|
77
|
+
getBreakout: (self) => self?.controls?.breakout,
|
78
|
+
getInterpretation: (self) => self?.controls?.interpretation,
|
79
|
+
getBrb: (self) => self?.controls?.brb,
|
75
80
|
|
76
|
-
|
77
|
-
|
78
|
-
SelfUtils.getInterpretation = (self) => self?.controls?.interpretation;
|
79
|
-
SelfUtils.getBrb = (self) => self?.controls?.brb;
|
81
|
+
getLayout: (self) =>
|
82
|
+
Array.isArray(self?.controls?.layouts) ? self.controls.layouts[0].type : undefined,
|
80
83
|
|
81
|
-
|
82
|
-
|
84
|
+
getRoles: (self) =>
|
85
|
+
(self?.controls?.role?.roles || []).reduce((roles, role) => {
|
86
|
+
if (role.hasRole) {
|
87
|
+
roles.push(role.type);
|
88
|
+
}
|
83
89
|
|
84
|
-
|
85
|
-
|
86
|
-
if (role.hasRole) {
|
87
|
-
roles.push(role.type);
|
88
|
-
}
|
90
|
+
return roles;
|
91
|
+
}, []),
|
89
92
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
const previous = oldSelf && SelfUtils.parse(oldSelf, deviceId);
|
99
|
-
const current = newSelf && SelfUtils.parse(newSelf, deviceId);
|
100
|
-
const updates: any = {};
|
101
|
-
|
102
|
-
updates.isUserUnadmitted = SelfUtils.isUserUnadmitted(previous, current);
|
103
|
-
updates.isUserAdmitted = SelfUtils.isUserAdmitted(previous, current);
|
104
|
-
updates.isVideoMutedByOthersChanged = SelfUtils.videoMutedByOthersChanged(previous, current);
|
105
|
-
updates.isMutedByOthersChanged = SelfUtils.mutedByOthersChanged(previous, current);
|
106
|
-
updates.localAudioUnmuteRequestedByServer = SelfUtils.localAudioUnmuteRequestedByServer(
|
107
|
-
previous,
|
108
|
-
current
|
109
|
-
);
|
110
|
-
updates.localAudioUnmuteRequiredByServer = SelfUtils.localAudioUnmuteRequiredByServer(
|
111
|
-
previous,
|
112
|
-
current
|
113
|
-
);
|
114
|
-
updates.moderatorChanged = SelfUtils.moderatorChanged(previous, current);
|
115
|
-
updates.isRolesChanged = SelfUtils.isRolesChanged(previous, current);
|
116
|
-
updates.isMediaInactiveOrReleased = SelfUtils.wasMediaInactiveOrReleased(previous, current);
|
117
|
-
updates.isUserObserving = SelfUtils.isDeviceObserving(previous, current);
|
118
|
-
updates.layoutChanged = SelfUtils.layoutChanged(previous, current);
|
119
|
-
|
120
|
-
updates.isMediaInactive = SelfUtils.isMediaInactive(previous, current);
|
121
|
-
updates.audioStateChange =
|
122
|
-
previous?.currentMediaStatus.audio !== current.currentMediaStatus.audio;
|
123
|
-
updates.videoStateChange =
|
124
|
-
previous?.currentMediaStatus.video !== current.currentMediaStatus.video;
|
125
|
-
updates.shareStateChange =
|
126
|
-
previous?.currentMediaStatus.share !== current.currentMediaStatus.share;
|
127
|
-
|
128
|
-
updates.canNotViewTheParticipantListChanged =
|
129
|
-
previous?.canNotViewTheParticipantList !== current.canNotViewTheParticipantList;
|
130
|
-
updates.isSharingBlockedChanged = previous?.isSharingBlocked !== current.isSharingBlocked;
|
131
|
-
updates.breakoutsChanged = SelfUtils.breakoutsChanged(previous, current);
|
132
|
-
updates.interpretationChanged = SelfUtils.interpretationChanged(previous, current);
|
133
|
-
updates.brbChanged = SelfUtils.brbChanged(previous, current);
|
134
|
-
|
135
|
-
return {
|
136
|
-
previous,
|
137
|
-
current,
|
138
|
-
updates,
|
139
|
-
};
|
140
|
-
};
|
93
|
+
canNotViewTheParticipantList: (self) => !!self?.canNotViewTheParticipantList,
|
94
|
+
|
95
|
+
isSharingBlocked: (self) => !!self?.isSharingBlocked,
|
96
|
+
|
97
|
+
getSelves: (oldSelf, newSelf, deviceId) => {
|
98
|
+
const previous = oldSelf && SelfUtils.parse(oldSelf, deviceId);
|
99
|
+
const current = newSelf && SelfUtils.parse(newSelf, deviceId);
|
100
|
+
const updates: any = {};
|
141
101
|
|
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
|
-
previous
|
171
|
-
|
172
|
-
|
173
|
-
current
|
174
|
-
current.joinedWith &&
|
175
|
-
current.joinedWith.mediaSessions
|
176
|
-
) {
|
177
|
-
const previousMediaStatus = SelfUtils.getMediaStatus(previous.joinedWith.mediaSessions);
|
178
|
-
const currentMediaStatus = SelfUtils.getMediaStatus(current.joinedWith.mediaSessions);
|
102
|
+
updates.isUserUnadmitted = SelfUtils.isUserUnadmitted(previous, current);
|
103
|
+
updates.isUserAdmitted = SelfUtils.isUserAdmitted(previous, current);
|
104
|
+
updates.isVideoMutedByOthersChanged = SelfUtils.videoMutedByOthersChanged(previous, current);
|
105
|
+
updates.isMutedByOthersChanged = SelfUtils.mutedByOthersChanged(previous, current);
|
106
|
+
updates.localAudioUnmuteRequestedByServer = SelfUtils.localAudioUnmuteRequestedByServer(
|
107
|
+
previous,
|
108
|
+
current
|
109
|
+
);
|
110
|
+
updates.localAudioUnmuteRequiredByServer = SelfUtils.localAudioUnmuteRequiredByServer(
|
111
|
+
previous,
|
112
|
+
current
|
113
|
+
);
|
114
|
+
updates.moderatorChanged = SelfUtils.moderatorChanged(previous, current);
|
115
|
+
updates.isRolesChanged = SelfUtils.isRolesChanged(previous, current);
|
116
|
+
updates.isMediaInactiveOrReleased = SelfUtils.wasMediaInactiveOrReleased(previous, current);
|
117
|
+
updates.isUserObserving = SelfUtils.isDeviceObserving(previous, current);
|
118
|
+
updates.layoutChanged = SelfUtils.layoutChanged(previous, current);
|
119
|
+
|
120
|
+
updates.isMediaInactive = SelfUtils.isMediaInactive(previous, current);
|
121
|
+
updates.audioStateChange =
|
122
|
+
previous?.currentMediaStatus.audio !== current.currentMediaStatus.audio;
|
123
|
+
updates.videoStateChange =
|
124
|
+
previous?.currentMediaStatus.video !== current.currentMediaStatus.video;
|
125
|
+
updates.shareStateChange =
|
126
|
+
previous?.currentMediaStatus.share !== current.currentMediaStatus.share;
|
127
|
+
|
128
|
+
updates.canNotViewTheParticipantListChanged =
|
129
|
+
previous?.canNotViewTheParticipantList !== current.canNotViewTheParticipantList;
|
130
|
+
updates.isSharingBlockedChanged = previous?.isSharingBlocked !== current.isSharingBlocked;
|
131
|
+
updates.breakoutsChanged = SelfUtils.breakoutsChanged(previous, current);
|
132
|
+
updates.interpretationChanged = SelfUtils.interpretationChanged(previous, current);
|
133
|
+
updates.brbChanged = SelfUtils.brbChanged(previous, current);
|
179
134
|
|
135
|
+
return {
|
136
|
+
previous,
|
137
|
+
current,
|
138
|
+
updates,
|
139
|
+
};
|
140
|
+
},
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Checks if user has joined the meeting
|
144
|
+
* @param {Object} self
|
145
|
+
* @returns {boolean} isJoined
|
146
|
+
*/
|
147
|
+
isJoined: (self: any) => self?.state === _JOINED_,
|
148
|
+
|
149
|
+
/**
|
150
|
+
* Validate if the Meeting Layout Controls Layout has changed.
|
151
|
+
*
|
152
|
+
* @param {Self} previous - Previous self state
|
153
|
+
* @param {Self} current - Current self state [per event]
|
154
|
+
* @returns {boolean} - If the Meeting Layout Controls Layout has changed.
|
155
|
+
*/
|
156
|
+
layoutChanged: (previous: any, current: any) =>
|
157
|
+
current?.layout && previous?.layout !== current?.layout,
|
158
|
+
|
159
|
+
breakoutsChanged: (previous, current) =>
|
160
|
+
!isEqual(previous?.breakoutSessions, current?.breakoutSessions) && !!current?.breakout,
|
161
|
+
|
162
|
+
interpretationChanged: (previous, current) =>
|
163
|
+
!isEqual(previous?.interpretation, current?.interpretation) && !!current?.interpretation,
|
164
|
+
|
165
|
+
brbChanged: (previous, current) =>
|
166
|
+
!isEqual(previous?.brb, current?.brb) && current?.brb !== undefined,
|
167
|
+
|
168
|
+
isMediaInactive: (previous, current) => {
|
180
169
|
if (
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
170
|
+
previous &&
|
171
|
+
previous.joinedWith &&
|
172
|
+
previous.joinedWith.mediaSessions &&
|
173
|
+
current &&
|
174
|
+
current.joinedWith &&
|
175
|
+
current.joinedWith.mediaSessions
|
186
176
|
) {
|
187
|
-
|
177
|
+
const previousMediaStatus = SelfUtils.getMediaStatus(previous.joinedWith.mediaSessions);
|
178
|
+
const currentMediaStatus = SelfUtils.getMediaStatus(current.joinedWith.mediaSessions);
|
179
|
+
|
180
|
+
if (
|
181
|
+
previousMediaStatus.audio &&
|
182
|
+
currentMediaStatus.audio &&
|
183
|
+
previousMediaStatus.audio.state !== MEDIA_STATE.inactive &&
|
184
|
+
currentMediaStatus.audio.state === MEDIA_STATE.inactive &&
|
185
|
+
currentMediaStatus.audio.direction !== MEDIA_STATE.inactive
|
186
|
+
) {
|
187
|
+
return true;
|
188
|
+
}
|
189
|
+
|
190
|
+
if (
|
191
|
+
previousMediaStatus.video &&
|
192
|
+
currentMediaStatus.video &&
|
193
|
+
previousMediaStatus.video.state !== MEDIA_STATE.inactive &&
|
194
|
+
currentMediaStatus.video.state === MEDIA_STATE.inactive &&
|
195
|
+
currentMediaStatus.video.direction !== MEDIA_STATE.inactive
|
196
|
+
) {
|
197
|
+
return true;
|
198
|
+
}
|
199
|
+
|
200
|
+
if (
|
201
|
+
previousMediaStatus.share &&
|
202
|
+
currentMediaStatus.share &&
|
203
|
+
previousMediaStatus.share.state !== MEDIA_STATE.inactive &&
|
204
|
+
currentMediaStatus.share.state === MEDIA_STATE.inactive &&
|
205
|
+
currentMediaStatus.share.direction !== MEDIA_STATE.inactive
|
206
|
+
) {
|
207
|
+
return true;
|
208
|
+
}
|
209
|
+
|
210
|
+
return false;
|
188
211
|
}
|
189
212
|
|
213
|
+
return false;
|
214
|
+
},
|
215
|
+
|
216
|
+
getLastModified: (self) => {
|
190
217
|
if (
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
218
|
+
!self ||
|
219
|
+
!self.controls ||
|
220
|
+
!self.controls.audio ||
|
221
|
+
!self.controls.audio.meta ||
|
222
|
+
!self.controls.audio.meta.lastModified
|
196
223
|
) {
|
197
|
-
return
|
224
|
+
return null;
|
198
225
|
}
|
199
226
|
|
227
|
+
return self.controls.audio.meta.lastModified;
|
228
|
+
},
|
229
|
+
|
230
|
+
getModifiedBy: (self) => {
|
200
231
|
if (
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
232
|
+
!self ||
|
233
|
+
!self.controls ||
|
234
|
+
!self.controls.audio ||
|
235
|
+
!self.controls.audio.meta ||
|
236
|
+
!self.controls.audio.meta.modifiedBy
|
206
237
|
) {
|
207
|
-
return
|
238
|
+
return null;
|
208
239
|
}
|
209
240
|
|
210
|
-
return
|
211
|
-
}
|
241
|
+
return self.controls.audio.meta.modifiedBy;
|
242
|
+
},
|
243
|
+
|
244
|
+
/**
|
245
|
+
* get the id from the self object
|
246
|
+
* @param {Object} self
|
247
|
+
* @returns {String}
|
248
|
+
*/
|
249
|
+
getSelfIdentity: (self: any) => {
|
250
|
+
if (!self || !self.person) {
|
251
|
+
return null;
|
252
|
+
}
|
212
253
|
|
213
|
-
|
214
|
-
}
|
254
|
+
return self.person.id;
|
255
|
+
},
|
256
|
+
|
257
|
+
/**
|
258
|
+
* get the "remote video mute" property from the self object
|
259
|
+
* @param {Object} self
|
260
|
+
* @returns {Boolean}
|
261
|
+
*/
|
262
|
+
getRemoteVideoMuted: (self: any) => {
|
263
|
+
if (!self || !self.controls || !self.controls.video) {
|
264
|
+
return null;
|
265
|
+
}
|
215
266
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
267
|
+
return self.controls.video.muted;
|
268
|
+
},
|
269
|
+
|
270
|
+
/**
|
271
|
+
* get the "remote mute" property from the self object
|
272
|
+
* @param {Object} self
|
273
|
+
* @returns {Boolean}
|
274
|
+
*/
|
275
|
+
getRemoteMuted: (self: any) => {
|
276
|
+
if (!self || !self.controls || !self.controls.audio) {
|
277
|
+
return null;
|
278
|
+
}
|
226
279
|
|
227
|
-
|
228
|
-
}
|
280
|
+
return self.controls.audio.muted;
|
281
|
+
},
|
229
282
|
|
230
|
-
|
231
|
-
if (
|
232
|
-
!self ||
|
233
|
-
!self.controls ||
|
234
|
-
!self.controls.audio ||
|
235
|
-
!self.controls.audio.meta ||
|
236
|
-
!self.controls.audio.meta.modifiedBy
|
237
|
-
) {
|
238
|
-
return null;
|
239
|
-
}
|
283
|
+
getLocalAudioUnmuteRequested: (self) => !!self?.controls?.audio?.requestedToUnmute,
|
240
284
|
|
241
|
-
|
242
|
-
|
285
|
+
// requestedToUnmute timestamp
|
286
|
+
getLocalAudioUnmuteRequestedTimeStamp: (self) =>
|
287
|
+
Date.parse(self?.controls?.audio?.lastModifiedRequestedToUnmute) || 0,
|
243
288
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
*/
|
249
|
-
SelfUtils.getSelfIdentity = (self: any) => {
|
250
|
-
if (!self && !self.person) {
|
251
|
-
return null;
|
252
|
-
}
|
289
|
+
getUnmuteAllowed: (self) => {
|
290
|
+
if (!self || !self.controls || !self.controls.audio) {
|
291
|
+
return null;
|
292
|
+
}
|
253
293
|
|
254
|
-
|
255
|
-
}
|
294
|
+
return !self.controls.audio.disallowUnmute;
|
295
|
+
},
|
296
|
+
|
297
|
+
getLocalAudioUnmuteRequired: (self) => !!self?.controls?.audio?.localAudioUnmuteRequired,
|
298
|
+
|
299
|
+
getStatus: (status) => ({
|
300
|
+
audio: status.audioStatus,
|
301
|
+
video: status.videoStatus,
|
302
|
+
slides: status.videoSlidesStatus,
|
303
|
+
}),
|
304
|
+
|
305
|
+
/**
|
306
|
+
* @param {Object} oldSelf
|
307
|
+
* @param {Object} changedSelf
|
308
|
+
* @returns {Boolean}
|
309
|
+
*/
|
310
|
+
wasMediaInactiveOrReleased: (oldSelf: any = {}, changedSelf: any) =>
|
311
|
+
oldSelf.joinedWith &&
|
312
|
+
oldSelf.joinedWith.state === _JOINED_ &&
|
313
|
+
changedSelf.joinedWith &&
|
314
|
+
changedSelf.joinedWith.state === _LEFT_ &&
|
315
|
+
(changedSelf.joinedWith.reason === MEETING_END_REASON.INACTIVE ||
|
316
|
+
changedSelf.joinedWith.reason === MEETING_END_REASON.MEDIA_RELEASED),
|
317
|
+
|
318
|
+
/**
|
319
|
+
* @param {Object} check
|
320
|
+
* @returns {Boolean}
|
321
|
+
*/
|
322
|
+
isLocusUserUnadmitted: (check: any) =>
|
323
|
+
check && check.joinedWith?.intent?.type === _WAIT_ && check.state === _IDLE_,
|
324
|
+
|
325
|
+
/**
|
326
|
+
* @param {Object} check
|
327
|
+
* @returns {Boolean}
|
328
|
+
*/
|
329
|
+
isLocusUserAdmitted: (check: any) =>
|
330
|
+
check && check.joinedWith?.intent?.type !== _WAIT_ && check.state === _JOINED_,
|
331
|
+
|
332
|
+
/**
|
333
|
+
* @param {Object} oldSelf
|
334
|
+
* @param {Object} changedSelf
|
335
|
+
* @returns {Boolean}
|
336
|
+
* @throws {Error} when self is undefined
|
337
|
+
*/
|
338
|
+
isUserUnadmitted: (oldSelf: any, changedSelf: any) => {
|
339
|
+
if (!changedSelf) {
|
340
|
+
throw new ParameterError(
|
341
|
+
'changedSelf must be defined to determine if self is unadmitted as guest.'
|
342
|
+
);
|
343
|
+
}
|
256
344
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
* @returns {Boolean}
|
261
|
-
*/
|
262
|
-
SelfUtils.getRemoteVideoMuted = (self: any) => {
|
263
|
-
if (!self || !self.controls || !self.controls.video) {
|
264
|
-
return null;
|
265
|
-
}
|
345
|
+
if (SelfUtils.isLocusUserUnadmitted(oldSelf)) {
|
346
|
+
return false;
|
347
|
+
}
|
266
348
|
|
267
|
-
|
268
|
-
}
|
349
|
+
return SelfUtils.isLocusUserUnadmitted(changedSelf);
|
350
|
+
},
|
269
351
|
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
352
|
+
moderatorChanged: (oldSelf, changedSelf) => {
|
353
|
+
if (!oldSelf) {
|
354
|
+
return true;
|
355
|
+
}
|
356
|
+
if (!changedSelf) {
|
357
|
+
throw new ParameterError(
|
358
|
+
'New self must be defined to determine if self transitioned moderator status.'
|
359
|
+
);
|
360
|
+
}
|
279
361
|
|
280
|
-
|
281
|
-
}
|
362
|
+
return oldSelf.moderator !== changedSelf.moderator;
|
363
|
+
},
|
364
|
+
|
365
|
+
/**
|
366
|
+
* determine whether the roles of self is changed or not
|
367
|
+
* @param {Object} oldSelf
|
368
|
+
* @param {Object} changedSelf
|
369
|
+
* @returns {Boolean}
|
370
|
+
*/
|
371
|
+
isRolesChanged: (oldSelf, changedSelf) => {
|
372
|
+
if (!changedSelf) {
|
373
|
+
// no new self means no change
|
374
|
+
return false;
|
375
|
+
}
|
282
376
|
|
283
|
-
|
377
|
+
return !isEqual(oldSelf?.roles, changedSelf?.roles);
|
378
|
+
},
|
379
|
+
/**
|
380
|
+
* @param {Object} oldSelf
|
381
|
+
* @param {Object} changedSelf
|
382
|
+
* @returns {Boolean}
|
383
|
+
* @throws {Error} if changed self was undefined
|
384
|
+
*/
|
385
|
+
isDeviceObserving: (oldSelf: any, changedSelf: any) =>
|
386
|
+
oldSelf &&
|
387
|
+
oldSelf.joinedWith?.intent?.type === _MOVE_MEDIA_ &&
|
388
|
+
changedSelf &&
|
389
|
+
changedSelf.joinedWith?.intent?.type === _OBSERVE_,
|
390
|
+
|
391
|
+
/**
|
392
|
+
* @param {Object} oldSelf
|
393
|
+
* @param {Object} changedSelf
|
394
|
+
* @returns {Boolean}
|
395
|
+
* @throws {Error} if changed self was undefined
|
396
|
+
*/
|
397
|
+
isUserAdmitted: (oldSelf: object, changedSelf: object) => {
|
398
|
+
if (!oldSelf) {
|
399
|
+
// if there was no previous locus, it couldn't have been admitted yet
|
400
|
+
return false;
|
401
|
+
}
|
402
|
+
if (!changedSelf) {
|
403
|
+
throw new ParameterError(
|
404
|
+
'New self must be defined to determine if self transitioned to admitted as guest.'
|
405
|
+
);
|
406
|
+
}
|
284
407
|
|
285
|
-
|
286
|
-
|
287
|
-
Date.parse(self?.controls?.audio?.lastModifiedRequestedToUnmute) || 0;
|
408
|
+
return SelfUtils.isLocusUserUnadmitted(oldSelf) && SelfUtils.isLocusUserAdmitted(changedSelf);
|
409
|
+
},
|
288
410
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
411
|
+
videoMutedByOthersChanged: (oldSelf, changedSelf) => {
|
412
|
+
if (!changedSelf) {
|
413
|
+
throw new ParameterError(
|
414
|
+
'New self must be defined to determine if self was video muted by others.'
|
415
|
+
);
|
416
|
+
}
|
293
417
|
|
294
|
-
|
295
|
-
|
418
|
+
if (!oldSelf || oldSelf.remoteVideoMuted === null) {
|
419
|
+
if (changedSelf.remoteVideoMuted) {
|
420
|
+
return true; // this happens when host disables "Allow start video"
|
421
|
+
}
|
296
422
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
audio: status.audioStatus,
|
301
|
-
video: status.videoStatus,
|
302
|
-
slides: status.videoSlidesStatus,
|
303
|
-
});
|
304
|
-
|
305
|
-
/**
|
306
|
-
* @param {Object} oldSelf
|
307
|
-
* @param {Object} changedSelf
|
308
|
-
* @returns {Boolean}
|
309
|
-
*/
|
310
|
-
SelfUtils.wasMediaInactiveOrReleased = (oldSelf: any = {}, changedSelf: any) =>
|
311
|
-
oldSelf.joinedWith &&
|
312
|
-
oldSelf.joinedWith.state === _JOINED_ &&
|
313
|
-
changedSelf.joinedWith &&
|
314
|
-
changedSelf.joinedWith.state === _LEFT_ &&
|
315
|
-
(changedSelf.joinedWith.reason === MEETING_END_REASON.INACTIVE ||
|
316
|
-
changedSelf.joinedWith.reason === MEETING_END_REASON.MEDIA_RELEASED);
|
317
|
-
|
318
|
-
/**
|
319
|
-
* @param {Object} check
|
320
|
-
* @returns {Boolean}
|
321
|
-
*/
|
322
|
-
SelfUtils.isLocusUserUnadmitted = (check: any) =>
|
323
|
-
check && check.joinedWith?.intent?.type === _WAIT_ && check.state === _IDLE_;
|
324
|
-
|
325
|
-
/**
|
326
|
-
* @param {Object} check
|
327
|
-
* @returns {Boolean}
|
328
|
-
*/
|
329
|
-
SelfUtils.isLocusUserAdmitted = (check: any) =>
|
330
|
-
check && check.joinedWith?.intent?.type !== _WAIT_ && check.state === _JOINED_;
|
331
|
-
|
332
|
-
/**
|
333
|
-
* @param {Object} oldSelf
|
334
|
-
* @param {Object} changedSelf
|
335
|
-
* @returns {Boolean}
|
336
|
-
* @throws {Error} when self is undefined
|
337
|
-
*/
|
338
|
-
SelfUtils.isUserUnadmitted = (oldSelf: object, changedSelf: object) => {
|
339
|
-
if (!changedSelf) {
|
340
|
-
throw new ParameterError(
|
341
|
-
'changedSelf must be defined to determine if self is unadmitted as guest.'
|
342
|
-
);
|
343
|
-
}
|
423
|
+
// we don't want to be sending the 'meeting:self:videoUnmutedByOthers' notification on meeting join
|
424
|
+
return false;
|
425
|
+
}
|
344
426
|
|
345
|
-
|
346
|
-
|
347
|
-
}
|
427
|
+
return oldSelf.remoteVideoMuted !== changedSelf.remoteVideoMuted;
|
428
|
+
},
|
348
429
|
|
349
|
-
|
350
|
-
|
430
|
+
mutedByOthersChanged: (oldSelf, changedSelf) => {
|
431
|
+
if (!changedSelf) {
|
432
|
+
throw new ParameterError(
|
433
|
+
'New self must be defined to determine if self was muted by others.'
|
434
|
+
);
|
435
|
+
}
|
351
436
|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
if (!changedSelf) {
|
357
|
-
throw new ParameterError(
|
358
|
-
'New self must be defined to determine if self transitioned moderator status.'
|
359
|
-
);
|
360
|
-
}
|
437
|
+
if (!oldSelf || oldSelf.remoteMuted === null) {
|
438
|
+
if (changedSelf.remoteMuted) {
|
439
|
+
return true; // this happens when mute on-entry is enabled
|
440
|
+
}
|
361
441
|
|
362
|
-
|
363
|
-
|
442
|
+
// we don't want to be sending the 'meeting:self:unmutedByOthers' notification on meeting join
|
443
|
+
return false;
|
444
|
+
}
|
364
445
|
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
* @returns {Boolean}
|
370
|
-
*/
|
371
|
-
SelfUtils.isRolesChanged = (oldSelf, changedSelf) => {
|
372
|
-
if (!changedSelf) {
|
373
|
-
// no new self means no change
|
374
|
-
return false;
|
375
|
-
}
|
446
|
+
// there is no need to trigger user update if no one muted user
|
447
|
+
if (changedSelf.selfIdentity === changedSelf.modifiedBy) {
|
448
|
+
return false;
|
449
|
+
}
|
376
450
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
* @param {Object} changedSelf
|
382
|
-
* @returns {Boolean}
|
383
|
-
* @throws {Error} if changed self was undefined
|
384
|
-
*/
|
385
|
-
SelfUtils.isDeviceObserving = (oldSelf: any, changedSelf: any) =>
|
386
|
-
oldSelf &&
|
387
|
-
oldSelf.joinedWith?.intent?.type === _MOVE_MEDIA_ &&
|
388
|
-
changedSelf &&
|
389
|
-
changedSelf.joinedWith?.intent?.type === _OBSERVE_;
|
390
|
-
|
391
|
-
/**
|
392
|
-
* @param {Object} oldSelf
|
393
|
-
* @param {Object} changedSelf
|
394
|
-
* @returns {Boolean}
|
395
|
-
* @throws {Error} if changed self was undefined
|
396
|
-
*/
|
397
|
-
SelfUtils.isUserAdmitted = (oldSelf: object, changedSelf: object) => {
|
398
|
-
if (!oldSelf) {
|
399
|
-
// if there was no previous locus, it couldn't have been admitted yet
|
400
|
-
return false;
|
401
|
-
}
|
402
|
-
if (!changedSelf) {
|
403
|
-
throw new ParameterError(
|
404
|
-
'New self must be defined to determine if self transitioned to admitted as guest.'
|
451
|
+
return (
|
452
|
+
changedSelf.remoteMuted !== null &&
|
453
|
+
(oldSelf.remoteMuted !== changedSelf.remoteMuted ||
|
454
|
+
(changedSelf.remoteMuted && oldSelf.unmuteAllowed !== changedSelf.unmuteAllowed))
|
405
455
|
);
|
406
|
-
}
|
456
|
+
},
|
407
457
|
|
408
|
-
|
409
|
-
|
458
|
+
localAudioUnmuteRequestedByServer: (oldSelf: any = {}, changedSelf: any) => {
|
459
|
+
if (!changedSelf) {
|
460
|
+
throw new ParameterError(
|
461
|
+
'New self must be defined to determine if self received request to unmute.'
|
462
|
+
);
|
463
|
+
}
|
410
464
|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
'New self must be defined to determine if self was video muted by others.'
|
465
|
+
return (
|
466
|
+
changedSelf.localAudioUnmuteRequested &&
|
467
|
+
changedSelf.localAudioUnmuteRequestedTimeStamp > oldSelf.localAudioUnmuteRequestedTimeStamp
|
415
468
|
);
|
416
|
-
}
|
469
|
+
},
|
417
470
|
|
418
|
-
|
419
|
-
if (changedSelf
|
420
|
-
|
471
|
+
localAudioUnmuteRequiredByServer: (oldSelf: any = {}, changedSelf: any) => {
|
472
|
+
if (!changedSelf) {
|
473
|
+
throw new ParameterError(
|
474
|
+
'New self must be defined to determine if localAudioUnmuteRequired changed.'
|
475
|
+
);
|
421
476
|
}
|
422
477
|
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
}
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
478
|
+
return (
|
479
|
+
!changedSelf.remoteMuted &&
|
480
|
+
changedSelf.localAudioUnmuteRequired &&
|
481
|
+
oldSelf.localAudioUnmuteRequired !== changedSelf.localAudioUnmuteRequired
|
482
|
+
);
|
483
|
+
},
|
484
|
+
|
485
|
+
/**
|
486
|
+
* extract the sipUrl from the partner
|
487
|
+
* @param {Object} partner
|
488
|
+
* @param {Object} info
|
489
|
+
* @returns {Object}
|
490
|
+
*/
|
491
|
+
|
492
|
+
getSipUrl: (partner: any, type, sipUri) => {
|
493
|
+
// For webex meeting the sipUrl gets updated in info parser
|
494
|
+
if (partner && type === _CALL_) {
|
495
|
+
return {sipUri: partner.person.sipUrl || partner.person.id};
|
438
496
|
}
|
439
497
|
|
440
|
-
|
441
|
-
|
442
|
-
}
|
443
|
-
|
444
|
-
// there is no need to trigger user update if no one muted user
|
445
|
-
if (changedSelf.selfIdentity === changedSelf.modifiedBy) {
|
446
|
-
return false;
|
447
|
-
}
|
498
|
+
return {sipUri};
|
499
|
+
},
|
448
500
|
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
};
|
501
|
+
getMediaStatus: (mediaSessions = []): {audio: any; video: any; share: any} => {
|
502
|
+
const mediaStatus = {
|
503
|
+
audio: {},
|
504
|
+
video: {},
|
505
|
+
share: {},
|
506
|
+
};
|
455
507
|
|
456
|
-
|
457
|
-
|
458
|
-
throw new ParameterError(
|
459
|
-
'New self must be defined to determine if self received request to unmute.'
|
508
|
+
mediaStatus.audio = mediaSessions.find(
|
509
|
+
(media) => media.mediaType === AUDIO && media.mediaContent === MediaContent.main
|
460
510
|
);
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
);
|
467
|
-
};
|
468
|
-
|
469
|
-
SelfUtils.localAudioUnmuteRequiredByServer = (oldSelf: any = {}, changedSelf: any) => {
|
470
|
-
if (!changedSelf) {
|
471
|
-
throw new ParameterError(
|
472
|
-
'New self must be defined to determine if localAudioUnmuteRequired changed.'
|
511
|
+
mediaStatus.video = mediaSessions.find(
|
512
|
+
(media) => media.mediaType === VIDEO && media.mediaContent === MediaContent.main
|
513
|
+
);
|
514
|
+
mediaStatus.share = mediaSessions.find(
|
515
|
+
(media) => media.mediaType === VIDEO && media.mediaContent === MediaContent.slides
|
473
516
|
);
|
474
|
-
}
|
475
|
-
|
476
|
-
return (
|
477
|
-
!changedSelf.remoteMuted &&
|
478
|
-
changedSelf.localAudioUnmuteRequired &&
|
479
|
-
oldSelf.localAudioUnmuteRequired !== changedSelf.localAudioUnmuteRequired
|
480
|
-
);
|
481
|
-
};
|
482
|
-
|
483
|
-
/**
|
484
|
-
* extract the sipUrl from the partner
|
485
|
-
* @param {Object} partner
|
486
|
-
* @param {Object} info
|
487
|
-
* @returns {Object}
|
488
|
-
*/
|
489
|
-
|
490
|
-
SelfUtils.getSipUrl = (partner: any, type, sipUri) => {
|
491
|
-
// For webex meeting the sipUrl gets updated in info parser
|
492
|
-
if (partner && type === _CALL_) {
|
493
|
-
return {sipUri: partner.person.sipUrl || partner.person.id};
|
494
|
-
}
|
495
|
-
|
496
|
-
return {sipUri};
|
497
|
-
};
|
498
517
|
|
499
|
-
|
500
|
-
|
501
|
-
audio: {},
|
502
|
-
video: {},
|
503
|
-
share: {},
|
504
|
-
};
|
505
|
-
|
506
|
-
mediaStatus.audio = mediaSessions.find(
|
507
|
-
(media) => media.mediaType === AUDIO && media.mediaContent === MediaContent.main
|
508
|
-
);
|
509
|
-
mediaStatus.video = mediaSessions.find(
|
510
|
-
(media) => media.mediaType === VIDEO && media.mediaContent === MediaContent.main
|
511
|
-
);
|
512
|
-
mediaStatus.share = mediaSessions.find(
|
513
|
-
(media) => media.mediaType === VIDEO && media.mediaContent === MediaContent.slides
|
514
|
-
);
|
515
|
-
|
516
|
-
return mediaStatus;
|
517
|
-
};
|
518
|
+
return mediaStatus;
|
519
|
+
},
|
518
520
|
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
521
|
+
getReplacedBreakoutMoveId: (self: any, deviceId: string) => {
|
522
|
+
if (self && Array.isArray(self.devices)) {
|
523
|
+
const joinedDevice = self.devices.find((device) => deviceId === device.url);
|
524
|
+
if (Array.isArray(joinedDevice?.replaces)) {
|
525
|
+
return joinedDevice.replaces[0]?.breakoutMoveId;
|
526
|
+
}
|
524
527
|
}
|
525
|
-
}
|
526
528
|
|
527
|
-
|
529
|
+
return null;
|
530
|
+
},
|
528
531
|
};
|
532
|
+
|
529
533
|
export default SelfUtils;
|