@webex/plugin-meetings 3.0.0-stream-classes.4 → 3.0.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/.eslintrc.js +6 -0
- package/README.md +12 -0
- package/babel.config.js +3 -0
- package/dist/annotation/constants.js +12 -20
- package/dist/annotation/constants.js.map +1 -1
- package/dist/annotation/index.js +25 -10
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +2 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/collection.js +1 -2
- package/dist/breakouts/collection.js.map +1 -1
- package/dist/breakouts/edit-lock-error.js +1 -2
- package/dist/breakouts/edit-lock-error.js.map +1 -1
- package/dist/breakouts/events.js +1 -2
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +13 -14
- package/dist/breakouts/index.js.map +1 -1
- package/dist/breakouts/request.js +1 -2
- package/dist/breakouts/request.js.map +1 -1
- package/dist/breakouts/utils.js +3 -6
- package/dist/breakouts/utils.js.map +1 -1
- package/dist/common/browser-detection.js +2 -3
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +3 -4
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +1 -2
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +1 -2
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +1 -2
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +1 -2
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +1 -2
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/no-meeting-info.d.ts +14 -0
- package/dist/common/errors/no-meeting-info.js +50 -0
- package/dist/common/errors/no-meeting-info.js.map +1 -0
- package/dist/common/errors/parameter.js +3 -4
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +1 -2
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +1 -2
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
- package/dist/common/errors/reclaim-host-role-errors.js +154 -0
- package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
- package/dist/common/errors/reconnection-in-progress.js +1 -2
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +1 -2
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +1 -2
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/{types/common → common}/errors/webex-errors.d.ts +13 -1
- package/dist/common/errors/webex-errors.js +35 -16
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +1 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +1 -2
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +1 -2
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +1 -2
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +1 -2
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +1 -2
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -2
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/{types/common → common}/logs/request.d.ts +3 -1
- package/dist/common/logs/request.js +8 -5
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +2 -4
- package/dist/common/queue.js.map +1 -1
- package/dist/{types/config.d.ts → config.d.ts} +1 -1
- package/dist/config.js +3 -3
- package/dist/config.js.map +1 -1
- package/dist/{types/constants.d.ts → constants.d.ts} +72 -15
- package/dist/constants.js +254 -371
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +3 -6
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +7 -10
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/index.js +27 -32
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +1 -2
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.d.ts +2 -0
- package/dist/interceptors/index.js +15 -0
- package/dist/interceptors/index.js.map +1 -0
- package/dist/interceptors/locusRetry.d.ts +27 -0
- package/dist/interceptors/locusRetry.js +94 -0
- package/dist/interceptors/locusRetry.js.map +1 -0
- package/dist/interpretation/collection.js +1 -2
- package/dist/interpretation/collection.js.map +1 -1
- package/dist/interpretation/index.js +2 -3
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +2 -3
- package/dist/interpretation/siLanguage.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +12 -13
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -4
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +1 -2
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +1 -2
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/{types/locus-info → locus-info}/index.d.ts +1 -1
- package/dist/locus-info/index.js +63 -38
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +3 -4
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +16 -3
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/{types/locus-info → locus-info}/parser.d.ts +3 -2
- package/dist/locus-info/parser.js +48 -31
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +7 -6
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +15 -10
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +16 -7
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +1 -2
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.d.ts +241 -0
- package/dist/mediaQualityMetrics/config.js +135 -339
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/{types/meeting → meeting}/in-meeting-actions.d.ts +4 -0
- package/dist/meeting/in-meeting-actions.js +18 -2
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/{types/meeting → meeting}/index.d.ts +331 -44
- package/dist/meeting/index.js +2639 -1367
- package/dist/meeting/index.js.map +1 -1
- package/dist/{types/meeting → meeting}/locusMediaRequest.d.ts +1 -2
- package/dist/meeting/locusMediaRequest.js +4 -5
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +2 -4
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/{types/meeting → meeting}/request.d.ts +4 -1
- package/dist/meeting/request.js +47 -32
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js +1 -2
- package/dist/meeting/state.js.map +1 -1
- package/dist/{types/meeting → meeting}/util.d.ts +26 -1
- package/dist/meeting/util.js +83 -10
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.d.ts +16 -0
- package/dist/meeting/voicea-meeting.js +169 -0
- package/dist/meeting/voicea-meeting.js.map +1 -0
- package/dist/meeting-info/collection.js +3 -4
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/{types/meeting-info → meeting-info}/index.d.ts +7 -0
- package/dist/meeting-info/index.js +53 -27
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/{types/meeting-info → meeting-info}/meeting-info-v2.d.ts +1 -0
- package/dist/meeting-info/meeting-info-v2.js +52 -33
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -2
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +8 -8
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +12 -9
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/{types/meetings → meetings}/collection.d.ts +9 -0
- package/dist/meetings/collection.js +21 -5
- package/dist/meetings/collection.js.map +1 -1
- package/dist/{types/meetings → meetings}/index.d.ts +45 -16
- package/dist/meetings/index.js +166 -74
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +2 -3
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +3 -10
- package/dist/meetings/util.js.map +1 -1
- package/dist/{types/member → member}/index.d.ts +1 -0
- package/dist/member/index.js +10 -3
- package/dist/member/index.js.map +1 -1
- package/dist/member/member.types.d.ts +11 -0
- package/dist/member/member.types.js +17 -0
- package/dist/member/member.types.js.map +1 -0
- package/dist/member/types.js +6 -8
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +12 -2
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -2
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +25 -8
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +2 -3
- package/dist/members/request.js.map +1 -1
- package/dist/{types/members → members}/types.d.ts +1 -0
- package/dist/members/types.js +3 -4
- package/dist/members/types.js.map +1 -1
- package/dist/{types/members → members}/util.d.ts +6 -1
- package/dist/members/util.js +18 -8
- package/dist/members/util.js.map +1 -1
- package/dist/{types/metrics → metrics}/constants.d.ts +15 -0
- package/dist/metrics/constants.js +16 -3
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +3 -2
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +9 -11
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +3 -5
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +7 -9
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +3 -5
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +7 -6
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/{types/multistream → multistream}/remoteMediaManager.d.ts +9 -1
- package/dist/multistream/remoteMediaManager.js +74 -36
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +9 -6
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +1 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +2 -3
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -3
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +1 -2
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/clusterReachability.d.ts +109 -0
- package/dist/reachability/clusterReachability.js +357 -0
- package/dist/reachability/clusterReachability.js.map +1 -0
- package/dist/reachability/index.d.ts +105 -0
- package/dist/reachability/index.js +279 -436
- package/dist/reachability/index.js.map +1 -1
- package/dist/{types/reachability → reachability}/request.d.ts +1 -1
- package/dist/reachability/request.js +14 -11
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.d.ts +8 -0
- package/dist/reachability/util.js +29 -0
- package/dist/reachability/util.js.map +1 -0
- package/dist/reactions/constants.js +1 -2
- package/dist/reactions/constants.js.map +1 -1
- package/dist/reactions/reactions.js +2 -4
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +6 -8
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/{types/reconnection-manager → reconnection-manager}/index.d.ts +10 -0
- package/dist/reconnection-manager/index.js +129 -106
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js +4 -5
- package/dist/recording-controller/enums.js.map +1 -1
- package/dist/recording-controller/index.js +43 -51
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/recording-controller/util.js +1 -2
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/{types/roap → roap}/index.d.ts +2 -1
- package/dist/roap/index.js +59 -28
- package/dist/roap/index.js.map +1 -1
- package/dist/{types/roap → roap}/request.d.ts +2 -1
- package/dist/roap/request.js +14 -22
- package/dist/roap/request.js.map +1 -1
- package/dist/{types/roap → roap}/turnDiscovery.d.ts +21 -4
- package/dist/roap/turnDiscovery.js +182 -89
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/rtcMetrics/constants.js +1 -2
- package/dist/rtcMetrics/constants.js.map +1 -1
- package/dist/{types/rtcMetrics → rtcMetrics}/index.d.ts +15 -1
- package/dist/rtcMetrics/index.js +72 -12
- package/dist/rtcMetrics/index.js.map +1 -1
- package/dist/statsAnalyzer/global.js +1 -2
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/{types/statsAnalyzer → statsAnalyzer}/index.d.ts +28 -11
- package/dist/statsAnalyzer/index.js +371 -318
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
- package/dist/statsAnalyzer/mqaUtil.js +295 -162
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +1 -2
- package/dist/transcription/index.js.map +1 -1
- package/dist/webinar/collection.d.ts +16 -0
- package/dist/webinar/collection.js +43 -0
- package/dist/webinar/collection.js.map +1 -0
- package/dist/webinar/index.d.ts +5 -0
- package/dist/webinar/index.js +68 -0
- package/dist/webinar/index.js.map +1 -0
- package/jest.config.js +3 -0
- package/package.json +44 -24
- package/process +1 -0
- package/src/common/errors/no-meeting-info.ts +24 -0
- package/src/common/errors/reclaim-host-role-errors.ts +134 -0
- package/src/common/errors/webex-errors.ts +19 -2
- package/src/common/logs/request.ts +5 -1
- package/src/config.ts +3 -5
- package/src/constants.ts +78 -8
- package/src/index.ts +4 -0
- package/src/interceptors/index.ts +3 -0
- package/src/interceptors/locusRetry.ts +67 -0
- package/src/locus-info/index.ts +52 -16
- package/src/locus-info/mediaSharesUtils.ts +16 -0
- package/src/locus-info/parser.ts +47 -21
- package/src/media/index.ts +8 -6
- package/src/media/properties.ts +17 -2
- package/src/mediaQualityMetrics/config.ts +103 -238
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +1692 -627
- package/src/meeting/request.ts +19 -1
- package/src/meeting/util.ts +102 -1
- package/src/meeting/voicea-meeting.ts +122 -0
- package/src/meeting-info/index.ts +47 -20
- package/src/meeting-info/meeting-info-v2.ts +32 -16
- package/src/meeting-info/util.ts +12 -9
- package/src/meeting-info/utilv2.ts +25 -15
- package/src/meetings/collection.ts +13 -0
- package/src/meetings/index.ts +112 -31
- package/src/meetings/util.ts +2 -8
- package/src/member/index.ts +9 -1
- package/src/member/member.types.ts +13 -0
- package/src/member/util.ts +14 -0
- package/src/members/index.ts +29 -2
- package/src/members/types.ts +1 -0
- package/src/members/util.ts +15 -1
- package/src/metrics/constants.ts +14 -0
- package/src/multistream/remoteMediaManager.ts +41 -4
- package/src/reachability/clusterReachability.ts +320 -0
- package/src/reachability/index.ts +221 -382
- package/src/reachability/request.ts +1 -1
- package/src/reachability/util.ts +24 -0
- package/src/reconnection-manager/index.ts +87 -83
- package/src/roap/index.ts +60 -24
- package/src/roap/request.ts +4 -17
- package/src/roap/turnDiscovery.ts +112 -39
- package/src/rtcMetrics/index.ts +71 -5
- package/src/statsAnalyzer/index.ts +430 -427
- package/src/statsAnalyzer/mqaUtil.ts +317 -168
- package/src/webinar/collection.ts +31 -0
- package/src/webinar/index.ts +62 -0
- package/test/integration/spec/converged-space-meetings.js +7 -7
- package/test/integration/spec/journey.js +88 -106
- package/test/integration/spec/space-meeting.js +10 -10
- package/test/unit/spec/breakouts/breakout.ts +2 -1
- package/test/unit/spec/breakouts/index.ts +7 -4
- package/test/unit/spec/interceptors/locusRetry.ts +131 -0
- package/test/unit/spec/locus-info/index.js +206 -13
- package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +10 -0
- package/test/unit/spec/locus-info/parser.js +54 -13
- package/test/unit/spec/locus-info/selfUtils.js +1 -1
- package/test/unit/spec/media/index.ts +25 -4
- package/test/unit/spec/media/properties.ts +2 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +4354 -1285
- package/test/unit/spec/meeting/request.js +63 -12
- package/test/unit/spec/meeting/utils.js +145 -10
- package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
- package/test/unit/spec/meeting-info/index.js +180 -61
- package/test/unit/spec/meeting-info/meetinginfov2.js +216 -68
- package/test/unit/spec/meetings/collection.js +12 -0
- package/test/unit/spec/meetings/index.js +676 -195
- package/test/unit/spec/meetings/utils.js +35 -12
- package/test/unit/spec/member/index.js +8 -7
- package/test/unit/spec/member/util.js +32 -0
- package/test/unit/spec/members/index.js +130 -17
- package/test/unit/spec/members/utils.js +26 -0
- package/test/unit/spec/metrics/index.js +1 -2
- package/test/unit/spec/multistream/mediaRequestManager.ts +1 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +10 -2
- package/test/unit/spec/reachability/clusterReachability.ts +279 -0
- package/test/unit/spec/reachability/index.ts +505 -135
- package/test/unit/spec/reachability/util.ts +40 -0
- package/test/unit/spec/reconnection-manager/index.js +74 -17
- package/test/unit/spec/recording-controller/index.js +0 -1
- package/test/unit/spec/roap/index.ts +181 -61
- package/test/unit/spec/roap/request.ts +27 -3
- package/test/unit/spec/roap/turnDiscovery.ts +363 -102
- package/test/unit/spec/rtcMetrics/index.ts +57 -3
- package/test/unit/spec/stats-analyzer/index.js +1225 -12
- package/test/unit/spec/webinar/collection.ts +13 -0
- package/test/unit/spec/webinar/index.ts +60 -0
- package/test/utils/integrationTestUtils.js +4 -4
- package/test/utils/webex-test-users.js +12 -4
- package/dist/types/mediaQualityMetrics/config.d.ts +0 -365
- package/dist/types/reachability/index.d.ts +0 -158
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -24
- /package/dist/{types/annotation → annotation}/annotation.types.d.ts +0 -0
- /package/dist/{types/annotation → annotation}/constants.d.ts +0 -0
- /package/dist/{types/annotation → annotation}/index.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/breakout.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/collection.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/edit-lock-error.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/events.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/index.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/request.d.ts +0 -0
- /package/dist/{types/breakouts → breakouts}/utils.d.ts +0 -0
- /package/dist/{types/common → common}/browser-detection.d.ts +0 -0
- /package/dist/{types/common → common}/collection.d.ts +0 -0
- /package/dist/{types/common → common}/config.d.ts +0 -0
- /package/dist/{types/common → common}/errors/captcha-error.d.ts +0 -0
- /package/dist/{types/common → common}/errors/intent-to-join.d.ts +0 -0
- /package/dist/{types/common → common}/errors/join-meeting.d.ts +0 -0
- /package/dist/{types/common → common}/errors/media.d.ts +0 -0
- /package/dist/{types/common → common}/errors/parameter.d.ts +0 -0
- /package/dist/{types/common → common}/errors/password-error.d.ts +0 -0
- /package/dist/{types/common → common}/errors/permission.d.ts +0 -0
- /package/dist/{types/common → common}/errors/reconnection-in-progress.d.ts +0 -0
- /package/dist/{types/common → common}/errors/reconnection.d.ts +0 -0
- /package/dist/{types/common → common}/errors/stats.d.ts +0 -0
- /package/dist/{types/common → common}/errors/webex-meetings-error.d.ts +0 -0
- /package/dist/{types/common → common}/events/events-scope.d.ts +0 -0
- /package/dist/{types/common → common}/events/events.d.ts +0 -0
- /package/dist/{types/common → common}/events/trigger-proxy.d.ts +0 -0
- /package/dist/{types/common → common}/events/util.d.ts +0 -0
- /package/dist/{types/common → common}/logs/logger-config.d.ts +0 -0
- /package/dist/{types/common → common}/logs/logger-proxy.d.ts +0 -0
- /package/dist/{types/common → common}/queue.d.ts +0 -0
- /package/dist/{types/controls-options-manager → controls-options-manager}/constants.d.ts +0 -0
- /package/dist/{types/controls-options-manager → controls-options-manager}/enums.d.ts +0 -0
- /package/dist/{types/controls-options-manager → controls-options-manager}/index.d.ts +0 -0
- /package/dist/{types/controls-options-manager → controls-options-manager}/types.d.ts +0 -0
- /package/dist/{types/controls-options-manager → controls-options-manager}/util.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/dist/{types/interpretation → interpretation}/collection.d.ts +0 -0
- /package/dist/{types/interpretation → interpretation}/index.d.ts +0 -0
- /package/dist/{types/interpretation → interpretation}/siLanguage.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/controlsUtils.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/embeddedAppsUtils.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/fullState.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/hostUtils.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/infoUtils.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/mediaSharesUtils.d.ts +0 -0
- /package/dist/{types/locus-info → locus-info}/selfUtils.d.ts +0 -0
- /package/dist/{types/media → media}/index.d.ts +0 -0
- /package/dist/{types/media → media}/properties.d.ts +0 -0
- /package/dist/{types/media → media}/util.d.ts +0 -0
- /package/dist/{types/meeting → meeting}/muteState.d.ts +0 -0
- /package/dist/{types/meeting → meeting}/request.type.d.ts +0 -0
- /package/dist/{types/meeting → meeting}/state.d.ts +0 -0
- /package/dist/{types/meeting-info → meeting-info}/collection.d.ts +0 -0
- /package/dist/{types/meeting-info → meeting-info}/request.d.ts +0 -0
- /package/dist/{types/meeting-info → meeting-info}/util.d.ts +0 -0
- /package/dist/{types/meeting-info → meeting-info}/utilv2.d.ts +0 -0
- /package/dist/{types/meetings → meetings}/meetings.types.d.ts +0 -0
- /package/dist/{types/meetings → meetings}/request.d.ts +0 -0
- /package/dist/{types/meetings → meetings}/util.d.ts +0 -0
- /package/dist/{types/member → member}/types.d.ts +0 -0
- /package/dist/{types/member → member}/util.d.ts +0 -0
- /package/dist/{types/members → members}/collection.d.ts +0 -0
- /package/dist/{types/members → members}/index.d.ts +0 -0
- /package/dist/{types/members → members}/request.d.ts +0 -0
- /package/dist/{types/metrics → metrics}/index.d.ts +0 -0
- /package/dist/{types/multistream → multistream}/mediaRequestManager.d.ts +0 -0
- /package/dist/{types/multistream → multistream}/receiveSlot.d.ts +0 -0
- /package/dist/{types/multistream → multistream}/receiveSlotManager.d.ts +0 -0
- /package/dist/{types/multistream → multistream}/remoteMedia.d.ts +0 -0
- /package/dist/{types/multistream → multistream}/remoteMediaGroup.d.ts +0 -0
- /package/dist/{types/multistream → multistream}/sendSlotManager.d.ts +0 -0
- /package/dist/{types/networkQualityMonitor → networkQualityMonitor}/index.d.ts +0 -0
- /package/dist/{types/personal-meeting-room → personal-meeting-room}/index.d.ts +0 -0
- /package/dist/{types/personal-meeting-room → personal-meeting-room}/request.d.ts +0 -0
- /package/dist/{types/personal-meeting-room → personal-meeting-room}/util.d.ts +0 -0
- /package/dist/{types/reactions → reactions}/constants.d.ts +0 -0
- /package/dist/{types/reactions → reactions}/reactions.d.ts +0 -0
- /package/dist/{types/reactions → reactions}/reactions.type.d.ts +0 -0
- /package/dist/{types/recording-controller → recording-controller}/enums.d.ts +0 -0
- /package/dist/{types/recording-controller → recording-controller}/index.d.ts +0 -0
- /package/dist/{types/recording-controller → recording-controller}/util.d.ts +0 -0
- /package/dist/{types/rtcMetrics → rtcMetrics}/constants.d.ts +0 -0
- /package/dist/{types/statsAnalyzer → statsAnalyzer}/global.d.ts +0 -0
- /package/dist/{types/transcription → transcription}/index.d.ts +0 -0
- /package/test/unit/spec/locus-info/{selfConstant.js → lib/selfConstant.js} +0 -0
|
@@ -10,7 +10,7 @@ export type RoapRequest = {
|
|
|
10
10
|
reachability: any;
|
|
11
11
|
sequence?: any;
|
|
12
12
|
joinCookie: any;
|
|
13
|
-
ipVersion
|
|
13
|
+
ipVersion?: IP_VERSION;
|
|
14
14
|
};
|
|
15
15
|
export type LocalMuteRequest = {
|
|
16
16
|
type: 'LocalMute';
|
|
@@ -21,7 +21,6 @@ export type LocalMuteRequest = {
|
|
|
21
21
|
audioMuted?: boolean;
|
|
22
22
|
videoMuted?: boolean;
|
|
23
23
|
};
|
|
24
|
-
ipVersion: IP_VERSION;
|
|
25
24
|
};
|
|
26
25
|
export type Request = RoapRequest | LocalMuteRequest;
|
|
27
26
|
export type Config = {
|
|
@@ -17,13 +17,13 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2
|
|
|
17
17
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
18
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
19
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
20
|
-
var
|
|
20
|
+
var _lodash = require("lodash");
|
|
21
21
|
var _common = require("@webex/common");
|
|
22
22
|
var _webexCore = require("@webex/webex-core");
|
|
23
23
|
var _constants = require("../constants");
|
|
24
24
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
25
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
26
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable valid-jsdoc */
|
|
27
27
|
/** Class representing a single /media request being sent to Locus */
|
|
28
28
|
var InternalRequestInfo = /*#__PURE__*/function () {
|
|
29
29
|
/** Constructor */
|
|
@@ -90,7 +90,7 @@ function isRequestAffectingConfluenceState(request) {
|
|
|
90
90
|
* This class manages all /media API requests to Locus. Every call to that
|
|
91
91
|
* Locus API has to go through this class.
|
|
92
92
|
*/
|
|
93
|
-
var LocusMediaRequest = /*#__PURE__*/function (_WebexPlugin) {
|
|
93
|
+
var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_WebexPlugin) {
|
|
94
94
|
(0, _inherits2.default)(LocusMediaRequest, _WebexPlugin);
|
|
95
95
|
var _super = _createSuper(LocusMediaRequest);
|
|
96
96
|
/**
|
|
@@ -280,7 +280,7 @@ var LocusMediaRequest = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
280
280
|
var pendingPromise = new _common.Defer();
|
|
281
281
|
var newRequest = new InternalRequestInfo(request, pendingPromise, this.sendHttpRequest.bind(this));
|
|
282
282
|
this.addToQueue(newRequest);
|
|
283
|
-
(0,
|
|
283
|
+
(0, _lodash.defer)(function () {
|
|
284
284
|
return _this5.executeNextQueuedRequest();
|
|
285
285
|
});
|
|
286
286
|
return pendingPromise.promise;
|
|
@@ -288,5 +288,4 @@ var LocusMediaRequest = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
288
288
|
}]);
|
|
289
289
|
return LocusMediaRequest;
|
|
290
290
|
}(_webexCore.WebexPlugin);
|
|
291
|
-
exports.LocusMediaRequest = LocusMediaRequest;
|
|
292
291
|
//# sourceMappingURL=locusMediaRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InternalRequestInfo","request","pendingPromise","sendRequestFn","pendingPromises","push","then","result","forEach","d","resolve","catch","e","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","config","options","isRequestInProgress","queuedRequests","confluenceState","info","length","addPendingPromises","getPendingPromises","filter","r","nextRequest","shift","execute","executeNextQueuedRequest","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","uri","selfUrl","MEDIA","getLatestMuteState","body","device","correlationId","clientMediaPreferences","preferTranscoding","ipver","ipVersion","localMedias","respOnlySdp","usingResource","reachability","joinCookie","sequence","localSdp","mediaId","LoggerProxy","logger","method","HTTP_VERBS","PUT","muteOptions","Defer","newRequest","sendHttpRequest","bind","addToQueue","promise","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer} from '@webex/common';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP, IP_VERSION} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n sequence?: any;\n joinCookie: any; // any, because this is opaque to the client, we pass whatever object we got from one backend component (Orpheus) to the other (Locus)\n ipVersion?: IP_VERSION;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n preferTranscoding: boolean;\n};\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private sendHttpRequest(request: Request) {\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n clientMediaPreferences: {\n preferTranscoding: this.config.preferTranscoding,\n ipver: request.type === 'RoapMessage' ? request.ipVersion : undefined,\n },\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences.joinCookie = request.joinCookie;\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n })\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n return result;\n })\n .catch((e) => {\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n throw e;\n });\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AAAsD;AAAA;AA6BtD;AAAA,IACMA,mBAAmB;EAKvB;EACA,6BACEC,OAAgB,EAChBC,cAAqB,EACrBC,aAA2D,EAC3D;IAAA;I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;MAAA;MACpD,IAAIA,OAAO,CAACc,IAAI,KAAK,WAAW,EAAE;QAChC,2BAAiCd,OAAO,CAACiE,WAAW;UAA7C7B,UAAU,wBAAVA,UAAU;UAAEG,UAAU,wBAAVA,UAAU;QAE7B,IAAIH,UAAU,KAAKE,SAAS,EAAE;UAC5B,IAAI,CAACD,gBAAgB,GAAGD,UAAU;QACpC;QACA,IAAIG,UAAU,KAAKD,SAAS,EAAE;UAC5B,IAAI,CAACE,gBAAgB,GAAGD,UAAU;QACpC;QAEA,IAAI,IAAI,CAACd,eAAe,KAAK,aAAa,EAAE;UAC1C;UACA;UACA;UACA;UACAmC,oBAAW,CAACC,MAAM,CAACnC,IAAI,CACrB,6FAA6F,CAC9F;UAED,OAAO,iBAAQjB,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B;MACF;MAEA,IAAMR,cAAc,GAAG,IAAIiE,aAAK,EAAE;MAElC,IAAMC,UAAU,GAAG,IAAIpE,mBAAmB,CACxCC,OAAO,EACPC,cAAc,EACd,IAAI,CAACmE,eAAe,CAACC,IAAI,CAAC,IAAI,CAAC,CAChC;MAED,IAAI,CAACC,UAAU,CAACH,UAAU,CAAC;MAE3B,qBAAM;QAAA,OAAM,MAAI,CAAChC,wBAAwB,EAAE;MAAA,EAAC;MAE5C,OAAOlC,cAAc,CAACsE,OAAO;IAC/B;EAAC;EAAA;AAAA,EA7MoCC,sBAAW;AAAA"}
|
|
1
|
+
{"version":3,"names":["_lodash","require","_common","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","forEach","d","resolve","catch","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","_inherits2","_super","config","options","_this2","_assertThisInitialized2","isRequestInProgress","queuedRequests","confluenceState","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","sendHttpRequest","_this4","uri","concat","selfUrl","MEDIA","_this$getLatestMuteSt","body","device","correlationId","clientMediaPreferences","preferTranscoding","ipver","ipVersion","localMedias","respOnlySdp","usingResource","reachability","joinCookie","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","method","HTTP_VERBS","PUT","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","promise","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer} from '@webex/common';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP, IP_VERSION} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n sequence?: any;\n joinCookie: any; // any, because this is opaque to the client, we pass whatever object we got from one backend component (Orpheus) to the other (Locus)\n ipVersion?: IP_VERSION;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n preferTranscoding: boolean;\n};\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private sendHttpRequest(request: Request) {\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n clientMediaPreferences: {\n preferTranscoding: this.config.preferTranscoding,\n ipver: request.type === 'RoapMessage' ? request.ipVersion : undefined,\n },\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences.joinCookie = request.joinCookie;\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n })\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n return result;\n })\n .catch((e) => {\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n throw e;\n });\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }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pD,IAAIrF,OAAO,CAACuB,IAAI,KAAK,WAAW,EAAE;QAChC,IAAA+D,oBAAA,GAAiCtF,OAAO,CAACuF,WAAW;UAA7CpC,UAAU,GAAAmC,oBAAA,CAAVnC,UAAU;UAAEG,UAAU,GAAAgC,oBAAA,CAAVhC,UAAU;QAE7B,IAAIH,UAAU,KAAKE,SAAS,EAAE;UAC5B,IAAI,CAACD,gBAAgB,GAAGD,UAAU;QACpC;QACA,IAAIG,UAAU,KAAKD,SAAS,EAAE;UAC5B,IAAI,CAACE,gBAAgB,GAAGD,UAAU;QACpC;QAEA,IAAI,IAAI,CAACd,eAAe,KAAK,aAAa,EAAE;UAC1C;UACA;UACA;UACA;UACAuC,oBAAW,CAACC,MAAM,CAACtC,IAAI,CACrB,6FACF,CAAC;UAED,OAAO8C,QAAA,CAAAzG,OAAA,CAAQoC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B;MACF;MAEA,IAAMlB,cAAc,GAAG,IAAIwF,aAAK,CAAC,CAAC;MAElC,IAAMC,UAAU,GAAG,IAAI3F,mBAAmB,CACxCC,OAAO,EACPC,cAAc,EACd,IAAI,CAACuD,eAAe,CAACmC,IAAI,CAAC,IAAI,CAChC,CAAC;MAED,IAAI,CAAClD,UAAU,CAACiD,UAAU,CAAC;MAE3B,IAAAE,aAAK,EAAC;QAAA,OAAMP,MAAI,CAACvC,wBAAwB,CAAC,CAAC;MAAA,EAAC;MAE5C,OAAO7C,cAAc,CAAC4F,OAAO;IAC/B;EAAC;EAAA,OAAAhE,iBAAA;AAAA,EA7MoCiE,sBAAW"}
|
|
@@ -15,7 +15,7 @@ var _parameter = _interopRequireDefault(require("../common/errors/parameter"));
|
|
|
15
15
|
var _util = _interopRequireDefault(require("./util"));
|
|
16
16
|
var _constants = require("../constants");
|
|
17
17
|
// eslint-disable-next-line import/prefer-default-export
|
|
18
|
-
var createMuteState = function createMuteState(type, meeting, enabled) {
|
|
18
|
+
var createMuteState = exports.createMuteState = function createMuteState(type, meeting, enabled) {
|
|
19
19
|
// todo: remove the meeting argument (SPARK-399695)
|
|
20
20
|
|
|
21
21
|
_loggerProxy.default.logger.info("Meeting:muteState#createMuteState --> ".concat(type, ": creating MuteState for meeting id ").concat(meeting === null || meeting === void 0 ? void 0 : meeting.id));
|
|
@@ -30,8 +30,7 @@ var createMuteState = function createMuteState(type, meeting, enabled) {
|
|
|
30
30
|
|
|
31
31
|
This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called
|
|
32
32
|
*/
|
|
33
|
-
exports.
|
|
34
|
-
var MuteState = /*#__PURE__*/function () {
|
|
33
|
+
var MuteState = exports.MuteState = /*#__PURE__*/function () {
|
|
35
34
|
/**
|
|
36
35
|
* Constructor
|
|
37
36
|
*
|
|
@@ -422,5 +421,4 @@ var MuteState = /*#__PURE__*/function () {
|
|
|
422
421
|
}]);
|
|
423
422
|
return MuteState;
|
|
424
423
|
}();
|
|
425
|
-
exports.MuteState = MuteState;
|
|
426
424
|
//# sourceMappingURL=muteState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createMuteState","type","meeting","enabled","LoggerProxy","logger","info","id","muteState","MuteState","AUDIO","VIDEO","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","applyUnmuteAllowedToStream","muteLocalStream","initialMute","mediaProperties","audioStream","muted","videoStream","undefined","applyClientStateToServer","init","enable","mute","reason","setServerMuted","localMuteState","getClientLocalMuteState","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","resolve","then","sendRemoteMuteRequestToServer","catch","e","warn","applyServerMuteToLocalStream","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","handleLocusDelta","remoteUpdateError","reject","members","muteMember","selfId","serverMuteReason","setUnmuteAllowed","applyClientStateLocally"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, enabled: boolean) => {\n // todo: remove the meeting argument (SPARK-399695)\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, enabled);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n state: {\n client: {\n enabled: boolean; // indicates if audio/video is enabled at all or not\n localMute: boolean;\n };\n server: {localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean};\n syncToServerInProgress: boolean;\n };\n\n type: any;\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} enabled - whether the client audio/video is enabled at all\n */\n constructor(type: string, meeting: any, enabled: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n enabled,\n localMute: true,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n this.applyUnmuteAllowedToStream(meeting);\n\n // if we are remotely muted, we need to apply that to the local stream now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalStream(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioStream?.muted\n : meeting.mediaProperties.videoStream?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local stream initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n } else {\n // there is no stream, so it's like we are locally muted\n // (this is important especially for transcoded meetings, in which the SDP m-line direction always stays \"sendrecv\")\n this.state.client.localMute = true;\n }\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * This method needs to be called whenever the local audio/video stream has changed.\n * It reapplies the remote mute state onto the new stream and also reads the current\n * local mute state from the stream and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalStreamChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Enables/disables audio/video\n *\n * @param {Object} meeting - the meeting object\n * @param {boolean} enable\n * @returns {void}\n */\n public enable(meeting: any, enable: boolean) {\n this.state.client.enabled = enable;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Mutes/unmutes local stream\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the stream, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalStream(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoStream?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * This method should be called when the local stream mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalStreamMuteStateChange(meeting?: object, mute?: boolean) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalStreamMuteStateChange --> ${this.type}: local stream new mute state: ${mute}`\n );\n\n this.state.client.localMute = mute;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local stream (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n this.muteLocalStream(meeting, this.state.client.localMute, reason);\n }\n\n /** Returns true if client is locally muted - it takes into account not just the client local mute state,\n * but also whether audio/video is enabled at all\n *\n * @returns {boolean}\n */\n private getClientLocalMuteState() {\n return this.state.client.enabled ? this.state.client.localMute : true;\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: any) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteState = this.getClientLocalMuteState();\n const localMuteRequiresSync = localMuteState !== this.state.server.localMute;\n const remoteMuteRequiresSync = !localMuteState && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${localMuteState} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n LoggerProxy.logger.warn(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: error: ${e}`\n );\n\n this.applyServerMuteToLocalStream(meeting, 'clientRequestFailed');\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.getClientLocalMuteState() : undefined;\n const videoMuted = this.type === VIDEO ? this.getClientLocalMuteState() : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.handleLocusDelta(locus, meeting);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.getClientLocalMuteState();\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Sets the mute state of the local stream according to what server thinks is our state\n * @param {Object} meeting - the meeting object\n * @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local stream\n * @returns {void}\n */\n private applyServerMuteToLocalStream(meeting: any, serverMuteReason: ServerMuteReason) {\n const muted = this.state.server.localMute || this.state.server.remoteMute;\n\n // update the local stream mute state, but not this.state.client.localMute\n this.muteLocalStream(meeting, muted, serverMuteReason);\n }\n\n /** Applies the current value for unmute allowed to the underlying stream\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private applyUnmuteAllowedToStream(meeting: any) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToStream(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.applyServerMuteToLocalStream(meeting, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n if (!this.state.client.enabled) {\n LoggerProxy.logger.warn(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received while ${this.type} is disabled -> local unmute will not result in ${this.type} being sent`\n );\n } else {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n }\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n this.applyClientStateLocally(meeting, 'localUnmuteRequired');\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted.\n * It only checks the mute status, ignoring the fact whether audio/video is enabled.\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted or audio/video is disabled\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.getClientLocalMuteState();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AAEA;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAI,EAAEC,OAAO,EAAEC,OAAgB,EAAK;EAClE;;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,iDACoBL,IAAI,iDAAuCC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEK,EAAE,EAChG;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACR,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAAC;EAEvD,OAAOK,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAAA,IAOaC,SAAS;EAapB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,mBAAYR,IAAY,EAAEC,OAAY,EAAEC,OAAgB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IACxD,IAAIF,IAAI,KAAKS,gBAAK,IAAIT,IAAI,KAAKU,gBAAK,EAAE;MACpC,MAAM,IAAIC,kBAAc,CAAC,yDAAyD,CAAC;IACrF;IACA,IAAI,CAACX,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACY,qBAAqB,GAAG,KAAK;IAClC,IAAI,CAACC,KAAK,GAAG;MACXC,MAAM,EAAE;QACNZ,OAAO,EAAPA,OAAO;QACPa,SAAS,EAAE;MACb,CAAC;MACDC,MAAM,EAAE;QACND,SAAS,EAAE,IAAI;QACf;QACAE,UAAU,EAAEjB,IAAI,KAAKS,gBAAK,GAAGR,OAAO,CAACi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A;AACA;EANE;IAAA;IAAA,OAOA,0BAAwB;MACtB,OAAO,IAAI,CAACkB,uBAAuB,EAAE;IACvC;EAAC;EAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_parameter","_util","_constants","createMuteState","exports","type","meeting","enabled","LoggerProxy","logger","info","concat","id","muteState","MuteState","_meeting$remoteVideoM","_meeting$unmuteVideoA","_classCallCheck2","default","_defineProperty2","AUDIO","VIDEO","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","_createClass2","key","value","init","_meeting$mediaPropert","_meeting$mediaPropert2","applyUnmuteAllowedToStream","muteLocalStream","initialMute","mediaProperties","audioStream","muted","videoStream","undefined","applyClientStateToServer","handleLocalStreamChange","enable","mute","reason","_meeting$mediaPropert3","setServerMuted","_meeting$mediaPropert4","handleLocalStreamMuteStateChange","applyClientStateLocally","getClientLocalMuteState","_this","localMuteState","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","_promise","resolve","then","sendRemoteMuteRequestToServer","catch","e","warn","applyServerMuteToLocalStream","_this2","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","handleLocusDelta","remoteUpdateError","reject","_this3","members","muteMember","selfId","serverMuteReason","_meeting$mediaPropert5","setUnmuteAllowed","_meeting$mediaPropert6","handleServerRemoteMuteUpdate","handleServerLocalUnmuteRequired","isMuted","isRemotelyMuted","isUnmuteAllowed","isLocallyMuted"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, enabled: boolean) => {\n // todo: remove the meeting argument (SPARK-399695)\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, enabled);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n state: {\n client: {\n enabled: boolean; // indicates if audio/video is enabled at all or not\n localMute: boolean;\n };\n server: {localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean};\n syncToServerInProgress: boolean;\n };\n\n type: any;\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} enabled - whether the client audio/video is enabled at all\n */\n constructor(type: string, meeting: any, enabled: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n enabled,\n localMute: true,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n this.applyUnmuteAllowedToStream(meeting);\n\n // if we are remotely muted, we need to apply that to the local stream now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalStream(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioStream?.muted\n : meeting.mediaProperties.videoStream?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local stream initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n } else {\n // there is no stream, so it's like we are locally muted\n // (this is important especially for transcoded meetings, in which the SDP m-line direction always stays \"sendrecv\")\n this.state.client.localMute = true;\n }\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * This method needs to be called whenever the local audio/video stream has changed.\n * It reapplies the remote mute state onto the new stream and also reads the current\n * local mute state from the stream and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalStreamChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Enables/disables audio/video\n *\n * @param {Object} meeting - the meeting object\n * @param {boolean} enable\n * @returns {void}\n */\n public enable(meeting: any, enable: boolean) {\n this.state.client.enabled = enable;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Mutes/unmutes local stream\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the stream, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalStream(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoStream?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * This method should be called when the local stream mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalStreamMuteStateChange(meeting?: object, mute?: boolean) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalStreamMuteStateChange --> ${this.type}: local stream new mute state: ${mute}`\n );\n\n this.state.client.localMute = mute;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local stream (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n this.muteLocalStream(meeting, this.state.client.localMute, reason);\n }\n\n /** Returns true if client is locally muted - it takes into account not just the client local mute state,\n * but also whether audio/video is enabled at all\n *\n * @returns {boolean}\n */\n private getClientLocalMuteState() {\n return this.state.client.enabled ? this.state.client.localMute : true;\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: any) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteState = this.getClientLocalMuteState();\n const localMuteRequiresSync = localMuteState !== this.state.server.localMute;\n const remoteMuteRequiresSync = !localMuteState && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${localMuteState} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n LoggerProxy.logger.warn(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: error: ${e}`\n );\n\n this.applyServerMuteToLocalStream(meeting, 'clientRequestFailed');\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.getClientLocalMuteState() : undefined;\n const videoMuted = this.type === VIDEO ? this.getClientLocalMuteState() : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.handleLocusDelta(locus, meeting);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.getClientLocalMuteState();\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Sets the mute state of the local stream according to what server thinks is our state\n * @param {Object} meeting - the meeting object\n * @param {ServerMuteReason} serverMuteReason - reason why we're applying server mute to the local stream\n * @returns {void}\n */\n private applyServerMuteToLocalStream(meeting: any, serverMuteReason: ServerMuteReason) {\n const muted = this.state.server.localMute || this.state.server.remoteMute;\n\n // update the local stream mute state, but not this.state.client.localMute\n this.muteLocalStream(meeting, muted, serverMuteReason);\n }\n\n /** Applies the current value for unmute allowed to the underlying stream\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private applyUnmuteAllowedToStream(meeting: any) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToStream(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.applyServerMuteToLocalStream(meeting, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n if (!this.state.client.enabled) {\n LoggerProxy.logger.warn(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received while ${this.type} is disabled -> local unmute will not result in ${this.type} being sent`\n );\n } else {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n }\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n this.applyClientStateLocally(meeting, 'localUnmuteRequired');\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted.\n * It only checks the mute status, ignoring the fact whether audio/video is enabled.\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted or audio/video is disabled\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.getClientLocalMuteState();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA;AACO,IAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAIE,IAAI,EAAEC,OAAO,EAAEC,OAAgB,EAAK;EAClE;;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,0CAAAC,MAAA,CACoBN,IAAI,0CAAAM,MAAA,CAAuCL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,EAAE,CACjG,CAAC;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACT,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAAC;EAEvD,OAAOM,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOaC,SAAS,GAAAV,OAAA,CAAAU,SAAA;EAapB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,SAAAA,UAAYT,IAAY,EAAEC,OAAY,EAAEC,OAAgB,EAAE;IAAA,IAAAQ,qBAAA,EAAAC,qBAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,SAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IACxD,IAAIb,IAAI,KAAKe,gBAAK,IAAIf,IAAI,KAAKgB,gBAAK,EAAE;MACpC,MAAM,IAAIC,kBAAc,CAAC,yDAAyD,CAAC;IACrF;IACA,IAAI,CAACjB,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACkB,qBAAqB,GAAG,KAAK;IAClC,IAAI,CAACC,KAAK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AI,CAAC0C,wBAAwB,CAAC1C,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA6B,GAAA;IAAAC,KAAA,EAQA,SAAAyD,QAAA,EAAiB;MACf,OACE,IAAI,CAACrE,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAA0D,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACtE,KAAK,CAACG,MAAM,CAACC,UAAU;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAA2D,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACvE,KAAK,CAACG,MAAM,CAACI,aAAa;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAI,GAAA;IAAAC,KAAA,EAOA,SAAA4D,eAAA,EAAwB;MACtB,OAAO,IAAI,CAACtC,uBAAuB,CAAC,CAAC;IACvC;EAAC;EAAA,OAAA5C,SAAA;AAAA"}
|
|
@@ -44,6 +44,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
44
44
|
sipUri: string;
|
|
45
45
|
deviceUrl: string;
|
|
46
46
|
locusUrl: string;
|
|
47
|
+
locusClusterUrl: string;
|
|
47
48
|
resourceId: string;
|
|
48
49
|
correlationId: string;
|
|
49
50
|
ensureConversation: boolean;
|
|
@@ -60,7 +61,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
60
61
|
locale?: string;
|
|
61
62
|
deviceCapabilities?: Array<string>;
|
|
62
63
|
liveAnnotationSupported: boolean;
|
|
63
|
-
ipVersion
|
|
64
|
+
ipVersion?: IP_VERSION;
|
|
64
65
|
}): Promise<any>;
|
|
65
66
|
/**
|
|
66
67
|
* Send a request to refresh the captcha
|
|
@@ -201,6 +202,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
201
202
|
* @param {String} options.deviceUrl Url of a device
|
|
202
203
|
* @param {String} options.resourceId Populated if you are paired to a device
|
|
203
204
|
* @param {String} options.uri floor grant uri
|
|
205
|
+
* @param {String} options.shareInstanceId id for current share
|
|
204
206
|
* @returns {Promise}
|
|
205
207
|
*/
|
|
206
208
|
changeMeetingFloor(options: {
|
|
@@ -210,6 +212,7 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
210
212
|
resourceId: string;
|
|
211
213
|
uri: string;
|
|
212
214
|
annotationInfo: AnnotationInfo;
|
|
215
|
+
shareInstanceId: string;
|
|
213
216
|
} | any): any;
|
|
214
217
|
/**
|
|
215
218
|
* Sends a request to the DTMF endpoint to send tones
|
package/dist/meeting/request.js
CHANGED
|
@@ -24,22 +24,24 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/
|
|
|
24
24
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
25
25
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
26
26
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
27
|
-
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
|
28
27
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
28
|
+
var _lodash = require("lodash");
|
|
29
29
|
var _webexCore = require("@webex/webex-core");
|
|
30
30
|
var _common = require("@webex/common");
|
|
31
|
+
var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
|
|
31
32
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
32
33
|
var _constants = require("../constants");
|
|
33
34
|
var _util = _interopRequireDefault(require("./util"));
|
|
34
35
|
var _excluded = ["meeting"];
|
|
35
|
-
function ownKeys(
|
|
36
|
-
function _objectSpread(
|
|
36
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
37
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // @ts-ignore
|
|
40
|
+
// @ts-ignore
|
|
39
41
|
/**
|
|
40
42
|
* @class MeetingRequest
|
|
41
43
|
*/
|
|
42
|
-
var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
44
|
+
var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
43
45
|
(0, _inherits2.default)(MeetingRequest, _StatelessWebexPlugin);
|
|
44
46
|
var _super = _createSuper(MeetingRequest);
|
|
45
47
|
/**
|
|
@@ -57,6 +59,10 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
57
59
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingRef", void 0);
|
|
58
60
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "locusDeltaRequest", void 0);
|
|
59
61
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "buildLocusDeltaRequestOptions", void 0);
|
|
62
|
+
/**
|
|
63
|
+
* Returns joinCookie from boundedStorage if present.
|
|
64
|
+
* @returns {Object} joinCookie
|
|
65
|
+
*/
|
|
60
66
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getJoinCookie", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
61
67
|
var joinCookieRaw, joinCookie;
|
|
62
68
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -94,20 +100,15 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
94
100
|
})));
|
|
95
101
|
_this.locusDeltaRequest = _util.default.generateLocusDeltaRequest(meeting);
|
|
96
102
|
_this.buildLocusDeltaRequestOptions = _util.default.generateBuildLocusDeltaRequestOptions(meeting);
|
|
97
|
-
_this.changeVideoLayoutDebounced = (0,
|
|
103
|
+
_this.changeVideoLayoutDebounced = (0, _lodash.debounce)(_this.changeVideoLayout, 2000, {
|
|
98
104
|
leading: true,
|
|
99
105
|
trailing: true
|
|
100
106
|
});
|
|
101
107
|
return _this;
|
|
102
108
|
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Returns joinCookie from boundedStorage if present.
|
|
106
|
-
* @returns {Object} joinCookie
|
|
107
|
-
*/
|
|
108
109
|
(0, _createClass2.default)(MeetingRequest, [{
|
|
109
110
|
key: "joinMeeting",
|
|
110
|
-
value:
|
|
111
|
+
value: (
|
|
111
112
|
/**
|
|
112
113
|
* Make a network request to join a meeting
|
|
113
114
|
* @param {Object} options
|
|
@@ -166,6 +167,13 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
166
167
|
if (liveAnnotationSupported) {
|
|
167
168
|
deviceCapabilities.push(_constants.ANNOTATION.ANNOTATION_ON_SHARE_SUPPORTED);
|
|
168
169
|
}
|
|
170
|
+
|
|
171
|
+
// append installationId to device config if it exists
|
|
172
|
+
// @ts-ignore
|
|
173
|
+
if (this.webex.internal.device.config.installationId) {
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
body.device.installationId = this.webex.internal.device.config.installationId;
|
|
176
|
+
}
|
|
169
177
|
if (locale) {
|
|
170
178
|
body.locale = locale;
|
|
171
179
|
}
|
|
@@ -180,6 +188,9 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
180
188
|
body.device.countryCode = this.webex.meetings.geoHintInfo.countryCode;
|
|
181
189
|
// @ts-ignore
|
|
182
190
|
body.device.regionCode = this.webex.meetings.geoHintInfo.regionCode;
|
|
191
|
+
body.device.localIp =
|
|
192
|
+
// @ts-ignore
|
|
193
|
+
_internalPluginMetrics.CallDiagnosticUtils.anonymizeIPAddress(this.webex.meetings.geoHintInfo.clientAddress) || undefined;
|
|
183
194
|
}
|
|
184
195
|
if (moderator !== undefined) {
|
|
185
196
|
body.moderator = moderator;
|
|
@@ -191,44 +202,44 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
191
202
|
body.pin = pin;
|
|
192
203
|
}
|
|
193
204
|
if (!locusUrl) {
|
|
194
|
-
_context2.next =
|
|
205
|
+
_context2.next = 20;
|
|
195
206
|
break;
|
|
196
207
|
}
|
|
197
208
|
url = "".concat(locusUrl, "/").concat(_constants.PARTICIPANT);
|
|
198
|
-
_context2.next =
|
|
209
|
+
_context2.next = 37;
|
|
199
210
|
break;
|
|
200
|
-
case
|
|
211
|
+
case 20:
|
|
201
212
|
if (!(inviteeAddress || meetingNumber)) {
|
|
202
|
-
_context2.next =
|
|
213
|
+
_context2.next = 37;
|
|
203
214
|
break;
|
|
204
215
|
}
|
|
205
|
-
_context2.prev =
|
|
216
|
+
_context2.prev = 21;
|
|
206
217
|
if (!locusClusterUrl) {
|
|
207
|
-
_context2.next =
|
|
218
|
+
_context2.next = 26;
|
|
208
219
|
break;
|
|
209
220
|
}
|
|
210
221
|
clusterUrl = "https://".concat(locusClusterUrl, "/locus/api/v1");
|
|
211
|
-
_context2.next =
|
|
222
|
+
_context2.next = 29;
|
|
212
223
|
break;
|
|
213
|
-
case
|
|
214
|
-
_context2.next =
|
|
224
|
+
case 26:
|
|
225
|
+
_context2.next = 28;
|
|
215
226
|
return this.webex.internal.services.waitForCatalog('postauth');
|
|
216
|
-
case
|
|
227
|
+
case 28:
|
|
217
228
|
// @ts-ignore
|
|
218
229
|
clusterUrl = this.webex.internal.services.get('locus');
|
|
219
|
-
case
|
|
230
|
+
case 29:
|
|
220
231
|
url = "".concat(clusterUrl, "/").concat(_constants.LOCI, "/").concat(_constants.CALL);
|
|
221
232
|
body.invitee = {
|
|
222
233
|
address: inviteeAddress || "wbxmn:".concat(meetingNumber)
|
|
223
234
|
};
|
|
224
|
-
_context2.next =
|
|
235
|
+
_context2.next = 37;
|
|
225
236
|
break;
|
|
226
|
-
case
|
|
227
|
-
_context2.prev =
|
|
228
|
-
_context2.t0 = _context2["catch"](
|
|
237
|
+
case 33:
|
|
238
|
+
_context2.prev = 33;
|
|
239
|
+
_context2.t0 = _context2["catch"](21);
|
|
229
240
|
_loggerProxy.default.logger.error("Meeting:request#joinMeeting Error Joining ".concat(inviteeAddress || meetingNumber, " --> ").concat(_context2.t0));
|
|
230
241
|
throw _context2.t0;
|
|
231
|
-
case
|
|
242
|
+
case 37:
|
|
232
243
|
// TODO: -- this will be resolved in SDK request
|
|
233
244
|
url = url.concat("?".concat(_constants.ALTERNATE_REDIRECT_TRUE));
|
|
234
245
|
if (resourceId === inviteeAddress) {
|
|
@@ -246,11 +257,11 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
246
257
|
uri: url,
|
|
247
258
|
body: body
|
|
248
259
|
}));
|
|
249
|
-
case
|
|
260
|
+
case 41:
|
|
250
261
|
case "end":
|
|
251
262
|
return _context2.stop();
|
|
252
263
|
}
|
|
253
|
-
}, _callee2, this, [[
|
|
264
|
+
}, _callee2, this, [[21, 33]]);
|
|
254
265
|
}));
|
|
255
266
|
function joinMeeting(_x) {
|
|
256
267
|
return _joinMeeting.apply(this, arguments);
|
|
@@ -265,6 +276,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
265
276
|
* @returns {Promise}
|
|
266
277
|
* @private
|
|
267
278
|
*/
|
|
279
|
+
)
|
|
268
280
|
}, {
|
|
269
281
|
key: "refreshCaptcha",
|
|
270
282
|
value: function refreshCaptcha(_ref2) {
|
|
@@ -385,7 +397,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
385
397
|
uri: url
|
|
386
398
|
}).catch(function (err) {
|
|
387
399
|
_loggerProxy.default.logger.error("Meeting:request#getLocusDTO --> Error getting latest locus, error ".concat(err));
|
|
388
|
-
|
|
400
|
+
throw err;
|
|
389
401
|
});
|
|
390
402
|
}
|
|
391
403
|
return _promise.default.reject();
|
|
@@ -591,6 +603,7 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
591
603
|
* @param {String} options.deviceUrl Url of a device
|
|
592
604
|
* @param {String} options.resourceId Populated if you are paired to a device
|
|
593
605
|
* @param {String} options.uri floor grant uri
|
|
606
|
+
* @param {String} options.shareInstanceId id for current share
|
|
594
607
|
* @returns {Promise}
|
|
595
608
|
*/
|
|
596
609
|
}, {
|
|
@@ -621,6 +634,9 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
621
634
|
floor: floorReq,
|
|
622
635
|
resourceUrl: options.resourceUrl
|
|
623
636
|
};
|
|
637
|
+
if (options !== null && options !== void 0 && options.shareInstanceId) {
|
|
638
|
+
body.floor.shareInstanceId = options.shareInstanceId;
|
|
639
|
+
}
|
|
624
640
|
if (options !== null && options !== void 0 && options.resourceToken) {
|
|
625
641
|
body.resourceToken = options === null || options === void 0 ? void 0 : options.resourceToken;
|
|
626
642
|
}
|
|
@@ -825,5 +841,4 @@ var MeetingRequest = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
825
841
|
}]);
|
|
826
842
|
return MeetingRequest;
|
|
827
843
|
}(_webexCore.StatelessWebexPlugin);
|
|
828
|
-
exports.default = MeetingRequest;
|
|
829
844
|
//# sourceMappingURL=request.js.map
|