@webex/plugin-meetings 3.0.0-beta.16 → 3.0.0-beta.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -1
- package/dist/annotation/annotation.types.js +7 -0
- package/dist/annotation/annotation.types.js.map +1 -0
- package/dist/annotation/constants.js +49 -0
- package/dist/annotation/constants.js.map +1 -0
- package/dist/annotation/index.js +359 -0
- package/dist/annotation/index.js.map +1 -0
- package/dist/breakouts/breakout.js +212 -0
- package/dist/breakouts/breakout.js.map +1 -0
- package/dist/breakouts/collection.js +23 -0
- package/dist/breakouts/collection.js.map +1 -0
- package/dist/breakouts/edit-lock-error.js +52 -0
- package/dist/breakouts/edit-lock-error.js.map +1 -0
- package/dist/breakouts/events.js +43 -0
- package/dist/breakouts/events.js.map +1 -0
- package/dist/breakouts/index.js +1046 -0
- package/dist/breakouts/index.js.map +1 -0
- package/dist/breakouts/request.js +78 -0
- package/dist/breakouts/request.js.map +1 -0
- package/dist/breakouts/utils.js +67 -0
- package/dist/breakouts/utils.js.map +1 -0
- package/dist/common/errors/webex-errors.js +3 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/config.js +6 -8
- package/dist/config.js.map +1 -1
- package/dist/constants.js +175 -26
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +14 -0
- package/dist/controls-options-manager/constants.js.map +1 -0
- package/dist/controls-options-manager/enums.js +27 -0
- package/dist/controls-options-manager/enums.js.map +1 -0
- package/dist/controls-options-manager/index.js +297 -0
- package/dist/controls-options-manager/index.js.map +1 -0
- package/dist/controls-options-manager/types.js +7 -0
- package/dist/controls-options-manager/types.js.map +1 -0
- package/dist/controls-options-manager/util.js +300 -0
- package/dist/controls-options-manager/util.js.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -1
- package/dist/interpretation/collection.js +23 -0
- package/dist/interpretation/collection.js.map +1 -0
- package/dist/interpretation/index.js +214 -0
- package/dist/interpretation/index.js.map +1 -0
- package/dist/interpretation/siLanguage.js +25 -0
- package/dist/interpretation/siLanguage.js.map +1 -0
- package/dist/locus-info/controlsUtils.js +92 -2
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +317 -24
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +43 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +2 -1
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +97 -14
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +39 -134
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +19 -97
- package/dist/media/properties.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +505 -493
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +79 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2349 -2178
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +291 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -0
- package/dist/meeting/muteState.js +229 -124
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +191 -167
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +444 -443
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +157 -49
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +20 -5
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +22 -0
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +365 -73
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +7 -0
- package/dist/meetings/meetings.types.js.map +1 -0
- package/dist/meetings/request.js +16 -12
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +88 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +43 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +15 -0
- package/dist/member/types.js.map +1 -0
- package/dist/member/util.js +97 -3
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +10 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +94 -11
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +109 -39
- package/dist/members/request.js.map +1 -1
- package/dist/members/types.js +15 -0
- package/dist/members/types.js.map +1 -0
- package/dist/members/util.js +316 -233
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +50 -14
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js +3 -5
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +48 -29
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +265 -36
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +52 -19
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +53 -33
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +44 -18
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +60 -3
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +322 -103
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +4 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/reachability/index.js +117 -60
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +12 -5
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/constants.js +13 -0
- package/dist/reactions/constants.js.map +1 -0
- package/dist/reactions/reactions.js +2 -2
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +18 -18
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +190 -145
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js +17 -0
- package/dist/recording-controller/enums.js.map +1 -0
- package/dist/recording-controller/index.js +343 -0
- package/dist/recording-controller/index.js.map +1 -0
- package/dist/recording-controller/util.js +63 -0
- package/dist/recording-controller/util.js.map +1 -0
- package/dist/roap/index.js +21 -29
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +127 -92
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +135 -53
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +1 -93
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +329 -314
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +103 -54
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/types/annotation/annotation.types.d.ts +43 -0
- package/dist/types/annotation/constants.d.ts +31 -0
- package/dist/types/annotation/index.d.ts +124 -0
- package/dist/types/breakouts/breakout.d.ts +8 -0
- package/dist/types/breakouts/collection.d.ts +5 -0
- package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/types/breakouts/events.d.ts +2 -0
- package/dist/types/breakouts/index.d.ts +5 -0
- package/dist/types/breakouts/request.d.ts +22 -0
- package/dist/types/breakouts/utils.d.ts +15 -0
- package/dist/types/common/browser-detection.d.ts +9 -0
- package/dist/types/common/collection.d.ts +48 -0
- package/dist/types/common/config.d.ts +2 -0
- package/dist/types/common/errors/captcha-error.d.ts +15 -0
- package/dist/types/common/errors/intent-to-join.d.ts +16 -0
- package/dist/types/common/errors/join-meeting.d.ts +17 -0
- package/dist/types/common/errors/media.d.ts +15 -0
- package/dist/types/common/errors/parameter.d.ts +15 -0
- package/dist/types/common/errors/password-error.d.ts +15 -0
- package/dist/types/common/errors/permission.d.ts +14 -0
- package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
- package/dist/types/common/errors/reconnection.d.ts +15 -0
- package/dist/types/common/errors/stats.d.ts +15 -0
- package/dist/types/common/errors/webex-errors.d.ts +69 -0
- package/dist/types/common/errors/webex-meetings-error.d.ts +20 -0
- package/dist/types/common/events/events-scope.d.ts +17 -0
- package/dist/types/common/events/events.d.ts +12 -0
- package/dist/types/common/events/trigger-proxy.d.ts +2 -0
- package/dist/types/common/events/util.d.ts +2 -0
- package/dist/types/common/logs/logger-config.d.ts +2 -0
- package/dist/types/common/logs/logger-proxy.d.ts +2 -0
- package/dist/types/common/logs/request.d.ts +34 -0
- package/dist/types/common/queue.d.ts +32 -0
- package/dist/types/config.d.ts +72 -0
- package/dist/types/constants.d.ts +987 -0
- package/dist/types/controls-options-manager/constants.d.ts +4 -0
- package/dist/types/controls-options-manager/enums.d.ts +15 -0
- package/dist/types/controls-options-manager/index.d.ts +136 -0
- package/dist/types/controls-options-manager/types.d.ts +43 -0
- package/dist/types/controls-options-manager/util.d.ts +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/interpretation/collection.d.ts +5 -0
- package/dist/types/interpretation/index.d.ts +5 -0
- package/dist/types/interpretation/siLanguage.d.ts +5 -0
- package/dist/types/locus-info/controlsUtils.d.ts +2 -0
- package/dist/types/locus-info/embeddedAppsUtils.d.ts +2 -0
- package/dist/types/locus-info/fullState.d.ts +2 -0
- package/dist/types/locus-info/hostUtils.d.ts +2 -0
- package/dist/types/locus-info/index.d.ts +315 -0
- package/dist/types/locus-info/infoUtils.d.ts +2 -0
- package/dist/types/locus-info/mediaSharesUtils.d.ts +2 -0
- package/dist/types/locus-info/parser.d.ts +212 -0
- package/dist/types/locus-info/selfUtils.d.ts +2 -0
- package/dist/types/media/index.d.ts +34 -0
- package/dist/types/media/properties.d.ts +86 -0
- package/dist/types/media/util.d.ts +2 -0
- package/dist/types/mediaQualityMetrics/config.d.ts +365 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +149 -0
- package/dist/types/meeting/index.d.ts +1524 -0
- package/dist/types/meeting/locusMediaRequest.d.ts +70 -0
- package/dist/types/meeting/muteState.d.ts +184 -0
- package/dist/types/meeting/request.d.ts +270 -0
- package/dist/types/meeting/request.type.d.ts +11 -0
- package/dist/types/meeting/state.d.ts +9 -0
- package/dist/types/meeting/util.d.ts +75 -0
- package/dist/types/meeting-info/collection.d.ts +20 -0
- package/dist/types/meeting-info/index.d.ts +57 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +122 -0
- package/dist/types/meeting-info/request.d.ts +22 -0
- package/dist/types/meeting-info/util.d.ts +2 -0
- package/dist/types/meeting-info/utilv2.d.ts +2 -0
- package/dist/types/meetings/collection.d.ts +31 -0
- package/dist/types/meetings/index.d.ts +364 -0
- package/dist/types/meetings/meetings.types.d.ts +4 -0
- package/dist/types/meetings/request.d.ts +27 -0
- package/dist/types/meetings/util.d.ts +18 -0
- package/dist/types/member/index.d.ts +158 -0
- package/dist/types/member/types.d.ts +21 -0
- package/dist/types/member/util.d.ts +2 -0
- package/dist/types/members/collection.d.ts +29 -0
- package/dist/types/members/index.d.ts +353 -0
- package/dist/types/members/request.d.ts +114 -0
- package/dist/types/members/types.d.ts +24 -0
- package/dist/types/members/util.d.ts +210 -0
- package/dist/types/metrics/config.d.ts +195 -0
- package/dist/types/metrics/constants.d.ts +55 -0
- package/dist/types/metrics/index.d.ts +169 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +118 -0
- package/dist/types/multistream/receiveSlot.d.ts +68 -0
- package/dist/types/multistream/receiveSlotManager.d.ts +56 -0
- package/dist/types/multistream/remoteMedia.d.ts +72 -0
- package/dist/types/multistream/remoteMediaGroup.d.ts +47 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +277 -0
- package/dist/types/networkQualityMonitor/index.d.ts +70 -0
- package/dist/types/personal-meeting-room/index.d.ts +47 -0
- package/dist/types/personal-meeting-room/request.d.ts +14 -0
- package/dist/types/personal-meeting-room/util.d.ts +2 -0
- package/dist/types/reachability/index.d.ts +152 -0
- package/dist/types/reachability/request.d.ts +37 -0
- package/dist/types/reactions/constants.d.ts +3 -0
- package/dist/types/reactions/reactions.d.ts +4 -0
- package/dist/types/reactions/reactions.type.d.ts +52 -0
- package/dist/types/reconnection-manager/index.d.ts +126 -0
- package/dist/types/recording-controller/enums.d.ts +7 -0
- package/dist/types/recording-controller/index.d.ts +193 -0
- package/dist/types/recording-controller/util.d.ts +13 -0
- package/dist/types/roap/index.d.ts +77 -0
- package/dist/types/roap/request.d.ts +36 -0
- package/dist/types/roap/turnDiscovery.d.ts +91 -0
- package/dist/types/statsAnalyzer/global.d.ts +36 -0
- package/dist/types/statsAnalyzer/index.d.ts +200 -0
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +24 -0
- package/dist/types/transcription/index.d.ts +64 -0
- package/package.json +28 -21
- package/src/annotation/annotation.types.ts +52 -0
- package/src/annotation/constants.ts +36 -0
- package/src/annotation/index.ts +343 -0
- package/src/breakouts/README.md +220 -0
- package/src/breakouts/breakout.ts +180 -0
- package/src/breakouts/collection.ts +19 -0
- package/src/breakouts/edit-lock-error.ts +25 -0
- package/src/breakouts/events.ts +37 -0
- package/src/breakouts/index.ts +921 -0
- package/src/breakouts/request.ts +55 -0
- package/src/breakouts/utils.ts +57 -0
- package/src/common/errors/webex-errors.ts +6 -2
- package/src/common/logs/logger-proxy.ts +1 -1
- package/src/config.ts +5 -7
- package/src/constants.ts +165 -20
- package/src/controls-options-manager/constants.ts +5 -0
- package/src/controls-options-manager/enums.ts +18 -0
- package/src/controls-options-manager/index.ts +278 -0
- package/src/controls-options-manager/types.ts +59 -0
- package/src/controls-options-manager/util.ts +286 -0
- package/src/index.ts +34 -0
- package/src/interpretation/README.md +51 -0
- package/src/interpretation/collection.ts +19 -0
- package/src/interpretation/index.ts +182 -0
- package/src/interpretation/siLanguage.ts +18 -0
- package/src/locus-info/controlsUtils.ts +110 -0
- package/src/locus-info/index.ts +339 -21
- package/src/locus-info/mediaSharesUtils.ts +48 -0
- package/src/locus-info/parser.ts +2 -1
- package/src/locus-info/selfUtils.ts +86 -2
- package/src/media/index.ts +70 -142
- package/src/media/properties.ts +41 -104
- package/src/mediaQualityMetrics/config.ts +379 -377
- package/src/meeting/in-meeting-actions.ts +156 -0
- package/src/meeting/index.ts +1779 -1741
- package/src/meeting/locusMediaRequest.ts +309 -0
- package/src/meeting/muteState.ts +228 -132
- package/src/meeting/request.ts +100 -91
- package/src/meeting/request.type.ts +2 -0
- package/src/meeting/util.ts +422 -421
- package/src/meeting-info/meeting-info-v2.ts +134 -13
- package/src/meeting-info/utilv2.ts +13 -3
- package/src/meetings/collection.ts +20 -0
- package/src/meetings/index.ts +385 -83
- package/src/meetings/meetings.types.ts +12 -0
- package/src/meetings/request.ts +3 -1
- package/src/meetings/util.ts +103 -4
- package/src/member/index.ts +42 -0
- package/src/member/types.ts +24 -0
- package/src/member/util.ts +95 -1
- package/src/members/collection.ts +8 -0
- package/src/members/index.ts +108 -6
- package/src/members/request.ts +98 -17
- package/src/members/types.ts +28 -0
- package/src/members/util.ts +319 -240
- package/src/metrics/config.ts +49 -10
- package/src/metrics/constants.ts +2 -4
- package/src/metrics/index.ts +43 -27
- package/src/multistream/mediaRequestManager.ts +337 -63
- package/src/multistream/receiveSlot.ts +68 -26
- package/src/multistream/receiveSlotManager.ts +61 -38
- package/src/multistream/remoteMedia.ts +29 -3
- package/src/multistream/remoteMediaGroup.ts +61 -2
- package/src/multistream/remoteMediaManager.ts +260 -66
- package/src/networkQualityMonitor/index.ts +6 -6
- package/src/reachability/index.ts +75 -25
- package/src/reachability/request.ts +10 -5
- package/src/reactions/constants.ts +4 -0
- package/src/reactions/reactions.ts +4 -4
- package/src/reactions/reactions.type.ts +28 -3
- package/src/reconnection-manager/index.ts +53 -32
- package/src/recording-controller/enums.ts +8 -0
- package/src/recording-controller/index.ts +315 -0
- package/src/recording-controller/util.ts +58 -0
- package/src/roap/index.ts +21 -30
- package/src/roap/request.ts +51 -52
- package/src/roap/turnDiscovery.ts +51 -27
- package/src/statsAnalyzer/global.ts +1 -94
- package/src/statsAnalyzer/index.ts +380 -390
- package/src/statsAnalyzer/mqaUtil.ts +106 -99
- package/test/integration/spec/converged-space-meetings.js +233 -0
- package/test/integration/spec/journey.js +331 -254
- package/test/integration/spec/space-meeting.js +77 -4
- package/test/unit/spec/annotation/index.ts +436 -0
- package/test/unit/spec/breakouts/breakout.ts +233 -0
- package/test/unit/spec/breakouts/collection.ts +15 -0
- package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
- package/test/unit/spec/breakouts/events.ts +77 -0
- package/test/unit/spec/breakouts/index.ts +1790 -0
- package/test/unit/spec/breakouts/request.ts +104 -0
- package/test/unit/spec/breakouts/utils.js +72 -0
- package/test/unit/spec/controls-options-manager/index.js +287 -0
- package/test/unit/spec/controls-options-manager/util.js +518 -0
- package/test/unit/spec/fixture/locus.js +1 -0
- package/test/unit/spec/interpretation/collection.ts +15 -0
- package/test/unit/spec/interpretation/index.ts +329 -0
- package/test/unit/spec/interpretation/siLanguage.ts +26 -0
- package/test/unit/spec/locus-info/controlsUtils.js +323 -30
- package/test/unit/spec/locus-info/index.js +680 -4
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
- package/test/unit/spec/locus-info/selfConstant.js +48 -0
- package/test/unit/spec/locus-info/selfUtils.js +275 -0
- package/test/unit/spec/media/index.ts +118 -22
- package/test/unit/spec/media/properties.ts +9 -9
- package/test/unit/spec/meeting/in-meeting-actions.ts +76 -0
- package/test/unit/spec/meeting/index.js +2695 -1513
- package/test/unit/spec/meeting/locusMediaRequest.ts +436 -0
- package/test/unit/spec/meeting/muteState.js +370 -208
- package/test/unit/spec/meeting/request.js +354 -42
- package/test/unit/spec/meeting/utils.js +270 -156
- package/test/unit/spec/meeting-info/meetinginfov2.js +383 -5
- package/test/unit/spec/meeting-info/utilv2.js +21 -0
- package/test/unit/spec/meetings/collection.js +14 -0
- package/test/unit/spec/meetings/index.js +866 -120
- package/test/unit/spec/meetings/utils.js +206 -2
- package/test/unit/spec/member/index.js +31 -0
- package/test/unit/spec/member/util.js +408 -32
- package/test/unit/spec/members/index.js +320 -1
- package/test/unit/spec/members/request.js +206 -27
- package/test/unit/spec/members/utils.js +184 -0
- package/test/unit/spec/metrics/index.js +98 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +1012 -109
- package/test/unit/spec/multistream/receiveSlot.ts +77 -18
- package/test/unit/spec/multistream/receiveSlotManager.ts +69 -39
- package/test/unit/spec/multistream/remoteMedia.ts +32 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +271 -5
- package/test/unit/spec/multistream/remoteMediaManager.ts +672 -65
- package/test/unit/spec/networkQualityMonitor/index.js +4 -4
- package/test/unit/spec/reachability/index.ts +176 -25
- package/test/unit/spec/reachability/request.js +66 -0
- package/test/unit/spec/reconnection-manager/index.js +46 -13
- package/test/unit/spec/recording-controller/index.js +231 -0
- package/test/unit/spec/recording-controller/util.js +102 -0
- package/test/unit/spec/roap/index.ts +21 -51
- package/test/unit/spec/roap/request.ts +187 -0
- package/test/unit/spec/roap/turnDiscovery.ts +73 -34
- package/test/unit/spec/stats-analyzer/index.js +94 -43
- package/test/utils/constants.js +9 -0
- package/test/utils/integrationTestUtils.js +46 -0
- package/test/utils/testUtils.js +0 -45
- package/test/utils/webex-config.js +4 -0
- package/test/utils/webex-test-users.js +7 -3
- package/tsconfig.json +6 -0
- package/dist/media/internal-media-core-wrapper.js +0 -18
- package/dist/media/internal-media-core-wrapper.js.map +0 -1
- package/dist/meeting/effectsState.js +0 -262
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/multistream/multistreamMedia.js +0 -106
- package/dist/multistream/multistreamMedia.js.map +0 -1
- package/src/index.js +0 -15
- package/src/media/internal-media-core-wrapper.ts +0 -9
- package/src/meeting/effectsState.ts +0 -211
- package/src/multistream/multistreamMedia.ts +0 -93
- package/test/unit/spec/meeting/effectsState.js +0 -281
package/src/metrics/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import uuid from 'uuid';
|
|
|
8
8
|
import window from 'global/window';
|
|
9
9
|
import anonymize from 'ip-anonymize';
|
|
10
10
|
|
|
11
|
+
import {getOSNameInternal} from '@webex/internal-plugin-metrics';
|
|
11
12
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
12
13
|
import {MEETING_ERRORS} from '../constants';
|
|
13
14
|
import BrowserDetection from '../common/browser-detection';
|
|
@@ -16,22 +17,12 @@ import {
|
|
|
16
17
|
error,
|
|
17
18
|
eventType,
|
|
18
19
|
errorCodes as ERROR_CODE,
|
|
19
|
-
OS_NAME,
|
|
20
20
|
UNKNOWN,
|
|
21
21
|
CLIENT_NAME,
|
|
22
22
|
mediaType,
|
|
23
|
+
WebexAPIServiceErrorCodes,
|
|
23
24
|
} from './config';
|
|
24
25
|
|
|
25
|
-
const OSMap = {
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
'Chrome OS': OS_NAME.chrome,
|
|
28
|
-
macOS: OS_NAME.MAC,
|
|
29
|
-
Windows: OS_NAME.WINDOWS,
|
|
30
|
-
iOS: OS_NAME.IOS,
|
|
31
|
-
Android: OS_NAME.ANDROID,
|
|
32
|
-
Linux: OS_NAME.LINUX,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
26
|
const {getOSName, getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();
|
|
36
27
|
|
|
37
28
|
// Apply a CIDR /28 format to the IPV4 and /96 to the IPV6 addresses
|
|
@@ -41,10 +32,10 @@ const anonymizeIPAddress = (localIp) => anonymize(localIp, 28, 96);
|
|
|
41
32
|
const triggerTimers = ({event, meeting, data}) => {
|
|
42
33
|
switch (event) {
|
|
43
34
|
case eventType.CALL_INITIATED:
|
|
44
|
-
meeting.
|
|
35
|
+
meeting.setStartCallInitJoinReq();
|
|
45
36
|
break;
|
|
46
37
|
case eventType.LOCUS_JOIN_REQUEST:
|
|
47
|
-
meeting.
|
|
38
|
+
meeting.setEndCallInitJoinReq();
|
|
48
39
|
meeting.setStartJoinReqResp();
|
|
49
40
|
break;
|
|
50
41
|
case eventType.LOCUS_JOIN_RESPONSE:
|
|
@@ -199,13 +190,16 @@ class Metrics {
|
|
|
199
190
|
name: 'endpoint',
|
|
200
191
|
networkType: 'unknown',
|
|
201
192
|
userAgent: this.userAgentToString(),
|
|
193
|
+
userType: options.userType,
|
|
194
|
+
loginType: options.loginType,
|
|
195
|
+
channel: options.channel,
|
|
202
196
|
clientInfo: {
|
|
203
197
|
clientType: options.clientType,
|
|
204
198
|
clientVersion: `${CLIENT_NAME}/${this.webex.version}`,
|
|
205
199
|
localNetworkPrefix: anonymizeIPAddress(this.webex.meetings.geoHintInfo?.clientAddress),
|
|
206
200
|
osVersion: getOSVersion() || 'unknown',
|
|
207
201
|
subClientType: options.subClientType,
|
|
208
|
-
os:
|
|
202
|
+
os: getOSNameInternal(),
|
|
209
203
|
browser: getBrowserName(),
|
|
210
204
|
browserVersion: getBrowserVersion(),
|
|
211
205
|
},
|
|
@@ -251,22 +245,16 @@ class Metrics {
|
|
|
251
245
|
if (options.isRoapCallEnabled) {
|
|
252
246
|
payload.event.isRoapCallEnabled = options.isRoapCallEnabled;
|
|
253
247
|
}
|
|
248
|
+
['breakoutMoveId', 'breakoutSessionId', 'breakoutGroupId'].forEach((item) => {
|
|
249
|
+
if (options[item]) {
|
|
250
|
+
payload.event.identifiers[item] = options[item];
|
|
251
|
+
}
|
|
252
|
+
});
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
return payload;
|
|
257
256
|
}
|
|
258
257
|
|
|
259
|
-
/**
|
|
260
|
-
* returns metrics friendly OS versions
|
|
261
|
-
* @param {String} osName Os name
|
|
262
|
-
* @returns {String}
|
|
263
|
-
* @private
|
|
264
|
-
* @memberof Metrics
|
|
265
|
-
*/
|
|
266
|
-
private getOsName() {
|
|
267
|
-
return OSMap[getOSName()] ?? OS_NAME.OTHERS;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
258
|
/**
|
|
271
259
|
* get the payload specific for a media quality event through call analyzer
|
|
272
260
|
* @param {String} eventType the event name
|
|
@@ -311,7 +299,7 @@ class Metrics {
|
|
|
311
299
|
clientType: options.clientType, // TODO: Only clientType: 'TEAMS_CLIENT' is whitelisted
|
|
312
300
|
clientVersion: `${CLIENT_NAME}/${this.webex.version}`,
|
|
313
301
|
localNetworkPrefix: anonymizeIPAddress(this.webex.meetings.geoHintInfo?.clientAddress),
|
|
314
|
-
os:
|
|
302
|
+
os: getOSNameInternal(),
|
|
315
303
|
osVersion: getOSVersion() || UNKNOWN,
|
|
316
304
|
subClientType: options.subClientType,
|
|
317
305
|
browser: getBrowserName(),
|
|
@@ -465,6 +453,33 @@ class Metrics {
|
|
|
465
453
|
return this.generateErrorPayload(errorCode, showToUser, error.name.LOCUS_RESPONSE, err);
|
|
466
454
|
}
|
|
467
455
|
|
|
456
|
+
/**
|
|
457
|
+
* Pareses webex api error.
|
|
458
|
+
*
|
|
459
|
+
* @param {object} err
|
|
460
|
+
* @param {boolean} showToUser
|
|
461
|
+
* @returns {object | null}
|
|
462
|
+
*/
|
|
463
|
+
parseWebexApiError(err: any, showToUser: boolean) {
|
|
464
|
+
const serviceErrorCode = err?.body?.code;
|
|
465
|
+
const clientCodeError = WebexAPIServiceErrorCodes[serviceErrorCode];
|
|
466
|
+
|
|
467
|
+
if (clientCodeError) {
|
|
468
|
+
return this.generateErrorPayload(clientCodeError, showToUser, error.name.OTHER, err);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return this.generateErrorPayload(4100, showToUser, error.name.OTHER, err);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Generates Error for the CA event
|
|
476
|
+
*
|
|
477
|
+
* @param {integer} errorCode
|
|
478
|
+
* @param {boolean} shownToUser
|
|
479
|
+
* @param {string} name
|
|
480
|
+
* @param {any} err
|
|
481
|
+
* @returns {any}
|
|
482
|
+
*/
|
|
468
483
|
generateErrorPayload(errorCode, shownToUser, name, err) {
|
|
469
484
|
if (error.errors[errorCode]) {
|
|
470
485
|
const errorPayload: any = {
|
|
@@ -474,10 +489,11 @@ class Metrics {
|
|
|
474
489
|
errorCode,
|
|
475
490
|
fatal: !includes(error.notFatalErrorList, errorCode),
|
|
476
491
|
name: name || error.name.OTHER,
|
|
492
|
+
serviceErrorCode: err?.body?.code,
|
|
477
493
|
};
|
|
478
494
|
|
|
479
495
|
if (err && err.body) {
|
|
480
|
-
errorPayload.errorData = err.body;
|
|
496
|
+
errorPayload.errorData = {error: err.body};
|
|
481
497
|
}
|
|
482
498
|
|
|
483
499
|
if (err && err.statusCode) {
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
/* eslint-disable require-jsdoc */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StreamRequest,
|
|
4
|
+
Policy,
|
|
5
|
+
ActiveSpeakerInfo,
|
|
6
|
+
ReceiverSelectedInfo,
|
|
7
|
+
CodecInfo as WcmeCodecInfo,
|
|
8
|
+
H264Codec,
|
|
9
|
+
getRecommendedMaxBitrateForFrameSize,
|
|
10
|
+
RecommendedOpusBitrates,
|
|
11
|
+
} from '@webex/internal-media-core';
|
|
12
|
+
import {cloneDeepWith, debounce, isEmpty} from 'lodash';
|
|
3
13
|
|
|
4
14
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
5
15
|
|
|
6
|
-
import {ReceiveSlot,
|
|
16
|
+
import {ReceiveSlot, ReceiveSlotEvents} from './receiveSlot';
|
|
17
|
+
import {getMaxFs} from './remoteMedia';
|
|
7
18
|
|
|
8
19
|
export interface ActiveSpeakerPolicyInfo {
|
|
9
20
|
policy: 'active-speaker';
|
|
@@ -35,6 +46,8 @@ export interface MediaRequest {
|
|
|
35
46
|
policyInfo: PolicyInfo;
|
|
36
47
|
receiveSlots: Array<ReceiveSlot>;
|
|
37
48
|
codecInfo?: CodecInfo;
|
|
49
|
+
preferredMaxFs?: number;
|
|
50
|
+
handleMaxFs?: ({maxFs}: {maxFs: number}) => void;
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
export type MediaRequestId = string;
|
|
@@ -47,91 +60,326 @@ const CODEC_DEFAULTS = {
|
|
|
47
60
|
},
|
|
48
61
|
};
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
const DEBOUNCED_SOURCE_UPDATE_TIME = 1000;
|
|
64
|
+
|
|
65
|
+
type DegradationPreferences = {
|
|
66
|
+
maxMacroblocksLimit: number;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
type SendMediaRequestsCallback = (streamRequests: StreamRequest[]) => void;
|
|
70
|
+
type Kind = 'audio' | 'video';
|
|
71
|
+
|
|
72
|
+
type Options = {
|
|
73
|
+
degradationPreferences: DegradationPreferences;
|
|
74
|
+
kind: Kind;
|
|
75
|
+
trimRequestsToNumOfSources: boolean; // if enabled, AS speaker requests will be trimmed based on the calls to setNumCurrentSources()
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
type ClientRequestsMap = {[key: MediaRequestId]: MediaRequest};
|
|
51
79
|
|
|
52
80
|
export class MediaRequestManager {
|
|
53
81
|
private sendMediaRequestsCallback: SendMediaRequestsCallback;
|
|
54
82
|
|
|
55
|
-
private
|
|
83
|
+
private kind: Kind;
|
|
84
|
+
|
|
85
|
+
private counter: number;
|
|
86
|
+
|
|
87
|
+
private clientRequests: ClientRequestsMap;
|
|
56
88
|
|
|
57
|
-
private
|
|
89
|
+
private degradationPreferences: DegradationPreferences;
|
|
58
90
|
|
|
59
|
-
private
|
|
91
|
+
private sourceUpdateListener: () => void;
|
|
60
92
|
|
|
61
|
-
|
|
93
|
+
private debouncedSourceUpdateListener: () => void;
|
|
94
|
+
|
|
95
|
+
private previousStreamRequests: Array<StreamRequest> = [];
|
|
96
|
+
|
|
97
|
+
private trimRequestsToNumOfSources: boolean;
|
|
98
|
+
private numTotalSources: number;
|
|
99
|
+
private numLiveSources: number;
|
|
100
|
+
|
|
101
|
+
constructor(sendMediaRequestsCallback: SendMediaRequestsCallback, options: Options) {
|
|
62
102
|
this.sendMediaRequestsCallback = sendMediaRequestsCallback;
|
|
63
103
|
this.counter = 0;
|
|
104
|
+
this.numLiveSources = 0;
|
|
105
|
+
this.numTotalSources = 0;
|
|
64
106
|
this.clientRequests = {};
|
|
65
|
-
this.
|
|
107
|
+
this.degradationPreferences = options.degradationPreferences;
|
|
108
|
+
this.kind = options.kind;
|
|
109
|
+
this.trimRequestsToNumOfSources = options.trimRequestsToNumOfSources;
|
|
110
|
+
this.sourceUpdateListener = this.commit.bind(this);
|
|
111
|
+
this.debouncedSourceUpdateListener = debounce(
|
|
112
|
+
this.sourceUpdateListener,
|
|
113
|
+
DEBOUNCED_SOURCE_UPDATE_TIME
|
|
114
|
+
);
|
|
66
115
|
}
|
|
67
116
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Object.values(this.clientRequests).forEach((request) =>
|
|
73
|
-
request.receiveSlots.forEach((slot) => {
|
|
74
|
-
activeSlots[slot.id] = slot;
|
|
75
|
-
})
|
|
76
|
-
);
|
|
117
|
+
public setDegradationPreferences(degradationPreferences: DegradationPreferences) {
|
|
118
|
+
this.degradationPreferences = degradationPreferences;
|
|
119
|
+
this.sendRequests(); // re-send requests after preferences are set
|
|
120
|
+
}
|
|
77
121
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
122
|
+
private getDegradedClientRequests(clientRequests: ClientRequestsMap) {
|
|
123
|
+
const maxFsLimits = [
|
|
124
|
+
getMaxFs('best'),
|
|
125
|
+
getMaxFs('large'),
|
|
126
|
+
getMaxFs('medium'),
|
|
127
|
+
getMaxFs('small'),
|
|
128
|
+
getMaxFs('very small'),
|
|
129
|
+
getMaxFs('thumbnail'),
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
// reduce max-fs until total macroblocks is below limit
|
|
133
|
+
for (let i = 0; i < maxFsLimits.length; i += 1) {
|
|
134
|
+
let totalMacroblocksRequested = 0;
|
|
135
|
+
Object.values(clientRequests).forEach((mr) => {
|
|
136
|
+
if (mr.codecInfo) {
|
|
137
|
+
mr.codecInfo.maxFs = Math.min(
|
|
138
|
+
mr.preferredMaxFs || CODEC_DEFAULTS.h264.maxFs,
|
|
139
|
+
mr.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs,
|
|
140
|
+
maxFsLimits[i]
|
|
141
|
+
);
|
|
142
|
+
// we only consider sources with "live" state
|
|
143
|
+
const slotsWithLiveSource = mr.receiveSlots.filter((rs) => rs.sourceState === 'live');
|
|
144
|
+
totalMacroblocksRequested += mr.codecInfo.maxFs * slotsWithLiveSource.length;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
if (totalMacroblocksRequested <= this.degradationPreferences.maxMacroblocksLimit) {
|
|
148
|
+
if (i !== 0) {
|
|
149
|
+
LoggerProxy.logger.warn(
|
|
150
|
+
`multistream:mediaRequestManager --> too many streams with high max-fs, frame size will be limited to ${maxFsLimits[i]}`
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
} else if (i === maxFsLimits.length - 1) {
|
|
155
|
+
LoggerProxy.logger.warn(
|
|
156
|
+
`multistream:mediaRequestManager --> even with frame size limited to ${maxFsLimits[i]} you are still requesting too many streams, consider reducing the number of requests`
|
|
85
157
|
);
|
|
86
|
-
slot.resetSourceState();
|
|
87
158
|
}
|
|
88
159
|
}
|
|
160
|
+
}
|
|
89
161
|
|
|
90
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Returns true if two stream requests are the same, false otherwise.
|
|
164
|
+
*
|
|
165
|
+
* @param {StreamRequest} streamRequestA - Stream request A for comparison.
|
|
166
|
+
* @param {StreamRequest} streamRequestB - Stream request B for comparison.
|
|
167
|
+
* @returns {boolean} - Whether they are equal.
|
|
168
|
+
*/
|
|
169
|
+
// eslint-disable-next-line class-methods-use-this
|
|
170
|
+
public isEqual(streamRequestA: StreamRequest, streamRequestB: StreamRequest) {
|
|
171
|
+
return (
|
|
172
|
+
JSON.stringify(streamRequestA._toJmpStreamRequest()) ===
|
|
173
|
+
JSON.stringify(streamRequestB._toJmpStreamRequest())
|
|
174
|
+
);
|
|
91
175
|
}
|
|
92
176
|
|
|
93
|
-
|
|
94
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Compares new stream requests to previous ones and determines
|
|
179
|
+
* if they are the same.
|
|
180
|
+
*
|
|
181
|
+
* @param {StreamRequest[]} newRequests - Array with new requests.
|
|
182
|
+
* @returns {boolean} - True if they are equal, false otherwise.
|
|
183
|
+
*/
|
|
184
|
+
private checkIsNewRequestsEqualToPrev(newRequests: StreamRequest[]) {
|
|
185
|
+
return (
|
|
186
|
+
!isEmpty(this.previousStreamRequests) &&
|
|
187
|
+
this.previousStreamRequests.length === newRequests.length &&
|
|
188
|
+
this.previousStreamRequests.every((req, idx) => this.isEqual(req, newRequests[idx]))
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Returns the maxPayloadBitsPerSecond per Stream
|
|
194
|
+
*
|
|
195
|
+
* If MediaRequestManager kind is "audio", a constant bitrate will be returned.
|
|
196
|
+
* If MediaRequestManager kind is "video", the bitrate will be calculated based
|
|
197
|
+
* on maxFs (default h264 maxFs as fallback if maxFs is not defined)
|
|
198
|
+
*
|
|
199
|
+
* @param {MediaRequest} mediaRequest - mediaRequest to take data from
|
|
200
|
+
* @returns {number} maxPayloadBitsPerSecond
|
|
201
|
+
*/
|
|
202
|
+
private getMaxPayloadBitsPerSecond(mediaRequest: MediaRequest): number {
|
|
203
|
+
if (this.kind === 'audio') {
|
|
204
|
+
// return mono_music bitrate default if the kind of mediarequest manager is audio:
|
|
205
|
+
return RecommendedOpusBitrates.FB_MONO_MUSIC;
|
|
206
|
+
}
|
|
95
207
|
|
|
96
|
-
|
|
97
|
-
|
|
208
|
+
return getRecommendedMaxBitrateForFrameSize(
|
|
209
|
+
mediaRequest.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Returns the max Macro Blocks per second (maxMbps) per H264 Stream
|
|
215
|
+
*
|
|
216
|
+
* The maxMbps will be calculated based on maxFs and maxFps
|
|
217
|
+
* (default h264 maxFps as fallback if maxFps is not defined)
|
|
218
|
+
*
|
|
219
|
+
* @param {MediaRequest} mediaRequest - mediaRequest to take data from
|
|
220
|
+
* @returns {number} maxMbps
|
|
221
|
+
*/
|
|
222
|
+
// eslint-disable-next-line class-methods-use-this
|
|
223
|
+
private getH264MaxMbps(mediaRequest: MediaRequest): number {
|
|
224
|
+
// fallback for maxFps (not needed for maxFs, since there is a fallback already in getDegradedClientRequests)
|
|
225
|
+
const maxFps = mediaRequest.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps;
|
|
226
|
+
|
|
227
|
+
// divided by 100 since maxFps is 3000 (for 30 frames per seconds)
|
|
228
|
+
return (mediaRequest.codecInfo.maxFs * maxFps) / 100;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Clears the previous stream requests.
|
|
233
|
+
*
|
|
234
|
+
* @returns {void}
|
|
235
|
+
*/
|
|
236
|
+
public clearPreviousRequests(): void {
|
|
237
|
+
this.previousStreamRequests = [];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Modifies the passed in clientRequests and makes sure that in total they don't ask
|
|
241
|
+
* for more streams than there are available.
|
|
242
|
+
*
|
|
243
|
+
* @param {Object} clientRequests
|
|
244
|
+
* @returns {void}
|
|
245
|
+
*/
|
|
246
|
+
private trimRequests(clientRequests: ClientRequestsMap) {
|
|
247
|
+
const preferLiveVideo = this.getPreferLiveVideo();
|
|
248
|
+
|
|
249
|
+
if (!this.trimRequestsToNumOfSources) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// preferLiveVideo being undefined means that there are no active-speaker requests so we don't need to do any trimming
|
|
254
|
+
if (preferLiveVideo === undefined) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
let numStreamsAvailable = preferLiveVideo ? this.numLiveSources : this.numTotalSources;
|
|
259
|
+
|
|
260
|
+
Object.values(clientRequests)
|
|
261
|
+
.sort((a, b) => {
|
|
262
|
+
// we have to count how many streams we're asking for
|
|
263
|
+
// and should not ask for more than numStreamsAvailable in total,
|
|
264
|
+
// so we might need to trim active-speaker requests and first ones to trim should be
|
|
265
|
+
// the ones with lowest priority
|
|
266
|
+
|
|
267
|
+
// receiver-selected requests have priority over active-speakers
|
|
268
|
+
if (a.policyInfo.policy === 'receiver-selected') {
|
|
269
|
+
return -1;
|
|
270
|
+
}
|
|
271
|
+
if (b.policyInfo.policy === 'receiver-selected') {
|
|
272
|
+
return 1;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// and active-speakers are sorted by descending priority
|
|
276
|
+
return b.policyInfo.priority - a.policyInfo.priority;
|
|
277
|
+
})
|
|
278
|
+
.forEach((request) => {
|
|
279
|
+
// we only trim active-speaker requests
|
|
280
|
+
if (request.policyInfo.policy === 'active-speaker') {
|
|
281
|
+
const trimmedCount = Math.min(numStreamsAvailable, request.receiveSlots.length);
|
|
282
|
+
|
|
283
|
+
request.receiveSlots.length = trimmedCount;
|
|
284
|
+
|
|
285
|
+
numStreamsAvailable -= trimmedCount;
|
|
286
|
+
} else {
|
|
287
|
+
numStreamsAvailable -= request.receiveSlots.length;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (numStreamsAvailable < 0) {
|
|
291
|
+
numStreamsAvailable = 0;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
private getPreferLiveVideo(): boolean | undefined {
|
|
297
|
+
let preferLiveVideo;
|
|
98
298
|
|
|
99
|
-
// map all the client media requests to wcme media requests
|
|
100
299
|
Object.values(this.clientRequests).forEach((mr) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
: new MC.ReceiverSelectedInfo(mr.policyInfo.csi),
|
|
114
|
-
mr.receiveSlots.map((receiveSlot) => receiveSlot.wcmeReceiveSlot),
|
|
115
|
-
maxPayloadBitsPerSecond,
|
|
116
|
-
mr.codecInfo && [
|
|
117
|
-
new MC.CodecInfo(
|
|
118
|
-
0x80,
|
|
119
|
-
new MC.H264Codec(
|
|
120
|
-
mr.codecInfo.maxFs || CODEC_DEFAULTS.h264.maxFs,
|
|
121
|
-
mr.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps,
|
|
122
|
-
mr.codecInfo.maxMbps || CODEC_DEFAULTS.h264.maxMbps,
|
|
123
|
-
mr.codecInfo.maxWidth,
|
|
124
|
-
mr.codecInfo.maxHeight
|
|
125
|
-
)
|
|
126
|
-
),
|
|
127
|
-
]
|
|
128
|
-
)
|
|
129
|
-
);
|
|
300
|
+
if (mr.policyInfo.policy === 'active-speaker') {
|
|
301
|
+
// take the value from first encountered active speaker request
|
|
302
|
+
if (preferLiveVideo === undefined) {
|
|
303
|
+
preferLiveVideo = mr.policyInfo.preferLiveVideo;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (mr.policyInfo.preferLiveVideo !== preferLiveVideo) {
|
|
307
|
+
throw new Error(
|
|
308
|
+
'a mix of active-speaker groups with different values for preferLiveVideo is not supported'
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
130
312
|
});
|
|
131
313
|
|
|
132
|
-
|
|
314
|
+
return preferLiveVideo;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
private cloneClientRequests(): ClientRequestsMap {
|
|
318
|
+
// we clone the client requests but without cloning the ReceiveSlots that they reference
|
|
319
|
+
return cloneDeepWith(this.clientRequests, (value, key) => {
|
|
320
|
+
if (key === 'receiveSlots') {
|
|
321
|
+
return [...value];
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return undefined;
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
private sendRequests() {
|
|
329
|
+
const streamRequests: StreamRequest[] = [];
|
|
330
|
+
|
|
331
|
+
// clone the requests so that any modifications we do to them don't affect the original ones
|
|
332
|
+
const clientRequests = this.cloneClientRequests();
|
|
333
|
+
|
|
334
|
+
this.trimRequests(clientRequests);
|
|
335
|
+
this.getDegradedClientRequests(clientRequests);
|
|
336
|
+
|
|
337
|
+
// map all the client media requests to wcme stream requests
|
|
338
|
+
Object.values(clientRequests).forEach((mr) => {
|
|
339
|
+
if (mr.receiveSlots.length > 0) {
|
|
340
|
+
streamRequests.push(
|
|
341
|
+
new StreamRequest(
|
|
342
|
+
mr.policyInfo.policy === 'active-speaker'
|
|
343
|
+
? Policy.ActiveSpeaker
|
|
344
|
+
: Policy.ReceiverSelected,
|
|
345
|
+
mr.policyInfo.policy === 'active-speaker'
|
|
346
|
+
? new ActiveSpeakerInfo(
|
|
347
|
+
mr.policyInfo.priority,
|
|
348
|
+
mr.policyInfo.crossPriorityDuplication,
|
|
349
|
+
mr.policyInfo.crossPolicyDuplication,
|
|
350
|
+
mr.policyInfo.preferLiveVideo
|
|
351
|
+
)
|
|
352
|
+
: new ReceiverSelectedInfo(mr.policyInfo.csi),
|
|
353
|
+
mr.receiveSlots.map((receiveSlot) => receiveSlot.wcmeReceiveSlot),
|
|
354
|
+
this.getMaxPayloadBitsPerSecond(mr),
|
|
355
|
+
mr.codecInfo && [
|
|
356
|
+
new WcmeCodecInfo(
|
|
357
|
+
0x80,
|
|
358
|
+
new H264Codec(
|
|
359
|
+
mr.codecInfo.maxFs,
|
|
360
|
+
mr.codecInfo.maxFps || CODEC_DEFAULTS.h264.maxFps,
|
|
361
|
+
this.getH264MaxMbps(mr),
|
|
362
|
+
mr.codecInfo.maxWidth,
|
|
363
|
+
mr.codecInfo.maxHeight
|
|
364
|
+
)
|
|
365
|
+
),
|
|
366
|
+
]
|
|
367
|
+
)
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
});
|
|
133
371
|
|
|
134
|
-
this.
|
|
372
|
+
//! IMPORTANT: this is only a temporary fix. This will soon be done in the jmp layer (@webex/json-multistream)
|
|
373
|
+
// https://jira-eng-gpk2.cisco.com/jira/browse/WEBEX-326713
|
|
374
|
+
if (!this.checkIsNewRequestsEqualToPrev(streamRequests)) {
|
|
375
|
+
this.sendMediaRequestsCallback(streamRequests);
|
|
376
|
+
this.previousStreamRequests = streamRequests;
|
|
377
|
+
LoggerProxy.logger.info(`multistream:sendRequests --> media requests sent. `);
|
|
378
|
+
} else {
|
|
379
|
+
LoggerProxy.logger.info(
|
|
380
|
+
`multistream:sendRequests --> detected duplicate WCME requests, skipping them... `
|
|
381
|
+
);
|
|
382
|
+
}
|
|
135
383
|
}
|
|
136
384
|
|
|
137
385
|
public addRequest(mediaRequest: MediaRequest, commit = true): MediaRequestId {
|
|
@@ -140,6 +388,17 @@ export class MediaRequestManager {
|
|
|
140
388
|
|
|
141
389
|
this.clientRequests[newId] = mediaRequest;
|
|
142
390
|
|
|
391
|
+
const eventHandler = ({maxFs}) => {
|
|
392
|
+
mediaRequest.preferredMaxFs = maxFs;
|
|
393
|
+
this.debouncedSourceUpdateListener();
|
|
394
|
+
};
|
|
395
|
+
mediaRequest.handleMaxFs = eventHandler;
|
|
396
|
+
|
|
397
|
+
mediaRequest.receiveSlots.forEach((rs) => {
|
|
398
|
+
rs.on(ReceiveSlotEvents.SourceUpdate, this.sourceUpdateListener);
|
|
399
|
+
rs.on(ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);
|
|
400
|
+
});
|
|
401
|
+
|
|
143
402
|
if (commit) {
|
|
144
403
|
this.commit();
|
|
145
404
|
}
|
|
@@ -148,6 +407,13 @@ export class MediaRequestManager {
|
|
|
148
407
|
}
|
|
149
408
|
|
|
150
409
|
public cancelRequest(requestId: MediaRequestId, commit = true) {
|
|
410
|
+
const mediaRequest = this.clientRequests[requestId];
|
|
411
|
+
|
|
412
|
+
mediaRequest?.receiveSlots.forEach((rs) => {
|
|
413
|
+
rs.off(ReceiveSlotEvents.SourceUpdate, this.sourceUpdateListener);
|
|
414
|
+
rs.off(ReceiveSlotEvents.MaxFsUpdate, mediaRequest.handleMaxFs);
|
|
415
|
+
});
|
|
416
|
+
|
|
151
417
|
delete this.clientRequests[requestId];
|
|
152
418
|
|
|
153
419
|
if (commit) {
|
|
@@ -161,6 +427,14 @@ export class MediaRequestManager {
|
|
|
161
427
|
|
|
162
428
|
public reset() {
|
|
163
429
|
this.clientRequests = {};
|
|
164
|
-
this.
|
|
430
|
+
this.numTotalSources = 0;
|
|
431
|
+
this.numLiveSources = 0;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
public setNumCurrentSources(numTotalSources: number, numLiveSources: number) {
|
|
435
|
+
this.numTotalSources = numTotalSources;
|
|
436
|
+
this.numLiveSources = numLiveSources;
|
|
437
|
+
|
|
438
|
+
this.sendRequests();
|
|
165
439
|
}
|
|
166
440
|
}
|