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