@webex/plugin-meetings 3.7.0 → 3.8.0
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/annotation/annotation.types.d.ts +42 -0
- package/dist/annotation/constants.d.ts +31 -0
- package/dist/annotation/index.d.ts +117 -0
- package/dist/annotation/index.js +17 -0
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.d.ts +8 -0
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/collection.d.ts +5 -0
- package/dist/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/breakouts/events.d.ts +8 -0
- package/dist/breakouts/index.d.ts +5 -0
- package/dist/breakouts/index.js +1 -1
- package/dist/breakouts/request.d.ts +22 -0
- package/dist/breakouts/utils.d.ts +15 -0
- package/dist/common/browser-detection.d.ts +9 -0
- package/dist/common/collection.d.ts +48 -0
- package/dist/common/config.d.ts +2 -0
- package/dist/common/errors/captcha-error.d.ts +15 -0
- package/dist/common/errors/intent-to-join.d.ts +16 -0
- package/dist/common/errors/join-forbidden-error.js +52 -0
- package/dist/common/errors/join-forbidden-error.js.map +1 -0
- package/dist/common/errors/join-meeting.d.ts +17 -0
- package/dist/common/errors/{webinar-registration-error.js → join-webinar-error.js} +12 -12
- package/dist/common/errors/join-webinar-error.js.map +1 -0
- package/dist/common/errors/media.d.ts +15 -0
- package/dist/common/errors/multistream-not-supported-error.js +53 -0
- package/dist/common/errors/multistream-not-supported-error.js.map +1 -0
- package/dist/common/errors/no-meeting-info.d.ts +14 -0
- package/dist/common/errors/parameter.d.ts +15 -0
- package/dist/common/errors/password-error.d.ts +15 -0
- package/dist/common/errors/permission.d.ts +14 -0
- package/dist/common/errors/reclaim-host-role-error.js +149 -0
- package/dist/common/errors/reclaim-host-role-error.js.map +1 -0
- package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
- package/dist/common/errors/reconnection-in-progress.d.ts +9 -0
- package/dist/common/errors/reconnection-in-progress.js +33 -0
- package/dist/common/errors/reconnection-in-progress.js.map +1 -0
- package/dist/common/errors/reconnection.d.ts +15 -0
- package/dist/common/errors/stats.d.ts +15 -0
- package/dist/common/errors/webex-errors.d.ts +93 -0
- package/dist/common/errors/webex-meetings-error.d.ts +20 -0
- package/dist/common/events/events-scope.d.ts +17 -0
- package/dist/common/events/events.d.ts +12 -0
- package/dist/common/events/trigger-proxy.d.ts +2 -0
- package/dist/common/events/util.d.ts +2 -0
- package/dist/common/logs/logger-config.d.ts +2 -0
- package/dist/common/logs/logger-proxy.d.ts +2 -0
- package/dist/common/logs/request.d.ts +36 -0
- package/dist/common/queue.d.ts +34 -0
- package/dist/config.d.ts +72 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +1088 -0
- package/dist/constants.js +68 -6
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.d.ts +4 -0
- package/dist/controls-options-manager/enums.d.ts +15 -0
- package/dist/controls-options-manager/index.d.ts +136 -0
- package/dist/controls-options-manager/types.d.ts +43 -0
- package/dist/controls-options-manager/util.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.d.ts +2 -0
- package/dist/interceptors/locusRetry.d.ts +27 -0
- package/dist/interpretation/collection.d.ts +5 -0
- package/dist/interpretation/index.d.ts +5 -0
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.d.ts +5 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.d.ts +2 -0
- package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
- package/dist/locus-info/fullState.d.ts +2 -0
- package/dist/locus-info/hostUtils.d.ts +2 -0
- package/dist/locus-info/index.d.ts +322 -0
- package/dist/locus-info/index.js +14 -3
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.d.ts +2 -0
- package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
- package/dist/locus-info/parser.d.ts +272 -0
- package/dist/locus-info/selfUtils.d.ts +2 -0
- package/dist/locus-info/selfUtils.js +35 -17
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +1 -0
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.d.ts +34 -0
- package/dist/media/properties.d.ts +93 -0
- package/dist/media/properties.js +30 -16
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.d.ts +2 -0
- package/dist/mediaQualityMetrics/config.d.ts +241 -0
- package/dist/mediaQualityMetrics/config.js +502 -0
- package/dist/mediaQualityMetrics/config.js.map +1 -0
- package/dist/meeting/brbState.js +167 -0
- package/dist/meeting/brbState.js.map +1 -0
- package/dist/meeting/effectsState.js +260 -0
- package/dist/meeting/effectsState.js.map +1 -0
- package/dist/meeting/in-meeting-actions.d.ts +167 -0
- package/dist/meeting/in-meeting-actions.js +13 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.d.ts +1825 -0
- package/dist/meeting/index.js +1331 -1051
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.d.ts +74 -0
- package/dist/meeting/locusMediaRequest.js +11 -6
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.d.ts +178 -0
- package/dist/meeting/muteState.js +1 -6
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.d.ts +295 -0
- package/dist/meeting/request.js +51 -29
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.d.ts +11 -0
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/state.d.ts +9 -0
- package/dist/meeting/util.d.ts +119 -0
- package/dist/meeting/util.js +103 -67
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.d.ts +16 -0
- package/dist/meeting-info/collection.d.ts +20 -0
- package/dist/meeting-info/index.d.ts +69 -0
- package/dist/meeting-info/meeting-info-v2.d.ts +123 -0
- package/dist/meeting-info/meeting-info-v2.js +115 -45
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.d.ts +22 -0
- package/dist/meeting-info/util.d.ts +2 -0
- package/dist/meeting-info/utilv2.d.ts +2 -0
- package/dist/meeting-info/utilv2.js +6 -2
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.d.ts +40 -0
- package/dist/meetings/index.d.ts +390 -0
- package/dist/meetings/index.js +107 -55
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.d.ts +4 -0
- package/dist/meetings/meetings.types.js +2 -0
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.d.ts +27 -0
- package/dist/meetings/util.d.ts +18 -0
- package/dist/meetings/util.js +1 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.d.ts +160 -0
- package/dist/member/index.js +9 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/member.types.js +17 -0
- package/dist/member/member.types.js.map +1 -0
- package/dist/member/types.d.ts +32 -0
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.d.ts +2 -0
- package/dist/member/util.js +39 -28
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.d.ts +29 -0
- package/dist/members/index.d.ts +353 -0
- package/dist/members/request.d.ts +114 -0
- package/dist/members/types.d.ts +25 -0
- package/dist/members/util.d.ts +215 -0
- package/dist/members/util.js +4 -2
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +276 -0
- package/dist/metrics/config.js.map +1 -0
- package/dist/metrics/constants.d.ts +70 -0
- package/dist/metrics/constants.js +6 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.d.ts +45 -0
- package/dist/multistream/mediaRequestManager.d.ts +119 -0
- package/dist/multistream/receiveSlot.d.ts +68 -0
- package/dist/multistream/receiveSlotManager.d.ts +56 -0
- package/dist/multistream/remoteMedia.d.ts +72 -0
- package/dist/multistream/remoteMedia.js +30 -15
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.d.ts +49 -0
- package/dist/multistream/remoteMediaManager.d.ts +300 -0
- package/dist/multistream/sendSlotManager.d.ts +69 -0
- package/dist/multistream/sendSlotManager.js +24 -0
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.d.ts +70 -0
- package/dist/networkQualityMonitor/index.js +13 -19
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +671 -0
- package/dist/peer-connection-manager/index.js.map +1 -0
- package/dist/peer-connection-manager/util.js +109 -0
- package/dist/peer-connection-manager/util.js.map +1 -0
- package/dist/personal-meeting-room/index.d.ts +47 -0
- package/dist/personal-meeting-room/request.d.ts +14 -0
- package/dist/personal-meeting-room/util.d.ts +2 -0
- package/dist/reachability/clusterReachability.d.ts +109 -0
- package/dist/reachability/clusterReachability.js +12 -15
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.d.ts +105 -0
- package/dist/reachability/index.js +461 -136
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +7 -0
- package/dist/reachability/reachability.types.js.map +1 -0
- package/dist/reachability/request.d.ts +39 -0
- package/dist/reachability/request.js +21 -8
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.d.ts +8 -0
- package/dist/reactions/constants.d.ts +3 -0
- package/dist/reactions/reactions.d.ts +4 -0
- package/dist/reactions/reactions.type.d.ts +52 -0
- package/dist/reconnection-manager/index.d.ts +136 -0
- package/dist/recording-controller/enums.d.ts +7 -0
- package/dist/recording-controller/enums.js +8 -4
- package/dist/recording-controller/enums.js.map +1 -1
- package/dist/recording-controller/index.d.ts +207 -0
- package/dist/recording-controller/index.js +18 -9
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.d.ts +14 -0
- package/dist/recording-controller/util.js +13 -9
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/collection.js +62 -0
- package/dist/roap/collection.js.map +1 -0
- package/dist/roap/handler.js +275 -0
- package/dist/roap/handler.js.map +1 -0
- package/dist/roap/index.d.ts +86 -0
- package/dist/roap/index.js +15 -15
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.d.ts +39 -0
- package/dist/roap/request.js +45 -79
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js +126 -0
- package/dist/roap/state.js.map +1 -0
- package/dist/roap/turnDiscovery.d.ts +155 -0
- package/dist/roap/turnDiscovery.js +3 -6
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js +75 -0
- package/dist/roap/util.js.map +1 -0
- package/dist/rtcMetrics/constants.d.ts +4 -0
- package/dist/rtcMetrics/index.d.ts +61 -0
- package/dist/statsAnalyzer/global.d.ts +36 -0
- package/dist/statsAnalyzer/global.js +126 -0
- package/dist/statsAnalyzer/global.js.map +1 -0
- package/dist/statsAnalyzer/index.d.ts +217 -0
- package/dist/statsAnalyzer/index.js +1013 -0
- package/dist/statsAnalyzer/index.js.map +1 -0
- package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
- package/dist/statsAnalyzer/mqaUtil.js +179 -0
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -0
- package/dist/transcription/index.d.ts +64 -0
- package/dist/types/annotation/index.d.ts +5 -0
- package/dist/types/common/errors/join-forbidden-error.d.ts +15 -0
- package/dist/types/common/errors/{webinar-registration-error.d.ts → join-webinar-error.d.ts} +2 -2
- package/dist/types/common/errors/multistream-not-supported-error.d.ts +17 -0
- package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/constants.d.ts +53 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/locus-info/index.d.ts +2 -1
- package/dist/types/mediaQualityMetrics/config.d.ts +241 -0
- package/dist/types/meeting/brbState.d.ts +54 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +12 -0
- package/dist/types/meeting/index.d.ts +64 -14
- package/dist/types/meeting/locusMediaRequest.d.ts +6 -3
- package/dist/types/meeting/request.d.ts +14 -3
- package/dist/types/meeting/request.type.d.ts +6 -0
- package/dist/types/meeting/util.d.ts +3 -3
- package/dist/types/meeting-info/meeting-info-v2.d.ts +30 -5
- package/dist/types/meetings/index.d.ts +20 -2
- package/dist/types/meetings/meetings.types.d.ts +8 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +7 -0
- package/dist/types/members/util.d.ts +2 -0
- package/dist/types/metrics/constants.d.ts +6 -1
- package/dist/types/multistream/sendSlotManager.d.ts +8 -1
- package/dist/types/reachability/clusterReachability.d.ts +1 -10
- package/dist/types/reachability/index.d.ts +83 -36
- package/dist/types/reachability/reachability.types.d.ts +64 -0
- package/dist/types/reachability/request.d.ts +5 -1
- package/dist/types/recording-controller/enums.d.ts +5 -2
- package/dist/types/recording-controller/index.d.ts +1 -0
- package/dist/types/recording-controller/util.d.ts +2 -1
- package/dist/types/roap/request.d.ts +1 -13
- package/dist/types/statsAnalyzer/global.d.ts +36 -0
- package/dist/types/statsAnalyzer/index.d.ts +217 -0
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
- package/dist/webinar/collection.d.ts +16 -0
- package/dist/webinar/index.d.ts +5 -0
- package/dist/webinar/index.js +390 -7
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -22
- package/src/annotation/index.ts +16 -0
- package/src/common/errors/join-forbidden-error.ts +26 -0
- package/src/common/errors/join-webinar-error.ts +24 -0
- package/src/common/errors/multistream-not-supported-error.ts +30 -0
- package/src/config.ts +1 -0
- package/src/constants.ts +61 -3
- package/src/index.ts +5 -3
- package/src/locus-info/index.ts +20 -3
- package/src/locus-info/selfUtils.ts +24 -6
- package/src/media/MediaConnectionAwaiter.ts +2 -0
- package/src/media/properties.ts +34 -13
- package/src/meeting/brbState.ts +169 -0
- package/src/meeting/in-meeting-actions.ts +25 -0
- package/src/meeting/index.ts +443 -87
- package/src/meeting/locusMediaRequest.ts +11 -8
- package/src/meeting/muteState.ts +1 -6
- package/src/meeting/request.ts +30 -12
- package/src/meeting/request.type.ts +7 -0
- package/src/meeting/util.ts +32 -13
- package/src/meeting-info/meeting-info-v2.ts +83 -12
- package/src/meeting-info/utilv2.ts +17 -3
- package/src/meetings/index.ts +79 -20
- package/src/meetings/meetings.types.ts +10 -0
- package/src/meetings/util.ts +2 -1
- package/src/member/index.ts +9 -0
- package/src/member/types.ts +8 -0
- package/src/member/util.ts +34 -24
- package/src/members/util.ts +1 -0
- package/src/metrics/constants.ts +6 -1
- package/src/multistream/remoteMedia.ts +28 -15
- package/src/multistream/sendSlotManager.ts +31 -0
- package/src/reachability/clusterReachability.ts +5 -15
- package/src/reachability/index.ts +311 -75
- package/src/reachability/reachability.types.ts +85 -0
- package/src/reachability/request.ts +55 -31
- package/src/recording-controller/enums.ts +5 -2
- package/src/recording-controller/index.ts +17 -4
- package/src/recording-controller/util.ts +20 -5
- package/src/roap/index.ts +14 -13
- package/src/roap/request.ts +30 -44
- package/src/roap/turnDiscovery.ts +2 -4
- package/src/webinar/index.ts +235 -9
- package/test/unit/spec/annotation/index.ts +46 -1
- package/test/unit/spec/locus-info/index.js +292 -60
- package/test/unit/spec/locus-info/selfConstant.js +7 -0
- package/test/unit/spec/locus-info/selfUtils.js +101 -1
- package/test/unit/spec/media/properties.ts +15 -0
- package/test/unit/spec/meeting/brbState.ts +114 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +15 -1
- package/test/unit/spec/meeting/index.js +851 -107
- package/test/unit/spec/meeting/locusMediaRequest.ts +18 -11
- package/test/unit/spec/meeting/muteState.js +0 -24
- package/test/unit/spec/meeting/request.js +3 -26
- package/test/unit/spec/meeting/utils.js +73 -28
- package/test/unit/spec/meeting-info/meetinginfov2.js +46 -4
- package/test/unit/spec/meeting-info/utilv2.js +26 -0
- package/test/unit/spec/meetings/index.js +159 -18
- package/test/unit/spec/meetings/utils.js +10 -0
- package/test/unit/spec/member/util.js +52 -11
- package/test/unit/spec/members/utils.js +95 -0
- package/test/unit/spec/multistream/remoteMedia.ts +11 -7
- package/test/unit/spec/reachability/clusterReachability.ts +7 -0
- package/test/unit/spec/reachability/index.ts +383 -9
- package/test/unit/spec/reachability/request.js +48 -12
- package/test/unit/spec/recording-controller/index.js +61 -5
- package/test/unit/spec/recording-controller/util.js +39 -3
- package/test/unit/spec/roap/index.ts +48 -1
- package/test/unit/spec/roap/request.ts +51 -109
- package/test/unit/spec/roap/turnDiscovery.ts +202 -147
- package/test/unit/spec/webinar/index.ts +504 -0
- package/dist/common/errors/webinar-registration-error.js.map +0 -1
- package/src/common/errors/webinar-registration-error.ts +0 -27
@@ -0,0 +1,30 @@
|
|
1
|
+
import {ERROR_DICTIONARY} from '../../constants';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Error thrown when we try to do multistream, but fail. This error
|
5
|
+
* is not exported outside of plugin-meetings, because it's handled
|
6
|
+
* internally.
|
7
|
+
*/
|
8
|
+
export default class MultistreamNotSupportedError extends Error {
|
9
|
+
code: any;
|
10
|
+
error: any;
|
11
|
+
sdkMessage: any;
|
12
|
+
|
13
|
+
/**
|
14
|
+
*
|
15
|
+
* @constructor
|
16
|
+
* @param {String} [message]
|
17
|
+
* @param {Object} [error]
|
18
|
+
*/
|
19
|
+
constructor(
|
20
|
+
message: string = ERROR_DICTIONARY.MULTISTREAM_NOT_SUPPORTED.MESSAGE,
|
21
|
+
error: any = null
|
22
|
+
) {
|
23
|
+
super(message);
|
24
|
+
this.name = ERROR_DICTIONARY.MULTISTREAM_NOT_SUPPORTED.NAME;
|
25
|
+
this.sdkMessage = ERROR_DICTIONARY.MULTISTREAM_NOT_SUPPORTED.MESSAGE;
|
26
|
+
this.error = error;
|
27
|
+
this.stack = error ? error.stack : new Error().stack;
|
28
|
+
this.code = ERROR_DICTIONARY.MULTISTREAM_NOT_SUPPORTED.CODE;
|
29
|
+
}
|
30
|
+
}
|
package/src/config.ts
CHANGED
@@ -96,5 +96,6 @@ export default {
|
|
96
96
|
iceCandidatesGatheringTimeout: undefined,
|
97
97
|
backendIpv6NativeSupport: false,
|
98
98
|
reachabilityGetClusterTimeout: 5000,
|
99
|
+
logUploadIntervalMultiplicationFactor: 0, // if set to 0 or undefined, logs won't be uploaded periodically, if you want periodic logs, recommended value is 1
|
99
100
|
},
|
100
101
|
};
|
package/src/constants.ts
CHANGED
@@ -36,6 +36,8 @@ export const HOST = 'host';
|
|
36
36
|
|
37
37
|
export const JOIN = 'join';
|
38
38
|
|
39
|
+
export const JOIN_LINK_MTID = 'MTID';
|
40
|
+
|
39
41
|
export const LEAVE = 'leave';
|
40
42
|
export const LIVE = 'live';
|
41
43
|
export const LOCAL = 'local';
|
@@ -104,6 +106,7 @@ export const _ON_HOLD_LOBBY_ = 'ON_HOLD_LOBBY';
|
|
104
106
|
export const _MEETING_LINK_ = 'MEETING_LINK';
|
105
107
|
export const _MEETING_UUID_ = 'MEETING_UUID';
|
106
108
|
export const _MEETING_ = 'MEETING';
|
109
|
+
export const _SPACE_SHARE_ = 'SPACE_SHARE';
|
107
110
|
export const _MEETING_CENTER_ = 'MEETING_CENTER';
|
108
111
|
export const _MEETING_ID_ = 'MEETING_ID';
|
109
112
|
|
@@ -198,6 +201,9 @@ export const RETRY_TIMEOUT = 3000;
|
|
198
201
|
|
199
202
|
export const ICE_AND_DTLS_CONNECTION_TIMEOUT = 20000;
|
200
203
|
export const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
|
204
|
+
export const WEBINAR_ERROR_WEBCAST = [403026];
|
205
|
+
export const WEBINAR_ERROR_REGISTRATION_ID = [403037, 403137];
|
206
|
+
export const JOIN_BEFORE_HOST = 403003;
|
201
207
|
|
202
208
|
// ******************** REGEX **********************
|
203
209
|
// Please alphabetize
|
@@ -303,6 +309,7 @@ export const EVENT_TRIGGERS = {
|
|
303
309
|
MEETING_SELF_CANNOT_VIEW_PARTICIPANT_LIST: 'meeting:self:cannotViewParticipantList',
|
304
310
|
MEETING_SELF_IS_SHARING_BLOCKED: 'meeting:self:isSharingBlocked',
|
305
311
|
MEETING_SELF_ROLES_CHANGED: 'meeting:self:rolesChanged',
|
312
|
+
MEETING_SELF_BRB_UPDATE: 'meeting:self:brbUpdate',
|
306
313
|
MEETING_CONTROLS_LAYOUT_UPDATE: 'meeting:layout:update',
|
307
314
|
MEETING_ENTRY_EXIT_TONE_UPDATE: 'meeting:entryExitTone:update',
|
308
315
|
MEETING_BREAKOUTS_UPDATE: 'meeting:breakouts:update',
|
@@ -325,6 +332,7 @@ export const EVENT_TRIGGERS = {
|
|
325
332
|
MEETING_RECONNECTION_FAILURE: 'meeting:reconnectionFailure',
|
326
333
|
MEETING_UNLOCKED: 'meeting:unlocked',
|
327
334
|
MEETING_LOCKED: 'meeting:locked',
|
335
|
+
MEETING_RESOURCE_LINKS_UPDATE: 'meeting:resourceLinks:update',
|
328
336
|
MEETING_INFO_AVAILABLE: 'meeting:meetingInfoAvailable',
|
329
337
|
MEETING_INFO_UPDATED: 'meeting:meetingInfoUpdated',
|
330
338
|
MEETING_LOG_UPLOAD_SUCCESS: 'meeting:logUpload:success',
|
@@ -383,6 +391,13 @@ export const EVENT_TYPES = {
|
|
383
391
|
ERROR: 'error',
|
384
392
|
};
|
385
393
|
|
394
|
+
export const HEADERS = {
|
395
|
+
CONTENT_TYPE: 'Content-Type',
|
396
|
+
CONTENT_TYPE_VALUE: {
|
397
|
+
APPLICATION_JSON: 'application/json',
|
398
|
+
},
|
399
|
+
};
|
400
|
+
|
386
401
|
// Handles the reason when meeting gets destroyed
|
387
402
|
// host removed you from the meeting
|
388
403
|
// You are the host and you left the meeting
|
@@ -529,11 +544,21 @@ export const ERROR_DICTIONARY = {
|
|
529
544
|
'Reconnection was not started, because there is one already in progress or reconnections are disabled in config.',
|
530
545
|
CODE: 15,
|
531
546
|
},
|
532
|
-
|
533
|
-
NAME: '
|
534
|
-
MESSAGE: 'An error occurred while the webinar
|
547
|
+
JoinWebinarError: {
|
548
|
+
NAME: 'JoinWebinarError',
|
549
|
+
MESSAGE: 'An error occurred while the join webinar.',
|
535
550
|
CODE: 16,
|
536
551
|
},
|
552
|
+
MULTISTREAM_NOT_SUPPORTED: {
|
553
|
+
NAME: 'MultistreamNotSupported',
|
554
|
+
MESSAGE: 'Client asked for multistream backend (Homer), but got something else instead',
|
555
|
+
CODE: 17,
|
556
|
+
},
|
557
|
+
JoinForbiddenError: {
|
558
|
+
NAME: 'JoinForbiddenError',
|
559
|
+
MESSAGE: 'Meeting join forbidden.',
|
560
|
+
CODE: 18,
|
561
|
+
},
|
537
562
|
};
|
538
563
|
|
539
564
|
export const FLOOR_ACTION = {
|
@@ -709,6 +734,7 @@ export const LOCUSINFO = {
|
|
709
734
|
SELF_IS_SHARING_BLOCKED_CHANGE: 'SELF_IS_SHARING_BLOCKED_CHANGE',
|
710
735
|
SELF_MEETING_BREAKOUTS_CHANGED: 'SELF_MEETING_BREAKOUTS_CHANGED',
|
711
736
|
SELF_MEETING_INTERPRETATION_CHANGED: 'SELF_MEETING_INTERPRETATION_CHANGED',
|
737
|
+
SELF_MEETING_BRB_CHANGED: 'SELF_MEETING_BRB_CHANGED',
|
712
738
|
MEDIA_INACTIVITY: 'MEDIA_INACTIVITY',
|
713
739
|
LINKS_SERVICES: 'LINKS_SERVICES',
|
714
740
|
LINKS_RESOURCES: 'LINKS_RESOURCES',
|
@@ -904,6 +930,10 @@ export const DISPLAY_HINTS = {
|
|
904
930
|
RECORDING_CONTROL_PAUSE: 'RECORDING_CONTROL_PAUSE',
|
905
931
|
RECORDING_CONTROL_STOP: 'RECORDING_CONTROL_STOP',
|
906
932
|
RECORDING_CONTROL_RESUME: 'RECORDING_CONTROL_RESUME',
|
933
|
+
PREMISE_RECORDING_CONTROL_START: 'PREMISE_RECORDING_CONTROL_START',
|
934
|
+
PREMISE_RECORDING_CONTROL_PAUSE: 'PREMISE_RECORDING_CONTROL_PAUSE',
|
935
|
+
PREMISE_RECORDING_CONTROL_STOP: 'PREMISE_RECORDING_CONTROL_STOP',
|
936
|
+
PREMISE_RECORDING_CONTROL_RESUME: 'PREMISE_RECORDING_CONTROL_RESUME',
|
907
937
|
LOCK_CONTROL_UNLOCK: 'LOCK_CONTROL_UNLOCK',
|
908
938
|
LOCK_CONTROL_LOCK: 'LOCK_CONTROL_LOCK',
|
909
939
|
LOCK_STATUS_LOCKED: 'LOCK_STATUS_LOCKED',
|
@@ -950,6 +980,7 @@ export const DISPLAY_HINTS = {
|
|
950
980
|
DISABLE_ASK_FOR_HELP: 'DISABLE_ASK_FOR_HELP',
|
951
981
|
DISABLE_BREAKOUT_PREASSIGNMENTS: 'DISABLE_BREAKOUT_PREASSIGNMENTS',
|
952
982
|
DISABLE_LOBBY_TO_BREAKOUT: 'DISABLE_LOBBY_TO_BREAKOUT',
|
983
|
+
DISABLE_BREAKOUT_START: 'DISABLE_BREAKOUT_START',
|
953
984
|
|
954
985
|
// participants list
|
955
986
|
DISABLE_VIEW_THE_PARTICIPANT_LIST: 'DISABLE_VIEW_THE_PARTICIPANT_LIST',
|
@@ -988,6 +1019,12 @@ export const DISPLAY_HINTS = {
|
|
988
1019
|
STAGE_VIEW_INACTIVE: 'STAGE_VIEW_INACTIVE',
|
989
1020
|
ENABLE_STAGE_VIEW: 'ENABLE_STAGE_VIEW',
|
990
1021
|
DISABLE_STAGE_VIEW: 'DISABLE_STAGE_VIEW',
|
1022
|
+
|
1023
|
+
// Practice Session
|
1024
|
+
PRACTICE_SESSION_ON: 'PRACTICE_SESSION_ON',
|
1025
|
+
PRACTICE_SESSION_OFF: 'PRACTICE_SESSION_OFF',
|
1026
|
+
SHOW_PRACTICE_SESSION_START: 'SHOW_PRACTICE_SESSION_START',
|
1027
|
+
SHOW_PRACTICE_SESSION_STOP: 'SHOW_PRACTICE_SESSION_STOP',
|
991
1028
|
};
|
992
1029
|
|
993
1030
|
export const INTERSTITIAL_DISPLAY_HINTS = [DISPLAY_HINTS.VOIP_IS_ENABLED];
|
@@ -1294,12 +1331,24 @@ export const PASSWORD_STATUS = {
|
|
1294
1331
|
VERIFIED: 'VERIFIED', // client has already provided the password and it has been verified, client can proceed to call join()
|
1295
1332
|
};
|
1296
1333
|
|
1334
|
+
export const REGISTRATION_ID_STATUS = {
|
1335
|
+
NOT_REQUIRED: 'NOT_REQUIRED', // registrationId is not required to join the meeting
|
1336
|
+
REQUIRED: 'REQUIRED', // client needs to provide the registrationId by calling verifyRegistrationId() before calling join()
|
1337
|
+
UNKNOWN: 'UNKNOWN', // we are waiting for information from the backend if registrationId is required or not
|
1338
|
+
VERIFIED: 'VERIFIED', // client has already provided the registrationId and it has been verified, client can proceed to call join()
|
1339
|
+
};
|
1340
|
+
|
1297
1341
|
export const MEETING_INFO_FAILURE_REASON = {
|
1298
1342
|
NONE: 'NONE', // meeting info was retrieved succesfully
|
1299
1343
|
WRONG_PASSWORD: 'WRONG_PASSWORD', // meeting requires password and no password or wrong one was provided
|
1300
1344
|
WRONG_CAPTCHA: 'WRONG_CAPTCHA', // wbxappapi requires a captcha code or a wrong captcha code was provided
|
1345
|
+
WRONG_REGISTRATION_ID: 'WRONG_REGISTRATION_ID', // meeting requires registrationId and no registrationId or wrong one was provided
|
1301
1346
|
POLICY: 'POLICY', // meeting info request violates some meeting policy
|
1302
1347
|
WEBINAR_REGISTRATION: 'WEBINAR_REGISTRATION', // webinar need registration
|
1348
|
+
NEED_JOIN_WITH_WEBCAST: 'NEED_JOIN_WITH_WEBCAST', // webinar need using webcast join
|
1349
|
+
WEBINAR_NEED_REGISTRATION_ID: 'WEBINAR_NEED_REGISTRATION_ID', // webinar need registrationID
|
1350
|
+
NOT_REACH_JBH: 'NOT_REACH_JBH', // Meeting is not allow to access since not reach JBH (join before host) time
|
1351
|
+
JOIN_FORBIDDEN: 'JOIN_FORBIDDEN', // meeting is not allow join
|
1303
1352
|
OTHER: 'OTHER', // any other error (network, etc)
|
1304
1353
|
};
|
1305
1354
|
|
@@ -1359,3 +1408,12 @@ export const DESTINATION_TYPE = {
|
|
1359
1408
|
} as const;
|
1360
1409
|
|
1361
1410
|
export type DESTINATION_TYPE = Enum<typeof DESTINATION_TYPE>;
|
1411
|
+
|
1412
|
+
export const INITIAL_REGISTRATION_STATUS = {
|
1413
|
+
fetchWebexSite: false,
|
1414
|
+
getGeoHint: false,
|
1415
|
+
startReachability: false,
|
1416
|
+
deviceRegister: false,
|
1417
|
+
mercuryConnect: false,
|
1418
|
+
checkH264Support: false,
|
1419
|
+
};
|
package/src/index.ts
CHANGED
@@ -8,7 +8,7 @@ import CaptchaError from './common/errors/captcha-error';
|
|
8
8
|
import IntentToJoinError from './common/errors/intent-to-join';
|
9
9
|
import PasswordError from './common/errors/password-error';
|
10
10
|
import PermissionError from './common/errors/permission';
|
11
|
-
import
|
11
|
+
import JoinWebinarError from './common/errors/join-webinar-error';
|
12
12
|
import {
|
13
13
|
ReclaimHostEmptyWrongKeyError,
|
14
14
|
ReclaimHostIsHostAlreadyError,
|
@@ -27,7 +27,6 @@ registerPlugin('meetings', Meetings, {
|
|
27
27
|
});
|
28
28
|
|
29
29
|
export {
|
30
|
-
getDevices,
|
31
30
|
LocalStream,
|
32
31
|
LocalDisplayStream,
|
33
32
|
LocalSystemAudioStream,
|
@@ -41,12 +40,15 @@ export {
|
|
41
40
|
LocalCameraStream,
|
42
41
|
createMicrophoneStream,
|
43
42
|
createCameraStream,
|
43
|
+
createCameraAndMicrophoneStreams,
|
44
44
|
createDisplayStream,
|
45
45
|
createDisplayStreamWithAudio,
|
46
|
+
createDisplayMedia,
|
46
47
|
FacingMode,
|
47
48
|
DisplaySurface,
|
48
49
|
PresetCameraConstraints,
|
49
50
|
type VideoContentHint,
|
51
|
+
type StreamState,
|
50
52
|
} from '@webex/media-helpers';
|
51
53
|
|
52
54
|
export default Meetings;
|
@@ -69,7 +71,7 @@ export {
|
|
69
71
|
ReclaimHostEmptyWrongKeyError,
|
70
72
|
Meeting,
|
71
73
|
MeetingInfoUtil,
|
72
|
-
|
74
|
+
JoinWebinarError,
|
73
75
|
};
|
74
76
|
|
75
77
|
export {RemoteMedia} from './multistream/remoteMedia';
|
package/src/locus-info/index.ts
CHANGED
@@ -10,6 +10,7 @@ import {
|
|
10
10
|
_SIP_BRIDGE_,
|
11
11
|
MEETING_STATE,
|
12
12
|
_MEETING_,
|
13
|
+
_SPACE_SHARE_,
|
13
14
|
LOCUSINFO,
|
14
15
|
LOCUS,
|
15
16
|
_LEFT_,
|
@@ -489,7 +490,8 @@ export default class LocusInfo extends EventsScope {
|
|
489
490
|
isMeetingActive() {
|
490
491
|
if (
|
491
492
|
this.parsedLocus.fullState.type === _CALL_ ||
|
492
|
-
this.parsedLocus.fullState.type === _SIP_BRIDGE_
|
493
|
+
this.parsedLocus.fullState.type === _SIP_BRIDGE_ ||
|
494
|
+
this.parsedLocus.fullState.type === _SPACE_SHARE_
|
493
495
|
) {
|
494
496
|
// @ts-ignore
|
495
497
|
const partner = this.getLocusPartner(this.participants, this.self);
|
@@ -1283,12 +1285,13 @@ export default class LocusInfo extends EventsScope {
|
|
1283
1285
|
/**
|
1284
1286
|
* handles when the locus.mediaShares is updated
|
1285
1287
|
* @param {Object} mediaShares the locus.mediaShares property
|
1288
|
+
* @param {boolean} forceUpdate force to update the mediaShares
|
1286
1289
|
* @returns {undefined}
|
1287
1290
|
* @memberof LocusInfo
|
1288
1291
|
* emits internal event locus_info_update_media_shares
|
1289
1292
|
*/
|
1290
|
-
updateMediaShares(mediaShares: object) {
|
1291
|
-
if (mediaShares && !isEqual(this.mediaShares, mediaShares)) {
|
1293
|
+
updateMediaShares(mediaShares: object, forceUpdate = false) {
|
1294
|
+
if (mediaShares && (!isEqual(this.mediaShares, mediaShares) || forceUpdate)) {
|
1292
1295
|
const parsedMediaShares = MediaSharesUtils.getMediaShares(this.mediaShares, mediaShares);
|
1293
1296
|
|
1294
1297
|
this.updateMeeting(parsedMediaShares.current);
|
@@ -1303,6 +1306,7 @@ export default class LocusInfo extends EventsScope {
|
|
1303
1306
|
{
|
1304
1307
|
current: parsedMediaShares.current,
|
1305
1308
|
previous: parsedMediaShares.previous,
|
1309
|
+
forceUpdate,
|
1306
1310
|
}
|
1307
1311
|
);
|
1308
1312
|
}
|
@@ -1393,6 +1397,19 @@ export default class LocusInfo extends EventsScope {
|
|
1393
1397
|
);
|
1394
1398
|
}
|
1395
1399
|
|
1400
|
+
if (parsedSelves.updates.brbChanged) {
|
1401
|
+
this.emitScoped(
|
1402
|
+
{
|
1403
|
+
file: 'locus-info',
|
1404
|
+
function: 'updateSelf',
|
1405
|
+
},
|
1406
|
+
LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
|
1407
|
+
{
|
1408
|
+
brb: parsedSelves.current.brb,
|
1409
|
+
}
|
1410
|
+
);
|
1411
|
+
}
|
1412
|
+
|
1396
1413
|
if (parsedSelves.updates.interpretationChanged) {
|
1397
1414
|
this.emitScoped(
|
1398
1415
|
{
|
@@ -66,6 +66,7 @@ SelfUtils.parse = (self: any, deviceId: string) => {
|
|
66
66
|
breakoutSessions: SelfUtils.getBreakoutSessions(self),
|
67
67
|
breakout: SelfUtils.getBreakout(self),
|
68
68
|
interpretation: SelfUtils.getInterpretation(self),
|
69
|
+
brb: SelfUtils.getBrb(self),
|
69
70
|
};
|
70
71
|
}
|
71
72
|
|
@@ -75,6 +76,7 @@ SelfUtils.parse = (self: any, deviceId: string) => {
|
|
75
76
|
SelfUtils.getBreakoutSessions = (self) => self?.controls?.breakout?.sessions;
|
76
77
|
SelfUtils.getBreakout = (self) => self?.controls?.breakout;
|
77
78
|
SelfUtils.getInterpretation = (self) => self?.controls?.interpretation;
|
79
|
+
SelfUtils.getBrb = (self) => self?.controls?.brb;
|
78
80
|
|
79
81
|
SelfUtils.getLayout = (self) =>
|
80
82
|
Array.isArray(self?.controls?.layouts) ? self.controls.layouts[0].type : undefined;
|
@@ -97,7 +99,7 @@ SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
|
|
97
99
|
const current = newSelf && SelfUtils.parse(newSelf, deviceId);
|
98
100
|
const updates: any = {};
|
99
101
|
|
100
|
-
updates.isUserUnadmitted = SelfUtils.isUserUnadmitted(current);
|
102
|
+
updates.isUserUnadmitted = SelfUtils.isUserUnadmitted(previous, current);
|
101
103
|
updates.isUserAdmitted = SelfUtils.isUserAdmitted(previous, current);
|
102
104
|
updates.isVideoMutedByOthersChanged = SelfUtils.videoMutedByOthersChanged(previous, current);
|
103
105
|
updates.isMutedByOthersChanged = SelfUtils.mutedByOthersChanged(previous, current);
|
@@ -128,6 +130,7 @@ SelfUtils.getSelves = (oldSelf, newSelf, deviceId) => {
|
|
128
130
|
updates.isSharingBlockedChanged = previous?.isSharingBlocked !== current.isSharingBlocked;
|
129
131
|
updates.breakoutsChanged = SelfUtils.breakoutsChanged(previous, current);
|
130
132
|
updates.interpretationChanged = SelfUtils.interpretationChanged(previous, current);
|
133
|
+
updates.brbChanged = SelfUtils.brbChanged(previous, current);
|
131
134
|
|
132
135
|
return {
|
133
136
|
previous,
|
@@ -159,6 +162,9 @@ SelfUtils.breakoutsChanged = (previous, current) =>
|
|
159
162
|
SelfUtils.interpretationChanged = (previous, current) =>
|
160
163
|
!isEqual(previous?.interpretation, current?.interpretation) && !!current?.interpretation;
|
161
164
|
|
165
|
+
SelfUtils.brbChanged = (previous, current) =>
|
166
|
+
!isEqual(previous?.brb, current?.brb) && current?.brb !== undefined;
|
167
|
+
|
162
168
|
SelfUtils.isMediaInactive = (previous, current) => {
|
163
169
|
if (
|
164
170
|
previous &&
|
@@ -324,16 +330,23 @@ SelfUtils.isLocusUserAdmitted = (check: any) =>
|
|
324
330
|
check && check.joinedWith?.intent?.type !== _WAIT_ && check.state === _JOINED_;
|
325
331
|
|
326
332
|
/**
|
327
|
-
* @param {Object}
|
333
|
+
* @param {Object} oldSelf
|
334
|
+
* @param {Object} changedSelf
|
328
335
|
* @returns {Boolean}
|
329
336
|
* @throws {Error} when self is undefined
|
330
337
|
*/
|
331
|
-
SelfUtils.isUserUnadmitted = (
|
332
|
-
if (!
|
333
|
-
throw new ParameterError(
|
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
|
+
);
|
334
343
|
}
|
335
344
|
|
336
|
-
|
345
|
+
if (SelfUtils.isLocusUserUnadmitted(oldSelf)) {
|
346
|
+
return false;
|
347
|
+
}
|
348
|
+
|
349
|
+
return SelfUtils.isLocusUserUnadmitted(changedSelf);
|
337
350
|
};
|
338
351
|
|
339
352
|
SelfUtils.moderatorChanged = (oldSelf, changedSelf) => {
|
@@ -428,6 +441,11 @@ SelfUtils.mutedByOthersChanged = (oldSelf, changedSelf) => {
|
|
428
441
|
return false;
|
429
442
|
}
|
430
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
|
+
}
|
448
|
+
|
431
449
|
return (
|
432
450
|
changedSelf.remoteMuted !== null &&
|
433
451
|
(oldSelf.remoteMuted !== changedSelf.remoteMuted ||
|
package/src/media/properties.ts
CHANGED
@@ -287,24 +287,45 @@ export default class MediaProperties {
|
|
287
287
|
selectedCandidatePairChanges: number;
|
288
288
|
numTransports: number;
|
289
289
|
}> {
|
290
|
-
const allStatsReports = [];
|
291
|
-
|
292
290
|
try {
|
293
|
-
const
|
294
|
-
|
291
|
+
const allStatsReports = [];
|
292
|
+
|
293
|
+
await new Promise((resolve, reject) => {
|
294
|
+
const timeout = setTimeout(() => {
|
295
|
+
reject(new Error('timed out'));
|
296
|
+
}, 1000);
|
297
|
+
|
298
|
+
this.webrtcMediaConnection
|
299
|
+
.getStats()
|
300
|
+
.then((statsResult) => {
|
301
|
+
clearTimeout(timeout);
|
302
|
+
statsResult.forEach((report) => allStatsReports.push(report));
|
303
|
+
resolve(allStatsReports);
|
304
|
+
})
|
305
|
+
.catch((error) => {
|
306
|
+
clearTimeout(timeout);
|
307
|
+
reject(error);
|
308
|
+
});
|
309
|
+
});
|
310
|
+
|
311
|
+
const connectionType = this.getConnectionType(allStatsReports);
|
312
|
+
const {selectedCandidatePairChanges, numTransports} = this.getTransportInfo(allStatsReports);
|
313
|
+
|
314
|
+
return {
|
315
|
+
connectionType,
|
316
|
+
selectedCandidatePairChanges,
|
317
|
+
numTransports,
|
318
|
+
};
|
295
319
|
} catch (error) {
|
296
320
|
LoggerProxy.logger.warn(
|
297
321
|
`Media:properties#getCurrentConnectionInfo --> getStats() failed: ${error}`
|
298
322
|
);
|
299
|
-
}
|
300
|
-
|
301
|
-
const connectionType = this.getConnectionType(allStatsReports);
|
302
|
-
const {selectedCandidatePairChanges, numTransports} = this.getTransportInfo(allStatsReports);
|
303
323
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
324
|
+
return {
|
325
|
+
connectionType: 'unknown',
|
326
|
+
selectedCandidatePairChanges: -1,
|
327
|
+
numTransports: 0,
|
328
|
+
};
|
329
|
+
}
|
309
330
|
}
|
310
331
|
}
|
@@ -0,0 +1,169 @@
|
|
1
|
+
import {MediaType} from '@webex/internal-media-core';
|
2
|
+
import LoggerProxy from '../common/logs/logger-proxy';
|
3
|
+
import type Meeting from '.';
|
4
|
+
import SendSlotManager from '../multistream/sendSlotManager';
|
5
|
+
|
6
|
+
export const createBrbState = (meeting: Meeting, enabled: boolean) => {
|
7
|
+
LoggerProxy.logger.info(
|
8
|
+
`Meeting:brbState#createBrbState: creating BrbState for meeting id ${meeting?.id}`
|
9
|
+
);
|
10
|
+
|
11
|
+
const brbState = new BrbState(meeting, enabled);
|
12
|
+
|
13
|
+
return brbState;
|
14
|
+
};
|
15
|
+
|
16
|
+
/** The purpose of this class is to manage the local and remote brb state
|
17
|
+
* and make sure that the server state always matches the last requested state by the client.
|
18
|
+
*/
|
19
|
+
export class BrbState {
|
20
|
+
state: {
|
21
|
+
client: {
|
22
|
+
enabled: boolean;
|
23
|
+
};
|
24
|
+
server: {
|
25
|
+
enabled: boolean;
|
26
|
+
};
|
27
|
+
syncToServerInProgress: boolean;
|
28
|
+
};
|
29
|
+
|
30
|
+
meeting: Meeting;
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Constructor
|
34
|
+
*
|
35
|
+
* @param {Meeting} meeting - the meeting object
|
36
|
+
* @param {boolean} enabled - whether the client audio/video is enabled at all
|
37
|
+
*/
|
38
|
+
constructor(meeting: Meeting, enabled: boolean) {
|
39
|
+
this.meeting = meeting;
|
40
|
+
this.state = {
|
41
|
+
client: {
|
42
|
+
enabled,
|
43
|
+
},
|
44
|
+
server: {
|
45
|
+
enabled: false,
|
46
|
+
},
|
47
|
+
syncToServerInProgress: false,
|
48
|
+
};
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Enables/disables brb
|
53
|
+
*
|
54
|
+
* @param {boolean} enabled
|
55
|
+
* @param {SendSlotManager} sendSlotManager
|
56
|
+
* @returns {Promise}
|
57
|
+
*/
|
58
|
+
public enable(enabled: boolean, sendSlotManager: SendSlotManager) {
|
59
|
+
this.state.client.enabled = enabled;
|
60
|
+
|
61
|
+
return this.applyClientStateToServer(sendSlotManager);
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Updates the server local and remote brb values so that they match the current client desired state.
|
66
|
+
*
|
67
|
+
* @param {SendSlotManager} sendSlotManager
|
68
|
+
* @returns {Promise}
|
69
|
+
*/
|
70
|
+
private applyClientStateToServer(sendSlotManager: SendSlotManager) {
|
71
|
+
if (this.state.syncToServerInProgress) {
|
72
|
+
LoggerProxy.logger.info(
|
73
|
+
`Meeting:brbState#applyClientStateToServer: request to server in progress, we need to wait for it to complete`
|
74
|
+
);
|
75
|
+
|
76
|
+
return Promise.resolve();
|
77
|
+
}
|
78
|
+
|
79
|
+
const remoteBrbRequiresSync = this.state.client.enabled !== this.state.server.enabled;
|
80
|
+
|
81
|
+
LoggerProxy.logger.info(
|
82
|
+
`Meeting:brbState#applyClientStateToServer: remoteBrbRequiresSync: ${remoteBrbRequiresSync}`
|
83
|
+
);
|
84
|
+
|
85
|
+
if (!remoteBrbRequiresSync) {
|
86
|
+
LoggerProxy.logger.info(
|
87
|
+
`Meeting:brbState#applyClientStateToServer: client state already matching server state, nothing to do`
|
88
|
+
);
|
89
|
+
|
90
|
+
return Promise.resolve();
|
91
|
+
}
|
92
|
+
|
93
|
+
this.state.syncToServerInProgress = true;
|
94
|
+
|
95
|
+
return this.sendLocalBrbStateToServer(sendSlotManager)
|
96
|
+
.then(() => {
|
97
|
+
this.state.syncToServerInProgress = false;
|
98
|
+
LoggerProxy.logger.info(
|
99
|
+
`Meeting:brbState#applyClientStateToServer: sync with server completed`
|
100
|
+
);
|
101
|
+
|
102
|
+
// need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync
|
103
|
+
this.applyClientStateToServer(sendSlotManager);
|
104
|
+
})
|
105
|
+
.catch((e) => {
|
106
|
+
this.state.syncToServerInProgress = false;
|
107
|
+
LoggerProxy.logger.warn(`Meeting:brbState#applyClientStateToServer: error: ${e}`);
|
108
|
+
});
|
109
|
+
}
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Send the local brb state to the server
|
113
|
+
*
|
114
|
+
* @param {SendSlotManager} sendSlotManager
|
115
|
+
* @returns {Promise}
|
116
|
+
*/
|
117
|
+
private async sendLocalBrbStateToServer(sendSlotManager: SendSlotManager) {
|
118
|
+
const {enabled} = this.state.client;
|
119
|
+
|
120
|
+
if (!this.meeting.isMultistream) {
|
121
|
+
const errorMessage = 'Meeting:brbState#sendLocalBrbStateToServer: Not a multistream meeting';
|
122
|
+
const error = new Error(errorMessage);
|
123
|
+
|
124
|
+
LoggerProxy.logger.error(error);
|
125
|
+
|
126
|
+
return Promise.reject(error);
|
127
|
+
}
|
128
|
+
|
129
|
+
if (!this.meeting.mediaProperties.webrtcMediaConnection) {
|
130
|
+
const errorMessage =
|
131
|
+
'Meeting:brbState#sendLocalBrbStateToServer: WebRTC media connection is not defined';
|
132
|
+
const error = new Error(errorMessage);
|
133
|
+
|
134
|
+
LoggerProxy.logger.error(error);
|
135
|
+
|
136
|
+
return Promise.reject(error);
|
137
|
+
}
|
138
|
+
|
139
|
+
// this logic should be applied only to multistream meetings
|
140
|
+
return this.meeting.meetingRequest
|
141
|
+
.setBrb({
|
142
|
+
enabled,
|
143
|
+
locusUrl: this.meeting.locusUrl,
|
144
|
+
deviceUrl: this.meeting.deviceUrl,
|
145
|
+
selfId: this.meeting.selfId,
|
146
|
+
})
|
147
|
+
.then(() => {
|
148
|
+
sendSlotManager.setSourceStateOverride(MediaType.VideoMain, enabled ? 'away' : null);
|
149
|
+
})
|
150
|
+
.catch((error) => {
|
151
|
+
LoggerProxy.logger.error('Meeting:brbState#sendLocalBrbStateToServer: Error ', error);
|
152
|
+
|
153
|
+
return Promise.reject(error);
|
154
|
+
});
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* This method should be called whenever the server brb state is changed
|
159
|
+
*
|
160
|
+
* @param {Boolean} [enabled] true if user has brb enabled, false otherwise
|
161
|
+
* @returns {undefined}
|
162
|
+
*/
|
163
|
+
public handleServerBrbUpdate(enabled?: boolean) {
|
164
|
+
LoggerProxy.logger.info(
|
165
|
+
`Meeting:brbState#handleServerBrbUpdate: updating server brb to (${enabled})`
|
166
|
+
);
|
167
|
+
this.state.server.enabled = !!enabled;
|
168
|
+
}
|
169
|
+
}
|