@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.131
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/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/annotation/annotation.types.js +7 -0
- package/dist/annotation/annotation.types.js.map +1 -0
- package/dist/annotation/constants.js +48 -0
- package/dist/annotation/constants.js.map +1 -0
- package/dist/annotation/index.js +355 -0
- package/dist/annotation/index.js.map +1 -0
- package/dist/breakouts/breakout.js +193 -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 +994 -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/browser-detection.js +1 -20
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +5 -20
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +0 -7
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -26
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -26
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -27
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -26
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -33
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -26
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -25
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js +0 -17
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -26
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -26
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +6 -41
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +1 -24
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +0 -22
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +0 -23
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +0 -12
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +0 -15
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +0 -4
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -8
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +35 -61
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +4 -14
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +6 -6
- package/dist/config.js.map +1 -1
- package/dist/constants.js +203 -53
- 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 +294 -0
- package/dist/controls-options-manager/util.js.map +1 -0
- package/dist/index.js +72 -17
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +100 -29
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -26
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +0 -15
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +4 -12
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +406 -216
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +0 -38
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +54 -38
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +88 -123
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +105 -91
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +55 -165
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +71 -117
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +2 -9
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +505 -495
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +77 -14
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2603 -2462
- 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 +292 -138
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +315 -336
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js +7 -0
- package/dist/meeting/request.type.js.map +1 -0
- package/dist/meeting/state.js +21 -31
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +463 -583
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +3 -25
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +10 -33
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +305 -286
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -16
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +98 -183
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +156 -232
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +24 -20
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +692 -593
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +23 -42
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +186 -155
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +89 -88
- 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 +101 -69
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +12 -12
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +166 -205
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +120 -85
- 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 +314 -260
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +50 -16
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js +4 -7
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +93 -162
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +167 -50
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +58 -65
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +74 -93
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +55 -74
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +6 -40
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +466 -442
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +32 -59
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +10 -45
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -33
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +0 -13
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +190 -199
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +14 -23
- 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 -4
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +19 -23
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +326 -465
- 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 +31 -75
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +129 -136
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +143 -103
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +1 -95
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +369 -461
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +144 -94
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +13 -45
- package/dist/transcription/index.js.map +1 -1
- package/dist/types/annotation/annotation.types.d.ts +35 -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 +78 -0
- package/dist/types/constants.d.ts +993 -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/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 +108 -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 +147 -0
- package/dist/types/meeting/index.d.ts +1762 -0
- package/dist/types/meeting/locusMediaRequest.d.ts +70 -0
- package/dist/types/meeting/muteState.d.ts +186 -0
- package/dist/types/meeting/request.d.ts +269 -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 +76 -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 +345 -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 +157 -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 +101 -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 +263 -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/internal-README.md +7 -6
- package/package.json +28 -21
- package/src/annotation/annotation.types.ts +42 -0
- package/src/annotation/constants.ts +36 -0
- package/src/annotation/index.ts +339 -0
- package/src/breakouts/README.md +220 -0
- package/src/breakouts/breakout.ts +163 -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 +860 -0
- package/src/breakouts/request.ts +55 -0
- package/src/breakouts/utils.ts +57 -0
- package/src/common/browser-detection.ts +9 -6
- package/src/common/collection.ts +3 -1
- package/src/common/errors/captcha-error.ts +6 -6
- package/src/common/errors/intent-to-join.ts +6 -6
- package/src/common/errors/join-meeting.ts +12 -8
- package/src/common/errors/media.ts +6 -6
- package/src/common/errors/parameter.ts +9 -6
- package/src/common/errors/password-error.ts +6 -6
- package/src/common/errors/permission.ts +5 -5
- package/src/common/errors/reconnection.ts +6 -6
- package/src/common/errors/stats.ts +6 -6
- package/src/common/errors/webex-errors.ts +7 -5
- package/src/common/errors/webex-meetings-error.ts +1 -1
- package/src/common/events/events-scope.ts +5 -1
- package/src/common/events/events.ts +5 -1
- package/src/common/events/trigger-proxy.ts +8 -3
- package/src/common/events/util.ts +1 -2
- package/src/common/logs/logger-proxy.ts +21 -10
- package/src/common/logs/request.ts +11 -8
- package/src/config.ts +16 -12
- package/src/constants.ts +153 -7
- 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 +281 -0
- package/src/index.ts +33 -0
- package/src/locus-info/controlsUtils.ts +142 -24
- package/src/locus-info/fullState.ts +15 -11
- package/src/locus-info/hostUtils.ts +4 -3
- package/src/locus-info/index.ts +346 -55
- package/src/locus-info/infoUtils.ts +12 -4
- package/src/locus-info/mediaSharesUtils.ts +52 -4
- package/src/locus-info/parser.ts +46 -68
- package/src/locus-info/selfUtils.ts +195 -56
- package/src/media/index.ts +139 -196
- package/src/media/properties.ts +43 -36
- package/src/media/util.ts +1 -1
- package/src/mediaQualityMetrics/config.ts +380 -378
- package/src/meeting/in-meeting-actions.ts +159 -3
- package/src/meeting/index.ts +2803 -1584
- package/src/meeting/locusMediaRequest.ts +309 -0
- package/src/meeting/muteState.ts +290 -72
- package/src/meeting/request.ts +247 -178
- package/src/meeting/request.type.ts +13 -0
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +445 -395
- package/src/meeting-info/collection.ts +2 -1
- package/src/meeting-info/index.ts +32 -30
- package/src/meeting-info/meeting-info-v2.ts +235 -116
- package/src/meeting-info/request.ts +9 -3
- package/src/meeting-info/util.ts +54 -46
- package/src/meeting-info/utilv2.ts +71 -55
- package/src/meetings/collection.ts +21 -1
- package/src/meetings/index.ts +772 -437
- package/src/meetings/request.ts +29 -25
- package/src/meetings/util.ts +132 -33
- package/src/member/index.ts +95 -49
- package/src/member/types.ts +24 -0
- package/src/member/util.ts +106 -13
- package/src/members/collection.ts +8 -1
- package/src/members/index.ts +288 -130
- package/src/members/request.ts +144 -31
- package/src/members/types.ts +28 -0
- package/src/members/util.ts +316 -235
- package/src/metrics/config.ts +302 -90
- package/src/metrics/constants.ts +2 -6
- package/src/metrics/index.ts +124 -95
- package/src/multistream/mediaRequestManager.ts +203 -45
- package/src/multistream/receiveSlot.ts +69 -26
- package/src/multistream/receiveSlotManager.ts +62 -38
- package/src/multistream/remoteMedia.ts +30 -4
- package/src/multistream/remoteMediaGroup.ts +4 -3
- package/src/multistream/remoteMediaManager.ts +230 -66
- package/src/networkQualityMonitor/index.ts +24 -27
- package/src/personal-meeting-room/index.ts +12 -16
- package/src/personal-meeting-room/request.ts +10 -3
- package/src/personal-meeting-room/util.ts +3 -3
- package/src/reachability/index.ts +131 -79
- package/src/reachability/request.ts +43 -34
- package/src/reactions/constants.ts +4 -0
- package/src/reactions/reactions.ts +8 -8
- package/src/reactions/reactions.type.ts +31 -5
- package/src/reconnection-manager/index.ts +193 -111
- 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 +53 -53
- package/src/roap/request.ts +77 -64
- package/src/roap/turnDiscovery.ts +101 -48
- package/src/statsAnalyzer/global.ts +8 -104
- package/src/statsAnalyzer/index.ts +624 -376
- package/src/statsAnalyzer/mqaUtil.ts +203 -90
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/converged-space-meetings.js +177 -0
- package/test/integration/spec/journey.js +670 -466
- package/test/integration/spec/space-meeting.js +320 -204
- package/test/integration/spec/transcription.js +7 -8
- package/test/unit/spec/annotation/index.ts +433 -0
- package/test/unit/spec/breakouts/breakout.ts +203 -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 +1609 -0
- package/test/unit/spec/breakouts/request.ts +104 -0
- package/test/unit/spec/breakouts/utils.js +72 -0
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/controls-options-manager/index.js +287 -0
- package/test/unit/spec/controls-options-manager/util.js +504 -0
- package/test/unit/spec/fixture/locus.js +93 -90
- package/test/unit/spec/locus-info/controlsUtils.js +305 -32
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +636 -5
- package/test/unit/spec/locus-info/infoUtils.js +26 -33
- package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
- package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +22 -0
- package/test/unit/spec/locus-info/parser.js +3 -9
- package/test/unit/spec/locus-info/selfConstant.js +110 -103
- package/test/unit/spec/locus-info/selfUtils.js +252 -12
- package/test/unit/spec/media/index.ts +104 -8
- package/test/unit/spec/media/properties.ts +9 -9
- package/test/unit/spec/meeting/in-meeting-actions.ts +76 -3
- package/test/unit/spec/meeting/index.js +3112 -921
- package/test/unit/spec/meeting/locusMediaRequest.ts +436 -0
- package/test/unit/spec/meeting/muteState.js +421 -94
- package/test/unit/spec/meeting/request.js +421 -79
- package/test/unit/spec/meeting/utils.js +326 -189
- package/test/unit/spec/meeting-info/meetinginfov2.js +481 -76
- package/test/unit/spec/meeting-info/request.js +7 -9
- package/test/unit/spec/meeting-info/util.js +11 -12
- package/test/unit/spec/meeting-info/utilv2.js +131 -74
- package/test/unit/spec/meetings/collection.js +15 -1
- package/test/unit/spec/meetings/index.js +1126 -328
- package/test/unit/spec/meetings/utils.js +220 -14
- package/test/unit/spec/member/index.js +24 -1
- package/test/unit/spec/member/util.js +383 -32
- package/test/unit/spec/members/index.js +424 -55
- package/test/unit/spec/members/request.js +228 -40
- package/test/unit/spec/members/utils.js +191 -4
- package/test/unit/spec/metrics/index.js +113 -20
- package/test/unit/spec/multistream/mediaRequestManager.ts +650 -105
- package/test/unit/spec/multistream/receiveSlot.ts +76 -17
- 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 +5 -5
- package/test/unit/spec/multistream/remoteMediaManager.ts +549 -65
- package/test/unit/spec/networkQualityMonitor/index.js +24 -18
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +176 -27
- package/test/unit/spec/reachability/request.js +66 -0
- package/test/unit/spec/reconnection-manager/index.js +62 -31
- 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 +19 -49
- package/test/unit/spec/roap/request.ts +187 -0
- package/test/unit/spec/roap/turnDiscovery.ts +92 -50
- package/test/unit/spec/stats-analyzer/index.js +116 -60
- package/test/utils/cmr.js +44 -42
- package/test/utils/constants.js +9 -0
- package/test/utils/integrationTestUtils.js +64 -0
- package/test/utils/testUtils.js +63 -99
- package/test/utils/webex-config.js +22 -18
- package/test/utils/webex-test-users.js +57 -50
- package/tsconfig.json +6 -0
- package/dist/media/internal-media-core-wrapper.js +0 -22
- package/dist/media/internal-media-core-wrapper.js.map +0 -1
- package/dist/meeting/effectsState.js +0 -334
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/multistream/multistreamMedia.js +0 -116
- 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 -92
- package/test/unit/spec/meeting/effectsState.js +0 -291
|
@@ -1,95 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
-
|
|
5
4
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
6
|
-
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
8
|
-
|
|
9
6
|
_Object$defineProperty(exports, "__esModule", {
|
|
10
7
|
value: true
|
|
11
8
|
});
|
|
12
|
-
|
|
13
9
|
exports.RemoteMediaManager = exports.Event = exports.DefaultConfiguration = void 0;
|
|
14
|
-
|
|
15
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
16
|
-
|
|
17
11
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
18
|
-
|
|
19
12
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
20
|
-
|
|
21
13
|
var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));
|
|
22
|
-
|
|
23
14
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
24
|
-
|
|
25
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
26
|
-
|
|
27
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
|
|
28
|
-
|
|
29
17
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
30
|
-
|
|
31
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
32
|
-
|
|
33
19
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
34
|
-
|
|
35
20
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
|
|
36
|
-
|
|
37
21
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
38
|
-
|
|
39
22
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
40
|
-
|
|
41
23
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
42
|
-
|
|
43
24
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
44
|
-
|
|
45
25
|
var _remove2 = _interopRequireDefault(require("lodash/remove"));
|
|
46
|
-
|
|
26
|
+
var _forEach2 = _interopRequireDefault(require("lodash/forEach"));
|
|
47
27
|
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
48
|
-
|
|
49
28
|
var _internalMediaCore = require("@webex/internal-media-core");
|
|
50
|
-
|
|
51
29
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
52
|
-
|
|
53
30
|
var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
|
|
54
|
-
|
|
55
31
|
var _remoteMedia = require("./remoteMedia");
|
|
56
|
-
|
|
57
32
|
var _remoteMediaGroup = require("./remoteMediaGroup");
|
|
58
|
-
|
|
59
33
|
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); }; }
|
|
60
|
-
|
|
61
34
|
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; } }
|
|
62
|
-
|
|
63
35
|
/* Predefined layouts: */
|
|
36
|
+
|
|
64
37
|
// An "all equal" grid, with size up to 3 x 3 = 9:
|
|
65
38
|
var AllEqualLayout = {
|
|
66
|
-
screenShareVideo: {
|
|
67
|
-
size: null
|
|
68
|
-
},
|
|
69
39
|
activeSpeakerVideoPaneGroups: [{
|
|
70
40
|
id: 'main',
|
|
71
41
|
numPanes: 9,
|
|
72
42
|
size: 'best',
|
|
73
43
|
priority: 255
|
|
74
44
|
}]
|
|
75
|
-
};
|
|
45
|
+
};
|
|
76
46
|
|
|
47
|
+
// A layout with just a single remote active speaker video pane:
|
|
77
48
|
var SingleLayout = {
|
|
78
|
-
screenShareVideo: {
|
|
79
|
-
size: null
|
|
80
|
-
},
|
|
81
49
|
activeSpeakerVideoPaneGroups: [{
|
|
82
50
|
id: 'main',
|
|
83
51
|
numPanes: 1,
|
|
84
52
|
size: 'best',
|
|
85
53
|
priority: 255
|
|
86
54
|
}]
|
|
87
|
-
};
|
|
55
|
+
};
|
|
88
56
|
|
|
57
|
+
// A layout with 1 big pane for the highest priority active speaker and 5 small panes for other active speakers:
|
|
89
58
|
var OnePlusFiveLayout = {
|
|
90
|
-
screenShareVideo: {
|
|
91
|
-
size: null
|
|
92
|
-
},
|
|
93
59
|
activeSpeakerVideoPaneGroups: [{
|
|
94
60
|
id: 'mainBigOne',
|
|
95
61
|
numPanes: 1,
|
|
@@ -101,12 +67,10 @@ var OnePlusFiveLayout = {
|
|
|
101
67
|
size: 'very small',
|
|
102
68
|
priority: 254
|
|
103
69
|
}]
|
|
104
|
-
};
|
|
70
|
+
};
|
|
105
71
|
|
|
72
|
+
// A layout with 2 big panes for 2 main active speakers and a strip of 6 small panes for other active speakers:
|
|
106
73
|
var TwoMainPlusSixSmallLayout = {
|
|
107
|
-
screenShareVideo: {
|
|
108
|
-
size: null
|
|
109
|
-
},
|
|
110
74
|
activeSpeakerVideoPaneGroups: [{
|
|
111
75
|
id: 'mainGroupWith2BigPanes',
|
|
112
76
|
numPanes: 2,
|
|
@@ -118,8 +82,9 @@ var TwoMainPlusSixSmallLayout = {
|
|
|
118
82
|
size: 'small',
|
|
119
83
|
priority: 254
|
|
120
84
|
}]
|
|
121
|
-
};
|
|
85
|
+
};
|
|
122
86
|
|
|
87
|
+
// A strip of 8 small video panes (thumbnails) displayed at the top of a remote screenshare:
|
|
123
88
|
var RemoteScreenShareWithSmallThumbnailsLayout = {
|
|
124
89
|
screenShareVideo: {
|
|
125
90
|
size: 'best'
|
|
@@ -130,12 +95,10 @@ var RemoteScreenShareWithSmallThumbnailsLayout = {
|
|
|
130
95
|
size: 'thumbnail',
|
|
131
96
|
priority: 255
|
|
132
97
|
}]
|
|
133
|
-
};
|
|
98
|
+
};
|
|
134
99
|
|
|
100
|
+
// A staged layout with 4 pre-selected meeting participants in the main 2x2 grid and 6 small panes for other active speakers at the top:
|
|
135
101
|
var Stage2x2With6ThumbnailsLayout = {
|
|
136
|
-
screenShareVideo: {
|
|
137
|
-
size: null
|
|
138
|
-
},
|
|
139
102
|
activeSpeakerVideoPaneGroups: [{
|
|
140
103
|
id: 'thumbnails',
|
|
141
104
|
numPanes: 6,
|
|
@@ -160,16 +123,17 @@ var Stage2x2With6ThumbnailsLayout = {
|
|
|
160
123
|
csi: undefined
|
|
161
124
|
}]
|
|
162
125
|
};
|
|
126
|
+
|
|
163
127
|
/**
|
|
164
128
|
* Default configuration:
|
|
165
129
|
* - uses 3 audio streams
|
|
166
130
|
* - prefers active speakers with live video (e.g. are not audio only or video muted) over active speakers without live video
|
|
167
131
|
* - has a few layouts defined, including 1 that contains remote screen share (ScreenShareView)
|
|
168
132
|
*/
|
|
169
|
-
|
|
170
133
|
var DefaultConfiguration = {
|
|
171
134
|
audio: {
|
|
172
|
-
numOfActiveSpeakerStreams: 3
|
|
135
|
+
numOfActiveSpeakerStreams: 3,
|
|
136
|
+
numOfScreenShareStreams: 1
|
|
173
137
|
},
|
|
174
138
|
video: {
|
|
175
139
|
preferLiveVideo: true,
|
|
@@ -181,22 +145,16 @@ var DefaultConfiguration = {
|
|
|
181
145
|
Stage: Stage2x2With6ThumbnailsLayout,
|
|
182
146
|
ScreenShareView: RemoteScreenShareWithSmallThumbnailsLayout
|
|
183
147
|
}
|
|
184
|
-
},
|
|
185
|
-
screenShare: {
|
|
186
|
-
audio: true,
|
|
187
|
-
video: true
|
|
188
148
|
}
|
|
189
149
|
};
|
|
190
150
|
exports.DefaultConfiguration = DefaultConfiguration;
|
|
191
151
|
var Event;
|
|
192
152
|
exports.Event = Event;
|
|
193
|
-
|
|
194
153
|
(function (Event) {
|
|
195
154
|
Event["AudioCreated"] = "AudioCreated";
|
|
196
|
-
Event["ScreenShareAudioCreated"] = "
|
|
155
|
+
Event["ScreenShareAudioCreated"] = "ScreenShareAudioCreated";
|
|
197
156
|
Event["VideoLayoutChanged"] = "VideoLayoutChanged";
|
|
198
157
|
})(Event || (exports.Event = Event = {}));
|
|
199
|
-
|
|
200
158
|
/**
|
|
201
159
|
* A helper class that manages all remote audio/video streams in order to achieve a predefined set of layouts.
|
|
202
160
|
* It also creates a fixed number of audio streams and these don't change during the meeting.
|
|
@@ -207,9 +165,7 @@ exports.Event = Event;
|
|
|
207
165
|
*/
|
|
208
166
|
var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
209
167
|
(0, _inherits2.default)(RemoteMediaManager, _EventsScope);
|
|
210
|
-
|
|
211
168
|
var _super = _createSuper(RemoteMediaManager);
|
|
212
|
-
|
|
213
169
|
/**
|
|
214
170
|
* Constructor
|
|
215
171
|
*
|
|
@@ -219,7 +175,6 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
219
175
|
*/
|
|
220
176
|
function RemoteMediaManager(receiveSlotManager, mediaRequestManagers) {
|
|
221
177
|
var _this;
|
|
222
|
-
|
|
223
178
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DefaultConfiguration;
|
|
224
179
|
(0, _classCallCheck2.default)(this, RemoteMediaManager);
|
|
225
180
|
_this = _super.call(this);
|
|
@@ -241,15 +196,19 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
241
196
|
video: {
|
|
242
197
|
activeSpeakerGroups: {},
|
|
243
198
|
memberPanes: {}
|
|
199
|
+
},
|
|
200
|
+
screenShare: {
|
|
201
|
+
audio: undefined,
|
|
202
|
+
video: undefined
|
|
244
203
|
}
|
|
245
204
|
};
|
|
246
|
-
|
|
247
205
|
_this.checkConfigValidity();
|
|
248
|
-
|
|
249
206
|
_this.slots = {
|
|
250
207
|
audio: [],
|
|
251
|
-
|
|
252
|
-
|
|
208
|
+
screenShare: {
|
|
209
|
+
audio: [],
|
|
210
|
+
video: undefined
|
|
211
|
+
},
|
|
253
212
|
video: {
|
|
254
213
|
unused: [],
|
|
255
214
|
activeSpeaker: [],
|
|
@@ -260,27 +219,23 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
260
219
|
activeSpeaker: {},
|
|
261
220
|
receiverSelected: {}
|
|
262
221
|
};
|
|
263
|
-
|
|
264
222
|
_loggerProxy.default.logger.log("RemoteMediaManager#constructor --> RemoteMediaManager created with config: ".concat((0, _stringify.default)(_this.config)));
|
|
265
|
-
|
|
266
223
|
return _this;
|
|
267
224
|
}
|
|
225
|
+
|
|
268
226
|
/**
|
|
269
227
|
* Checks if configuration is valid, throws an error if it's not
|
|
270
228
|
*/
|
|
271
|
-
|
|
272
|
-
|
|
273
229
|
(0, _createClass2.default)(RemoteMediaManager, [{
|
|
274
230
|
key: "checkConfigValidity",
|
|
275
231
|
value: function checkConfigValidity() {
|
|
276
232
|
if (!(this.config.video.initialLayoutId in this.config.video.layouts)) {
|
|
277
233
|
throw new Error("invalid config: initialLayoutId \"".concat(this.config.video.initialLayoutId, "\" doesn't match any of the layouts"));
|
|
278
|
-
}
|
|
279
|
-
|
|
234
|
+
}
|
|
280
235
|
|
|
236
|
+
// check if each layout is valid
|
|
281
237
|
(0, _values.default)(this.config.video.layouts).forEach(function (layout) {
|
|
282
238
|
var _layout$activeSpeaker, _layout$memberVideoPa;
|
|
283
|
-
|
|
284
239
|
var groupIds = {};
|
|
285
240
|
var paneIds = {};
|
|
286
241
|
var groupPriorites = {};
|
|
@@ -288,186 +243,172 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
288
243
|
if (groupIds[group.id]) {
|
|
289
244
|
throw new Error("invalid config: duplicate active speaker video pane group id: ".concat(group.id));
|
|
290
245
|
}
|
|
291
|
-
|
|
292
246
|
groupIds[group.id] = true;
|
|
293
|
-
|
|
294
247
|
if (groupPriorites[group.priority]) {
|
|
295
248
|
throw new Error("invalid config: multiple active speaker video pane groups have same priority: ".concat(group.priority));
|
|
296
249
|
}
|
|
297
|
-
|
|
298
250
|
groupPriorites[group.priority] = true;
|
|
299
251
|
});
|
|
300
252
|
(_layout$memberVideoPa = layout.memberVideoPanes) === null || _layout$memberVideoPa === void 0 ? void 0 : _layout$memberVideoPa.forEach(function (pane) {
|
|
301
253
|
if (paneIds[pane.id]) {
|
|
302
254
|
throw new Error("invalid config: duplicate member video pane id: ".concat(pane.id));
|
|
303
255
|
}
|
|
304
|
-
|
|
305
256
|
paneIds[pane.id] = true;
|
|
306
257
|
});
|
|
307
258
|
});
|
|
308
259
|
}
|
|
260
|
+
|
|
309
261
|
/**
|
|
310
262
|
* Starts the RemoteMediaManager.
|
|
311
263
|
*
|
|
312
264
|
* @returns {Promise}
|
|
313
265
|
*/
|
|
314
|
-
|
|
315
266
|
}, {
|
|
316
267
|
key: "start",
|
|
317
268
|
value: function () {
|
|
318
269
|
var _start = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
319
270
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
320
|
-
while (1) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
case "end":
|
|
345
|
-
return _context.stop();
|
|
346
|
-
}
|
|
271
|
+
while (1) switch (_context.prev = _context.next) {
|
|
272
|
+
case 0:
|
|
273
|
+
if (!this.started) {
|
|
274
|
+
_context.next = 2;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
throw new Error('start() failure: already started');
|
|
278
|
+
case 2:
|
|
279
|
+
this.started = true;
|
|
280
|
+
_context.next = 5;
|
|
281
|
+
return this.createAudioMedia();
|
|
282
|
+
case 5:
|
|
283
|
+
_context.next = 7;
|
|
284
|
+
return this.createScreenShareReceiveSlots();
|
|
285
|
+
case 7:
|
|
286
|
+
this.createScreenShareAudioMedia();
|
|
287
|
+
_context.next = 10;
|
|
288
|
+
return this.preallocateVideoReceiveSlots();
|
|
289
|
+
case 10:
|
|
290
|
+
_context.next = 12;
|
|
291
|
+
return this.setLayout(this.config.video.initialLayoutId);
|
|
292
|
+
case 12:
|
|
293
|
+
case "end":
|
|
294
|
+
return _context.stop();
|
|
347
295
|
}
|
|
348
296
|
}, _callee, this);
|
|
349
297
|
}));
|
|
350
|
-
|
|
351
298
|
function start() {
|
|
352
299
|
return _start.apply(this, arguments);
|
|
353
300
|
}
|
|
354
|
-
|
|
355
301
|
return start;
|
|
356
302
|
}()
|
|
357
303
|
/**
|
|
358
304
|
* Releases all the used resources (like allocated receive slots). This function needs
|
|
359
305
|
* to be called when we leave the meeting, etc.
|
|
360
306
|
*/
|
|
361
|
-
|
|
362
307
|
}, {
|
|
363
308
|
key: "stop",
|
|
364
309
|
value: function stop() {
|
|
365
310
|
var _this2 = this,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
311
|
+
_this$slots$video$unu,
|
|
312
|
+
_this$slots$video$unu2;
|
|
369
313
|
// invalidate all remoteMedia objects
|
|
370
314
|
this.invalidateCurrentRemoteMedia({
|
|
371
315
|
audio: true,
|
|
372
316
|
video: true,
|
|
317
|
+
screenShareAudio: true,
|
|
318
|
+
screenShareVideo: true,
|
|
373
319
|
commit: true
|
|
374
|
-
});
|
|
320
|
+
});
|
|
375
321
|
|
|
322
|
+
// release all audio receive slots
|
|
376
323
|
this.slots.audio.forEach(function (slot) {
|
|
377
324
|
return _this2.receiveSlotManager.releaseSlot(slot);
|
|
378
325
|
});
|
|
379
|
-
this.slots.audio.length = 0;
|
|
326
|
+
this.slots.audio.length = 0;
|
|
327
|
+
|
|
328
|
+
// release screen share slots
|
|
329
|
+
this.slots.screenShare.audio.forEach(function (slot) {
|
|
330
|
+
return _this2.receiveSlotManager.releaseSlot(slot);
|
|
331
|
+
});
|
|
332
|
+
this.slots.screenShare.audio.length = 0;
|
|
333
|
+
if (this.slots.screenShare.video) {
|
|
334
|
+
this.receiveSlotManager.releaseSlot(this.slots.screenShare.video);
|
|
335
|
+
this.slots.screenShare.video = undefined;
|
|
336
|
+
}
|
|
380
337
|
|
|
338
|
+
// release video slots
|
|
381
339
|
this.receiveSlotAllocations = {
|
|
382
340
|
activeSpeaker: {},
|
|
383
341
|
receiverSelected: {}
|
|
384
342
|
};
|
|
385
|
-
|
|
386
343
|
(_this$slots$video$unu = this.slots.video.unused).push.apply(_this$slots$video$unu, (0, _toConsumableArray2.default)(this.slots.video.activeSpeaker));
|
|
387
|
-
|
|
388
344
|
this.slots.video.activeSpeaker.length = 0;
|
|
389
|
-
|
|
390
345
|
(_this$slots$video$unu2 = this.slots.video.unused).push.apply(_this$slots$video$unu2, (0, _toConsumableArray2.default)(this.slots.video.receiverSelected));
|
|
391
|
-
|
|
392
346
|
this.slots.video.receiverSelected.length = 0;
|
|
393
347
|
this.releaseUnusedVideoSlots();
|
|
394
348
|
this.currentLayout = undefined;
|
|
395
349
|
this.currentLayoutId = undefined;
|
|
396
350
|
this.started = false;
|
|
397
351
|
}
|
|
352
|
+
|
|
398
353
|
/**
|
|
399
354
|
* Returns the total number of main video panes required for a given layout
|
|
400
355
|
*
|
|
401
356
|
* @param {VideoLayout} layout
|
|
402
357
|
* @returns {number}
|
|
403
358
|
*/
|
|
404
|
-
|
|
405
359
|
}, {
|
|
406
360
|
key: "getRequiredNumVideoSlotsForLayout",
|
|
407
361
|
value: function getRequiredNumVideoSlotsForLayout(layout) {
|
|
408
362
|
var _layout$activeSpeaker2, _layout$memberVideoPa2;
|
|
409
|
-
|
|
410
363
|
if (!layout) {
|
|
411
364
|
return 0;
|
|
412
365
|
}
|
|
413
|
-
|
|
414
366
|
var activeSpeakerCount = ((_layout$activeSpeaker2 = layout.activeSpeakerVideoPaneGroups) === null || _layout$activeSpeaker2 === void 0 ? void 0 : _layout$activeSpeaker2.reduce(function (sum, paneGroup) {
|
|
415
367
|
return sum + paneGroup.numPanes;
|
|
416
368
|
}, 0)) || 0;
|
|
417
369
|
var receiverSelectedCount = ((_layout$memberVideoPa2 = layout.memberVideoPanes) === null || _layout$memberVideoPa2 === void 0 ? void 0 : _layout$memberVideoPa2.length) || 0;
|
|
418
370
|
return activeSpeakerCount + receiverSelectedCount;
|
|
419
371
|
}
|
|
372
|
+
|
|
420
373
|
/**
|
|
421
374
|
* Allocates the maximum number of panes that any of the configured layouts will require.
|
|
422
375
|
* We do this at the beginning, because it's more efficient (much faster) then allocating receive slots
|
|
423
376
|
* later, after the SDP exchange was done.
|
|
424
377
|
*/
|
|
425
|
-
|
|
426
378
|
}, {
|
|
427
379
|
key: "preallocateVideoReceiveSlots",
|
|
428
380
|
value: function () {
|
|
429
381
|
var _preallocateVideoReceiveSlots = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
430
382
|
var _this3 = this;
|
|
431
|
-
|
|
432
383
|
var maxNumVideoPanesRequired;
|
|
433
384
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
434
|
-
while (1) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if (!(this.slots.video.unused.length < maxNumVideoPanesRequired)) {
|
|
443
|
-
_context2.next = 9;
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
_context2.t0 = this.slots.video.unused;
|
|
448
|
-
_context2.next = 5;
|
|
449
|
-
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaConnection.MediaType.VideoMain);
|
|
450
|
-
|
|
451
|
-
case 5:
|
|
452
|
-
_context2.t1 = _context2.sent;
|
|
453
|
-
|
|
454
|
-
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
455
|
-
|
|
456
|
-
_context2.next = 1;
|
|
385
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
386
|
+
case 0:
|
|
387
|
+
maxNumVideoPanesRequired = (0, _values.default)(this.config.video.layouts).reduce(function (maxValue, layout) {
|
|
388
|
+
return Math.max(maxValue, _this3.getRequiredNumVideoSlotsForLayout(layout));
|
|
389
|
+
}, 0);
|
|
390
|
+
case 1:
|
|
391
|
+
if (!(this.slots.video.unused.length < maxNumVideoPanesRequired)) {
|
|
392
|
+
_context2.next = 9;
|
|
457
393
|
break;
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
394
|
+
}
|
|
395
|
+
_context2.t0 = this.slots.video.unused;
|
|
396
|
+
_context2.next = 5;
|
|
397
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.VideoMain);
|
|
398
|
+
case 5:
|
|
399
|
+
_context2.t1 = _context2.sent;
|
|
400
|
+
_context2.t0.push.call(_context2.t0, _context2.t1);
|
|
401
|
+
_context2.next = 1;
|
|
402
|
+
break;
|
|
403
|
+
case 9:
|
|
404
|
+
case "end":
|
|
405
|
+
return _context2.stop();
|
|
463
406
|
}
|
|
464
407
|
}, _callee2, this);
|
|
465
408
|
}));
|
|
466
|
-
|
|
467
409
|
function preallocateVideoReceiveSlots() {
|
|
468
410
|
return _preallocateVideoReceiveSlots.apply(this, arguments);
|
|
469
411
|
}
|
|
470
|
-
|
|
471
412
|
return preallocateVideoReceiveSlots;
|
|
472
413
|
}()
|
|
473
414
|
/**
|
|
@@ -476,52 +417,42 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
476
417
|
* @param {LayoutId} layoutId new layout id
|
|
477
418
|
* @returns {Promise}
|
|
478
419
|
*/
|
|
479
|
-
|
|
480
420
|
}, {
|
|
481
421
|
key: "setLayout",
|
|
482
422
|
value: function () {
|
|
483
423
|
var _setLayout = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(layoutId) {
|
|
484
424
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
485
|
-
while (1) {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
this.updateVideoRemoteMediaObjects();
|
|
511
|
-
this.emitVideoLayoutChangedEvent();
|
|
512
|
-
|
|
513
|
-
case 10:
|
|
514
|
-
case "end":
|
|
515
|
-
return _context3.stop();
|
|
516
|
-
}
|
|
425
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
426
|
+
case 0:
|
|
427
|
+
if (layoutId in this.config.video.layouts) {
|
|
428
|
+
_context3.next = 2;
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
throw new Error("invalid layoutId: \"".concat(layoutId, "\" doesn't match any of the configured layouts"));
|
|
432
|
+
case 2:
|
|
433
|
+
if (this.started) {
|
|
434
|
+
_context3.next = 4;
|
|
435
|
+
break;
|
|
436
|
+
}
|
|
437
|
+
throw new Error('setLayout() called before start()');
|
|
438
|
+
case 4:
|
|
439
|
+
this.currentLayoutId = layoutId;
|
|
440
|
+
this.currentLayout = (0, _cloneDeep2.default)(this.config.video.layouts[this.currentLayoutId]);
|
|
441
|
+
_context3.next = 8;
|
|
442
|
+
return this.updateVideoReceiveSlots();
|
|
443
|
+
case 8:
|
|
444
|
+
this.updateVideoRemoteMediaObjects();
|
|
445
|
+
this.updateScreenShareVideoRemoteMediaObject();
|
|
446
|
+
this.emitVideoLayoutChangedEvent();
|
|
447
|
+
case 11:
|
|
448
|
+
case "end":
|
|
449
|
+
return _context3.stop();
|
|
517
450
|
}
|
|
518
451
|
}, _callee3, this);
|
|
519
452
|
}));
|
|
520
|
-
|
|
521
453
|
function setLayout(_x) {
|
|
522
454
|
return _setLayout.apply(this, arguments);
|
|
523
455
|
}
|
|
524
|
-
|
|
525
456
|
return setLayout;
|
|
526
457
|
}()
|
|
527
458
|
/**
|
|
@@ -529,344 +460,463 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
529
460
|
*
|
|
530
461
|
* @returns {LayoutId}
|
|
531
462
|
*/
|
|
532
|
-
|
|
533
463
|
}, {
|
|
534
464
|
key: "getLayoutId",
|
|
535
465
|
value: function getLayoutId() {
|
|
536
466
|
return this.currentLayoutId;
|
|
537
467
|
}
|
|
468
|
+
|
|
538
469
|
/**
|
|
539
470
|
* Creates the audio slots
|
|
540
471
|
*/
|
|
541
|
-
|
|
542
472
|
}, {
|
|
543
473
|
key: "createAudioMedia",
|
|
544
474
|
value: function () {
|
|
545
475
|
var _createAudioMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
546
476
|
var i, slot;
|
|
547
477
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
548
|
-
while (1) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
if (!(i < this.config.audio.numOfActiveSpeakerStreams)) {
|
|
555
|
-
_context4.next = 9;
|
|
556
|
-
break;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
_context4.next = 4;
|
|
560
|
-
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaConnection.MediaType.AudioMain);
|
|
561
|
-
|
|
562
|
-
case 4:
|
|
563
|
-
slot = _context4.sent;
|
|
564
|
-
this.slots.audio.push(slot);
|
|
565
|
-
|
|
566
|
-
case 6:
|
|
567
|
-
i += 1;
|
|
568
|
-
_context4.next = 1;
|
|
478
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
479
|
+
case 0:
|
|
480
|
+
i = 0;
|
|
481
|
+
case 1:
|
|
482
|
+
if (!(i < this.config.audio.numOfActiveSpeakerStreams)) {
|
|
483
|
+
_context4.next = 9;
|
|
569
484
|
break;
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
485
|
+
}
|
|
486
|
+
_context4.next = 4;
|
|
487
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.AudioMain);
|
|
488
|
+
case 4:
|
|
489
|
+
slot = _context4.sent;
|
|
490
|
+
this.slots.audio.push(slot);
|
|
491
|
+
case 6:
|
|
492
|
+
i += 1;
|
|
493
|
+
_context4.next = 1;
|
|
494
|
+
break;
|
|
495
|
+
case 9:
|
|
496
|
+
// create a remote media group
|
|
497
|
+
this.media.audio = new _remoteMediaGroup.RemoteMediaGroup(this.mediaRequestManagers.audio, this.slots.audio, 255, true);
|
|
498
|
+
this.emit({
|
|
499
|
+
file: 'multistream/remoteMediaManager',
|
|
500
|
+
function: 'createAudioMedia'
|
|
501
|
+
}, Event.AudioCreated, this.media.audio);
|
|
502
|
+
case 11:
|
|
503
|
+
case "end":
|
|
504
|
+
return _context4.stop();
|
|
583
505
|
}
|
|
584
506
|
}, _callee4, this);
|
|
585
507
|
}));
|
|
586
|
-
|
|
587
508
|
function createAudioMedia() {
|
|
588
509
|
return _createAudioMedia.apply(this, arguments);
|
|
589
510
|
}
|
|
590
|
-
|
|
591
511
|
return createAudioMedia;
|
|
592
512
|
}()
|
|
513
|
+
/**
|
|
514
|
+
* Creates receive slots required for receiving screen share audio and video
|
|
515
|
+
*/
|
|
516
|
+
}, {
|
|
517
|
+
key: "createScreenShareReceiveSlots",
|
|
518
|
+
value: function () {
|
|
519
|
+
var _createScreenShareReceiveSlots = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
520
|
+
var i, slot, isAnyLayoutContainingScreenShareVideo;
|
|
521
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
522
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
523
|
+
case 0:
|
|
524
|
+
i = 0;
|
|
525
|
+
case 1:
|
|
526
|
+
if (!(i < this.config.audio.numOfScreenShareStreams)) {
|
|
527
|
+
_context5.next = 9;
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
_context5.next = 4;
|
|
531
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.AudioSlides);
|
|
532
|
+
case 4:
|
|
533
|
+
slot = _context5.sent;
|
|
534
|
+
this.slots.screenShare.audio.push(slot);
|
|
535
|
+
case 6:
|
|
536
|
+
i += 1;
|
|
537
|
+
_context5.next = 1;
|
|
538
|
+
break;
|
|
539
|
+
case 9:
|
|
540
|
+
// video
|
|
541
|
+
isAnyLayoutContainingScreenShareVideo = (0, _values.default)(this.config.video.layouts).some(function (layout) {
|
|
542
|
+
return !!layout.screenShareVideo;
|
|
543
|
+
});
|
|
544
|
+
if (!isAnyLayoutContainingScreenShareVideo) {
|
|
545
|
+
_context5.next = 14;
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
_context5.next = 13;
|
|
549
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.VideoSlides);
|
|
550
|
+
case 13:
|
|
551
|
+
this.slots.screenShare.video = _context5.sent;
|
|
552
|
+
case 14:
|
|
553
|
+
case "end":
|
|
554
|
+
return _context5.stop();
|
|
555
|
+
}
|
|
556
|
+
}, _callee5, this);
|
|
557
|
+
}));
|
|
558
|
+
function createScreenShareReceiveSlots() {
|
|
559
|
+
return _createScreenShareReceiveSlots.apply(this, arguments);
|
|
560
|
+
}
|
|
561
|
+
return createScreenShareReceiveSlots;
|
|
562
|
+
}()
|
|
563
|
+
/**
|
|
564
|
+
* Creates RemoteMedia objects for screen share
|
|
565
|
+
*/
|
|
566
|
+
}, {
|
|
567
|
+
key: "createScreenShareAudioMedia",
|
|
568
|
+
value: function createScreenShareAudioMedia() {
|
|
569
|
+
if (this.slots.screenShare.audio.length > 0) {
|
|
570
|
+
this.media.screenShare.audio = new _remoteMediaGroup.RemoteMediaGroup(this.mediaRequestManagers.screenShareAudio, this.slots.screenShare.audio, 255, true);
|
|
571
|
+
this.emit({
|
|
572
|
+
file: 'multistream/remoteMediaManager',
|
|
573
|
+
function: 'createScreenShareAudioMedia'
|
|
574
|
+
}, Event.ScreenShareAudioCreated, this.media.screenShare.audio);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
593
578
|
/**
|
|
594
579
|
* Goes over all receiver-selected slots and keeps only the ones that are required by a given layout,
|
|
595
580
|
* the rest are all moved to the "unused" list
|
|
596
581
|
*/
|
|
597
|
-
|
|
598
582
|
}, {
|
|
599
583
|
key: "trimReceiverSelectedSlots",
|
|
600
584
|
value: function trimReceiverSelectedSlots() {
|
|
601
585
|
var _this$currentLayout, _this$currentLayout$m, _this$slots$video$unu3;
|
|
586
|
+
var requiredCsis = {};
|
|
602
587
|
|
|
603
|
-
|
|
604
|
-
|
|
588
|
+
// fill requiredCsis with all the CSIs that the given layout requires
|
|
605
589
|
(_this$currentLayout = this.currentLayout) === null || _this$currentLayout === void 0 ? void 0 : (_this$currentLayout$m = _this$currentLayout.memberVideoPanes) === null || _this$currentLayout$m === void 0 ? void 0 : _this$currentLayout$m.forEach(function (memberVideoPane) {
|
|
606
590
|
if (memberVideoPane.csi !== undefined) {
|
|
607
591
|
requiredCsis[memberVideoPane.csi] = true;
|
|
608
592
|
}
|
|
609
593
|
});
|
|
610
|
-
|
|
611
594
|
var isCsiNeededByCurrentLayout = function isCsiNeededByCurrentLayout(csi) {
|
|
612
595
|
if (csi === undefined) {
|
|
613
596
|
return false;
|
|
614
597
|
}
|
|
615
|
-
|
|
616
598
|
return !!requiredCsis[csi];
|
|
617
|
-
};
|
|
618
|
-
|
|
599
|
+
};
|
|
619
600
|
|
|
601
|
+
// keep receiverSelected slots that match our new requiredCsis, move the rest of receiverSelected slots to unused
|
|
620
602
|
var notNeededReceiverSelectedSlots = (0, _remove2.default)(this.slots.video.receiverSelected, function (slot) {
|
|
621
603
|
return isCsiNeededByCurrentLayout(slot.csi) === false;
|
|
622
604
|
});
|
|
623
|
-
|
|
624
605
|
(_this$slots$video$unu3 = this.slots.video.unused).push.apply(_this$slots$video$unu3, (0, _toConsumableArray2.default)(notNeededReceiverSelectedSlots));
|
|
625
606
|
}
|
|
607
|
+
|
|
626
608
|
/**
|
|
627
609
|
* Releases all the "unused" video slots.
|
|
628
610
|
*/
|
|
629
|
-
|
|
630
611
|
}, {
|
|
631
612
|
key: "releaseUnusedVideoSlots",
|
|
632
613
|
value: function releaseUnusedVideoSlots() {
|
|
633
614
|
var _this4 = this;
|
|
634
|
-
|
|
635
615
|
this.slots.video.unused.forEach(function (slot) {
|
|
636
616
|
return _this4.receiveSlotManager.releaseSlot(slot);
|
|
637
617
|
});
|
|
638
618
|
this.slots.video.unused.length = 0;
|
|
639
619
|
}
|
|
620
|
+
|
|
640
621
|
/**
|
|
641
|
-
* Allocates receive slots to all video panes
|
|
622
|
+
* Allocates receive slots to all active speaker video panes
|
|
623
|
+
* in the current selected layout.
|
|
624
|
+
*
|
|
625
|
+
* Allocation tries to keep the same order of the slots between the previous
|
|
626
|
+
* layout and the new one. Sorting helps making sure that highest priority slots
|
|
627
|
+
* go in the same order in the new layout.
|
|
642
628
|
*/
|
|
643
|
-
|
|
644
629
|
}, {
|
|
645
|
-
key: "
|
|
646
|
-
value: function
|
|
630
|
+
key: "allocateSlotsToActiveSpeakerPaneGroups",
|
|
631
|
+
value: function allocateSlotsToActiveSpeakerPaneGroups() {
|
|
647
632
|
var _this$currentLayout2,
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
};
|
|
657
|
-
(_this$currentLayout2 = this.currentLayout) === null || _this$currentLayout2 === void 0 ? void 0 : (_this$currentLayout2$ = _this$currentLayout2.activeSpeakerVideoPaneGroups) === null || _this$currentLayout2$ === void 0 ? void 0 : _this$currentLayout2$.forEach(function (group) {
|
|
633
|
+
_this$currentLayout2$,
|
|
634
|
+
_this$currentLayout2$2,
|
|
635
|
+
_this5 = this;
|
|
636
|
+
(_this$currentLayout2 = this.currentLayout) === null || _this$currentLayout2 === void 0 ? void 0 : (_this$currentLayout2$ = _this$currentLayout2.activeSpeakerVideoPaneGroups
|
|
637
|
+
// sorting in descending order based on group priority
|
|
638
|
+
) === null || _this$currentLayout2$ === void 0 ? void 0 : (_this$currentLayout2$2 = _this$currentLayout2$.sort(function (a, b) {
|
|
639
|
+
return a.priority < b.priority ? 1 : -1;
|
|
640
|
+
})) === null || _this$currentLayout2$2 === void 0 ? void 0 : _this$currentLayout2$2.forEach(function (group) {
|
|
658
641
|
_this5.receiveSlotAllocations.activeSpeaker[group.id] = {
|
|
659
642
|
slots: []
|
|
660
643
|
};
|
|
661
|
-
|
|
662
644
|
for (var paneIndex = 0; paneIndex < group.numPanes; paneIndex += 1) {
|
|
663
|
-
// allocate a slot from the "unused" list
|
|
664
|
-
var freeSlot = _this5.slots.video.unused.
|
|
665
|
-
|
|
645
|
+
// allocate a slot from the "unused" list, by grabbing in same order (shift) as previous layout
|
|
646
|
+
var freeSlot = _this5.slots.video.unused.shift();
|
|
666
647
|
if (freeSlot) {
|
|
667
648
|
_this5.slots.video.activeSpeaker.push(freeSlot);
|
|
668
|
-
|
|
669
649
|
_this5.receiveSlotAllocations.activeSpeaker[group.id].slots.push(freeSlot);
|
|
670
650
|
}
|
|
671
651
|
}
|
|
672
652
|
});
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Allocates receive slots to all receiver selected video panes
|
|
657
|
+
* in the current selected layout
|
|
658
|
+
*/
|
|
659
|
+
}, {
|
|
660
|
+
key: "allocateSlotsToReceiverSelectedVideoPaneGroups",
|
|
661
|
+
value: function allocateSlotsToReceiverSelectedVideoPaneGroups() {
|
|
662
|
+
var _this$currentLayout3,
|
|
663
|
+
_this$currentLayout3$,
|
|
664
|
+
_this6 = this;
|
|
673
665
|
(_this$currentLayout3 = this.currentLayout) === null || _this$currentLayout3 === void 0 ? void 0 : (_this$currentLayout3$ = _this$currentLayout3.memberVideoPanes) === null || _this$currentLayout3$ === void 0 ? void 0 : _this$currentLayout3$.forEach(function (memberPane) {
|
|
674
666
|
// check if there is existing slot for this csi
|
|
675
|
-
var existingSlot =
|
|
667
|
+
var existingSlot = _this6.slots.video.receiverSelected.find(function (slot) {
|
|
676
668
|
return slot.csi === memberPane.csi;
|
|
677
669
|
});
|
|
678
|
-
|
|
679
|
-
var isExistingSlotAlreadyAllocated = (0, _values.default)(_this5.receiveSlotAllocations.receiverSelected).includes(existingSlot);
|
|
680
|
-
|
|
670
|
+
var isExistingSlotAlreadyAllocated = (0, _values.default)(_this6.receiveSlotAllocations.receiverSelected).includes(existingSlot);
|
|
681
671
|
if (memberPane.csi !== undefined && existingSlot && !isExistingSlotAlreadyAllocated) {
|
|
682
672
|
// found it, so use it
|
|
683
|
-
|
|
673
|
+
_this6.receiveSlotAllocations.receiverSelected[memberPane.id] = existingSlot;
|
|
684
674
|
} else {
|
|
685
675
|
// allocate a slot from the "unused" list
|
|
686
|
-
var freeSlot =
|
|
687
|
-
|
|
676
|
+
var freeSlot = _this6.slots.video.unused.pop();
|
|
688
677
|
if (freeSlot) {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
_this5.receiveSlotAllocations.receiverSelected[memberPane.id] = freeSlot;
|
|
678
|
+
_this6.slots.video.receiverSelected.push(freeSlot);
|
|
679
|
+
_this6.receiveSlotAllocations.receiverSelected[memberPane.id] = freeSlot;
|
|
692
680
|
}
|
|
693
681
|
}
|
|
694
682
|
});
|
|
695
683
|
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Ensures that we have enough slots for the current layout.
|
|
687
|
+
*/
|
|
688
|
+
}, {
|
|
689
|
+
key: "refillRequiredSlotsIfNeeded",
|
|
690
|
+
value: function () {
|
|
691
|
+
var _refillRequiredSlotsIfNeeded = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
692
|
+
var requiredNumSlots, totalNumSlots, numSlotsToCreate;
|
|
693
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
694
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
695
|
+
case 0:
|
|
696
|
+
requiredNumSlots = this.getRequiredNumVideoSlotsForLayout(this.currentLayout);
|
|
697
|
+
totalNumSlots = this.slots.video.unused.length + this.slots.video.activeSpeaker.length + this.slots.video.receiverSelected.length;
|
|
698
|
+
if (!(totalNumSlots < requiredNumSlots)) {
|
|
699
|
+
_context6.next = 13;
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
numSlotsToCreate = requiredNumSlots - totalNumSlots;
|
|
703
|
+
case 4:
|
|
704
|
+
if (!(numSlotsToCreate > 0)) {
|
|
705
|
+
_context6.next = 13;
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
_context6.t0 = this.slots.video.unused;
|
|
709
|
+
_context6.next = 8;
|
|
710
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.VideoMain);
|
|
711
|
+
case 8:
|
|
712
|
+
_context6.t1 = _context6.sent;
|
|
713
|
+
_context6.t0.push.call(_context6.t0, _context6.t1);
|
|
714
|
+
numSlotsToCreate -= 1;
|
|
715
|
+
_context6.next = 4;
|
|
716
|
+
break;
|
|
717
|
+
case 13:
|
|
718
|
+
case "end":
|
|
719
|
+
return _context6.stop();
|
|
720
|
+
}
|
|
721
|
+
}, _callee6, this);
|
|
722
|
+
}));
|
|
723
|
+
function refillRequiredSlotsIfNeeded() {
|
|
724
|
+
return _refillRequiredSlotsIfNeeded.apply(this, arguments);
|
|
725
|
+
}
|
|
726
|
+
return refillRequiredSlotsIfNeeded;
|
|
727
|
+
}()
|
|
728
|
+
/**
|
|
729
|
+
* Move all active speaker slots to "unused"
|
|
730
|
+
*/
|
|
731
|
+
}, {
|
|
732
|
+
key: "trimActiveSpeakerSlots",
|
|
733
|
+
value: function trimActiveSpeakerSlots() {
|
|
734
|
+
var _this$slots$video$unu4;
|
|
735
|
+
(_this$slots$video$unu4 = this.slots.video.unused).push.apply(_this$slots$video$unu4, (0, _toConsumableArray2.default)(this.slots.video.activeSpeaker));
|
|
736
|
+
this.slots.video.activeSpeaker.length = 0;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Logs the state of the receive slots
|
|
741
|
+
*/
|
|
742
|
+
}, {
|
|
743
|
+
key: "logReceieveSlots",
|
|
744
|
+
value: function logReceieveSlots() {
|
|
745
|
+
var logMessage = '';
|
|
746
|
+
(0, _forEach2.default)(this.receiveSlotAllocations.activeSpeaker, function (group, groupName) {
|
|
747
|
+
logMessage += "group: ".concat(groupName, "\n").concat(group.slots.map(function (slot) {
|
|
748
|
+
return slot.logString;
|
|
749
|
+
}).join(' '));
|
|
750
|
+
});
|
|
751
|
+
logMessage += '\nreceiverSelected:\n';
|
|
752
|
+
(0, _forEach2.default)(this.receiveSlotAllocations.receiverSelected, function (slot, key) {
|
|
753
|
+
logMessage += " ".concat(key, ": ").concat(slot.logString, "\n");
|
|
754
|
+
});
|
|
755
|
+
_loggerProxy.default.logger.log("RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=".concat(this.slots.video.unused.length, ", activeSpeaker=").concat(this.slots.video.activeSpeaker.length, ", receiverSelected=").concat(this.slots.video.receiverSelected.length, "\n").concat(logMessage));
|
|
756
|
+
}
|
|
757
|
+
|
|
696
758
|
/**
|
|
697
759
|
* Makes sure we have the right number of receive slots created for the current layout
|
|
698
760
|
* and allocates them to the right video panes / pane groups
|
|
699
761
|
*
|
|
700
762
|
* @returns {Promise}
|
|
701
763
|
*/
|
|
702
|
-
|
|
703
764
|
}, {
|
|
704
765
|
key: "updateVideoReceiveSlots",
|
|
705
766
|
value: function () {
|
|
706
|
-
var _updateVideoReceiveSlots = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
numSlotsToCreate -= 1;
|
|
740
|
-
_context5.next = 4;
|
|
741
|
-
break;
|
|
742
|
-
|
|
743
|
-
case 13:
|
|
744
|
-
// move all no longer needed receiver-selected slots to "unused"
|
|
745
|
-
this.trimReceiverSelectedSlots(); // move all active speaker slots to "unused"
|
|
746
|
-
|
|
747
|
-
(_this$slots$video$unu4 = this.slots.video.unused).push.apply(_this$slots$video$unu4, (0, _toConsumableArray2.default)(this.slots.video.activeSpeaker));
|
|
748
|
-
|
|
749
|
-
this.slots.video.activeSpeaker.length = 0; // allocate the slots to the right panes / pane groups
|
|
750
|
-
|
|
751
|
-
this.allocateSlotsToVideoPaneGroups();
|
|
752
|
-
|
|
753
|
-
_loggerProxy.default.logger.log("RemoteMediaManager#updateVideoReceiveSlots --> receive slots updated: unused=".concat(this.slots.video.unused.length, ", activeSpeaker=").concat(this.slots.video.activeSpeaker.length, ", receiverSelected=").concat(this.slots.video.receiverSelected.length)); // If this is the initial layout, there may be some "unused" slots left because of the preallocation
|
|
754
|
-
// done in this.preallocateVideoReceiveSlots(), so release them now
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
this.releaseUnusedVideoSlots();
|
|
758
|
-
|
|
759
|
-
case 19:
|
|
760
|
-
case "end":
|
|
761
|
-
return _context5.stop();
|
|
762
|
-
}
|
|
767
|
+
var _updateVideoReceiveSlots = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
768
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
769
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
770
|
+
case 0:
|
|
771
|
+
// move all active speaker slots to "unused"
|
|
772
|
+
this.trimActiveSpeakerSlots();
|
|
773
|
+
|
|
774
|
+
// move all no longer needed receiver-selected slots to "unused"
|
|
775
|
+
this.trimReceiverSelectedSlots();
|
|
776
|
+
|
|
777
|
+
// ensure we have enough total slots for current layout
|
|
778
|
+
_context7.next = 4;
|
|
779
|
+
return this.refillRequiredSlotsIfNeeded();
|
|
780
|
+
case 4:
|
|
781
|
+
// allocate the slots to the right panes / pane groups
|
|
782
|
+
// reset allocations
|
|
783
|
+
this.receiveSlotAllocations = {
|
|
784
|
+
activeSpeaker: {},
|
|
785
|
+
receiverSelected: {}
|
|
786
|
+
};
|
|
787
|
+
// allocate active speaker
|
|
788
|
+
this.allocateSlotsToActiveSpeakerPaneGroups();
|
|
789
|
+
// allocate receiver selected
|
|
790
|
+
this.allocateSlotsToReceiverSelectedVideoPaneGroups();
|
|
791
|
+
this.logReceieveSlots();
|
|
792
|
+
|
|
793
|
+
// If this is the initial layout, there may be some "unused" slots left because of the preallocation
|
|
794
|
+
// done in this.preallocateVideoReceiveSlots(), so release them now
|
|
795
|
+
this.releaseUnusedVideoSlots();
|
|
796
|
+
case 9:
|
|
797
|
+
case "end":
|
|
798
|
+
return _context7.stop();
|
|
763
799
|
}
|
|
764
|
-
},
|
|
800
|
+
}, _callee7, this);
|
|
765
801
|
}));
|
|
766
|
-
|
|
767
802
|
function updateVideoReceiveSlots() {
|
|
768
803
|
return _updateVideoReceiveSlots.apply(this, arguments);
|
|
769
804
|
}
|
|
770
|
-
|
|
771
805
|
return updateVideoReceiveSlots;
|
|
772
806
|
}()
|
|
773
807
|
/**
|
|
774
808
|
* Creates new RemoteMedia and RemoteMediaGroup objects for the current layout
|
|
775
809
|
* and sends the media requests for all of them.
|
|
776
810
|
*/
|
|
777
|
-
|
|
778
811
|
}, {
|
|
779
812
|
key: "updateVideoRemoteMediaObjects",
|
|
780
813
|
value: function updateVideoRemoteMediaObjects() {
|
|
781
|
-
var
|
|
782
|
-
|
|
814
|
+
var _this7 = this;
|
|
783
815
|
// invalidate all the previous remote media objects and cancel their media requests
|
|
784
816
|
this.invalidateCurrentRemoteMedia({
|
|
785
817
|
audio: false,
|
|
786
818
|
video: true,
|
|
819
|
+
screenShareAudio: false,
|
|
820
|
+
screenShareVideo: false,
|
|
787
821
|
commit: false
|
|
788
|
-
});
|
|
822
|
+
});
|
|
789
823
|
|
|
824
|
+
// create new remoteMediaGroup objects
|
|
790
825
|
this.media.video.activeSpeakerGroups = {};
|
|
791
826
|
this.media.video.memberPanes = {};
|
|
792
|
-
|
|
793
827
|
var _loop = function _loop() {
|
|
794
|
-
var
|
|
795
|
-
|
|
828
|
+
var _this7$currentLayout, _this7$currentLayout$;
|
|
796
829
|
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
var paneGroupInCurrentLayout = (_this6$currentLayout = _this6.currentLayout) === null || _this6$currentLayout === void 0 ? void 0 : (_this6$currentLayout$ = _this6$currentLayout.activeSpeakerVideoPaneGroups) === null || _this6$currentLayout$ === void 0 ? void 0 : _this6$currentLayout$.find(function (groupInLayout) {
|
|
830
|
+
groupId = _Object$entries$_i[0],
|
|
831
|
+
group = _Object$entries$_i[1];
|
|
832
|
+
var paneGroupInCurrentLayout = (_this7$currentLayout = _this7.currentLayout) === null || _this7$currentLayout === void 0 ? void 0 : (_this7$currentLayout$ = _this7$currentLayout.activeSpeakerVideoPaneGroups) === null || _this7$currentLayout$ === void 0 ? void 0 : _this7$currentLayout$.find(function (groupInLayout) {
|
|
801
833
|
return groupInLayout.id === groupId;
|
|
802
834
|
});
|
|
803
|
-
|
|
804
835
|
if (paneGroupInCurrentLayout) {
|
|
805
|
-
var mediaGroup = new _remoteMediaGroup.RemoteMediaGroup(
|
|
806
|
-
preferLiveVideo:
|
|
836
|
+
var mediaGroup = new _remoteMediaGroup.RemoteMediaGroup(_this7.mediaRequestManagers.video, group.slots, paneGroupInCurrentLayout.priority, false, {
|
|
837
|
+
preferLiveVideo: _this7.config.video.preferLiveVideo,
|
|
807
838
|
resolution: paneGroupInCurrentLayout.size
|
|
808
839
|
});
|
|
809
|
-
|
|
840
|
+
_this7.media.video.activeSpeakerGroups[groupId] = mediaGroup;
|
|
810
841
|
} else {
|
|
811
842
|
// this should never happen, because this.receiveSlotAllocations are created based on current layout configuration
|
|
812
843
|
_loggerProxy.default.logger.warn("a group id ".concat(groupId, " from this.receiveSlotAllocations.activeSpeaker cannot be found in the current layout configuration"));
|
|
813
844
|
}
|
|
814
845
|
};
|
|
815
|
-
|
|
816
846
|
for (var _i = 0, _Object$entries = (0, _entries.default)(this.receiveSlotAllocations.activeSpeaker); _i < _Object$entries.length; _i++) {
|
|
817
847
|
_loop();
|
|
818
|
-
}
|
|
819
|
-
|
|
848
|
+
}
|
|
820
849
|
|
|
850
|
+
// create new remoteMedia objects
|
|
821
851
|
var _loop2 = function _loop2() {
|
|
822
|
-
var
|
|
823
|
-
|
|
852
|
+
var _this7$currentLayout2, _this7$currentLayout3;
|
|
824
853
|
var _Object$entries3$_i = (0, _slicedToArray2.default)(_Object$entries3[_i2], 2),
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
var paneInCurrentLayout = (_this6$currentLayout2 = _this6.currentLayout) === null || _this6$currentLayout2 === void 0 ? void 0 : (_this6$currentLayout3 = _this6$currentLayout2.memberVideoPanes) === null || _this6$currentLayout3 === void 0 ? void 0 : _this6$currentLayout3.find(function (paneInLayout) {
|
|
854
|
+
paneId = _Object$entries3$_i[0],
|
|
855
|
+
slot = _Object$entries3$_i[1];
|
|
856
|
+
var paneInCurrentLayout = (_this7$currentLayout2 = _this7.currentLayout) === null || _this7$currentLayout2 === void 0 ? void 0 : (_this7$currentLayout3 = _this7$currentLayout2.memberVideoPanes) === null || _this7$currentLayout3 === void 0 ? void 0 : _this7$currentLayout3.find(function (paneInLayout) {
|
|
829
857
|
return paneInLayout.id === paneId;
|
|
830
858
|
});
|
|
831
|
-
|
|
832
859
|
if (paneInCurrentLayout) {
|
|
833
|
-
var remoteMedia = new _remoteMedia.RemoteMedia(slot,
|
|
860
|
+
var remoteMedia = new _remoteMedia.RemoteMedia(slot, _this7.mediaRequestManagers.video, {
|
|
834
861
|
resolution: paneInCurrentLayout.size
|
|
835
862
|
});
|
|
836
|
-
|
|
837
863
|
if (paneInCurrentLayout.csi) {
|
|
838
864
|
remoteMedia.sendMediaRequest(paneInCurrentLayout.csi, false);
|
|
839
865
|
}
|
|
840
|
-
|
|
841
|
-
_this6.media.video.memberPanes[paneId] = remoteMedia;
|
|
866
|
+
_this7.media.video.memberPanes[paneId] = remoteMedia;
|
|
842
867
|
} else {
|
|
843
868
|
// this should never happen, because this.receiveSlotAllocations are created based on current layout configuration
|
|
844
869
|
_loggerProxy.default.logger.warn("a pane id ".concat(paneId, " from this.receiveSlotAllocations.receiverSelected cannot be found in the current layout configuration"));
|
|
845
870
|
}
|
|
846
871
|
};
|
|
847
|
-
|
|
848
872
|
for (var _i2 = 0, _Object$entries3 = (0, _entries.default)(this.receiveSlotAllocations.receiverSelected); _i2 < _Object$entries3.length; _i2++) {
|
|
849
873
|
_loop2();
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
874
|
+
}
|
|
853
875
|
this.mediaRequestManagers.video.commit();
|
|
854
876
|
}
|
|
877
|
+
|
|
855
878
|
/**
|
|
856
|
-
*
|
|
879
|
+
* Checks if current layout requires a screen share.
|
|
880
|
+
* If it does, it creates new RemoteMediaGroup object for screen share
|
|
881
|
+
* and sends the media requests for it.
|
|
882
|
+
* If it doesn't, it makes sure we clean up any RemoteMediaGroup objects
|
|
883
|
+
* created earlier for screen share (for previous layout).
|
|
857
884
|
*/
|
|
885
|
+
}, {
|
|
886
|
+
key: "updateScreenShareVideoRemoteMediaObject",
|
|
887
|
+
value: function updateScreenShareVideoRemoteMediaObject() {
|
|
888
|
+
var _this$currentLayout4;
|
|
889
|
+
this.invalidateCurrentRemoteMedia({
|
|
890
|
+
audio: false,
|
|
891
|
+
video: false,
|
|
892
|
+
screenShareAudio: false,
|
|
893
|
+
screenShareVideo: true,
|
|
894
|
+
commit: false
|
|
895
|
+
});
|
|
896
|
+
this.media.screenShare.video = undefined;
|
|
897
|
+
if ((_this$currentLayout4 = this.currentLayout) !== null && _this$currentLayout4 !== void 0 && _this$currentLayout4.screenShareVideo) {
|
|
898
|
+
// we create a group of 1, because for screen share we need to use the "active speaker" policy
|
|
899
|
+
this.media.screenShare.video = new _remoteMediaGroup.RemoteMediaGroup(this.mediaRequestManagers.screenShareVideo, [this.slots.screenShare.video], 255, false, {
|
|
900
|
+
resolution: this.currentLayout.screenShareVideo.size
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
this.mediaRequestManagers.screenShareVideo.commit();
|
|
904
|
+
}
|
|
858
905
|
|
|
906
|
+
/**
|
|
907
|
+
* Invalidates all remote media objects belonging to currently selected layout
|
|
908
|
+
*/
|
|
859
909
|
}, {
|
|
860
910
|
key: "invalidateCurrentRemoteMedia",
|
|
861
911
|
value: function invalidateCurrentRemoteMedia(options) {
|
|
862
912
|
var audio = options.audio,
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
913
|
+
video = options.video,
|
|
914
|
+
screenShareAudio = options.screenShareAudio,
|
|
915
|
+
screenShareVideo = options.screenShareVideo,
|
|
916
|
+
commit = options.commit;
|
|
866
917
|
if (audio && this.media.audio) {
|
|
867
918
|
this.media.audio.stop(commit);
|
|
868
919
|
}
|
|
869
|
-
|
|
870
920
|
if (video) {
|
|
871
921
|
(0, _values.default)(this.media.video.activeSpeakerGroups).forEach(function (remoteMediaGroup) {
|
|
872
922
|
remoteMediaGroup.stop(false);
|
|
@@ -874,21 +924,28 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
874
924
|
(0, _values.default)(this.media.video.memberPanes).forEach(function (remoteMedia) {
|
|
875
925
|
remoteMedia.stop(false);
|
|
876
926
|
});
|
|
877
|
-
|
|
878
927
|
if (commit) {
|
|
879
928
|
this.mediaRequestManagers.video.commit();
|
|
880
929
|
}
|
|
881
930
|
}
|
|
931
|
+
if (screenShareAudio && this.media.screenShare.audio) {
|
|
932
|
+
this.media.screenShare.audio.stop(commit);
|
|
933
|
+
}
|
|
934
|
+
if (screenShareVideo && this.media.screenShare.video) {
|
|
935
|
+
this.media.screenShare.video.stop(commit);
|
|
936
|
+
}
|
|
882
937
|
}
|
|
883
|
-
/** emits Event.VideoLayoutChanged */
|
|
884
938
|
|
|
939
|
+
/** emits Event.VideoLayoutChanged */
|
|
885
940
|
}, {
|
|
886
941
|
key: "emitVideoLayoutChangedEvent",
|
|
887
942
|
value: function emitVideoLayoutChangedEvent() {
|
|
943
|
+
var _this$media$screenSha;
|
|
888
944
|
// todo: at this point the receive slots might still be showing a participant from previous layout, we should
|
|
889
|
-
// wait for our media requests to be
|
|
945
|
+
// wait for our media requests to be fulfilled, but there is no API for that right now (we could wait for source updates
|
|
890
946
|
// but in some cases they might never come, or would need to always make sure to use a new set of receiver slots)
|
|
891
947
|
// for now it's fine to have it like this, we will re-evaluate if it needs improving after more testing
|
|
948
|
+
|
|
892
949
|
this.emit({
|
|
893
950
|
file: 'multistream/remoteMediaManager',
|
|
894
951
|
function: 'emitVideoLayoutChangedEvent'
|
|
@@ -896,30 +953,29 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
896
953
|
layoutId: this.currentLayoutId,
|
|
897
954
|
activeSpeakerVideoPanes: this.media.video.activeSpeakerGroups,
|
|
898
955
|
memberVideoPanes: this.media.video.memberPanes,
|
|
899
|
-
screenShareVideo:
|
|
900
|
-
|
|
956
|
+
screenShareVideo: (_this$media$screenSha = this.media.screenShare.video) === null || _this$media$screenSha === void 0 ? void 0 : _this$media$screenSha.getRemoteMedia()[0]
|
|
901
957
|
});
|
|
902
958
|
}
|
|
959
|
+
|
|
903
960
|
/**
|
|
904
961
|
* Sets a new CSI on a given remote media object
|
|
905
962
|
*
|
|
906
963
|
* @param {RemoteMedia} remoteMedia remote Media object to modify
|
|
907
964
|
* @param {CSI} csi new CSI value, can be null if we want to stop receiving media
|
|
908
965
|
*/
|
|
909
|
-
|
|
910
966
|
}, {
|
|
911
967
|
key: "setRemoteVideoCsi",
|
|
912
968
|
value: function setRemoteVideoCsi(remoteMedia, csi) {
|
|
913
969
|
if (!(0, _values.default)(this.media.video.memberPanes).includes(remoteMedia)) {
|
|
914
970
|
throw new Error('remoteMedia not found');
|
|
915
971
|
}
|
|
916
|
-
|
|
917
972
|
if (csi) {
|
|
918
973
|
remoteMedia.sendMediaRequest(csi, true);
|
|
919
974
|
} else {
|
|
920
975
|
remoteMedia.cancelMediaRequest(true);
|
|
921
976
|
}
|
|
922
977
|
}
|
|
978
|
+
|
|
923
979
|
/**
|
|
924
980
|
* Adds a new member video pane to the currently selected layout.
|
|
925
981
|
*
|
|
@@ -928,68 +984,53 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
928
984
|
* @param {MemberVideoPane} newPane
|
|
929
985
|
* @returns {Promise<RemoteMedia>}
|
|
930
986
|
*/
|
|
931
|
-
|
|
932
987
|
}, {
|
|
933
988
|
key: "addMemberVideoPane",
|
|
934
989
|
value: function () {
|
|
935
|
-
var _addMemberVideoPane = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
936
|
-
var _this$
|
|
937
|
-
|
|
990
|
+
var _addMemberVideoPane = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(newPane) {
|
|
991
|
+
var _this$currentLayout5;
|
|
938
992
|
var receiveSlot, remoteMedia;
|
|
939
|
-
return _regenerator.default.wrap(function
|
|
940
|
-
while (1) {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
if (newPane.csi) {
|
|
975
|
-
remoteMedia.sendMediaRequest(newPane.csi, true);
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
this.media.video.memberPanes[newPane.id] = remoteMedia;
|
|
979
|
-
return _context6.abrupt("return", remoteMedia);
|
|
980
|
-
|
|
981
|
-
case 14:
|
|
982
|
-
case "end":
|
|
983
|
-
return _context6.stop();
|
|
984
|
-
}
|
|
993
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
994
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
995
|
+
case 0:
|
|
996
|
+
if (this.currentLayout) {
|
|
997
|
+
_context8.next = 2;
|
|
998
|
+
break;
|
|
999
|
+
}
|
|
1000
|
+
throw new Error('There is no current layout selected, call start() first');
|
|
1001
|
+
case 2:
|
|
1002
|
+
if (!((_this$currentLayout5 = this.currentLayout) !== null && _this$currentLayout5 !== void 0 && _this$currentLayout5.memberVideoPanes)) {
|
|
1003
|
+
this.currentLayout.memberVideoPanes = [];
|
|
1004
|
+
}
|
|
1005
|
+
if (!(newPane.id in this.currentLayout.memberVideoPanes)) {
|
|
1006
|
+
_context8.next = 5;
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
throw new Error("duplicate pane id ".concat(newPane.id, " - this pane already exists in current layout's memberVideoPanes"));
|
|
1010
|
+
case 5:
|
|
1011
|
+
this.currentLayout.memberVideoPanes.push(newPane);
|
|
1012
|
+
_context8.next = 8;
|
|
1013
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.VideoMain);
|
|
1014
|
+
case 8:
|
|
1015
|
+
receiveSlot = _context8.sent;
|
|
1016
|
+
this.slots.video.receiverSelected.push(receiveSlot);
|
|
1017
|
+
remoteMedia = new _remoteMedia.RemoteMedia(receiveSlot, this.mediaRequestManagers.video, {
|
|
1018
|
+
resolution: newPane.size
|
|
1019
|
+
});
|
|
1020
|
+
if (newPane.csi) {
|
|
1021
|
+
remoteMedia.sendMediaRequest(newPane.csi, true);
|
|
1022
|
+
}
|
|
1023
|
+
this.media.video.memberPanes[newPane.id] = remoteMedia;
|
|
1024
|
+
return _context8.abrupt("return", remoteMedia);
|
|
1025
|
+
case 14:
|
|
1026
|
+
case "end":
|
|
1027
|
+
return _context8.stop();
|
|
985
1028
|
}
|
|
986
|
-
},
|
|
1029
|
+
}, _callee8, this);
|
|
987
1030
|
}));
|
|
988
|
-
|
|
989
1031
|
function addMemberVideoPane(_x2) {
|
|
990
1032
|
return _addMemberVideoPane.apply(this, arguments);
|
|
991
1033
|
}
|
|
992
|
-
|
|
993
1034
|
return addMemberVideoPane;
|
|
994
1035
|
}()
|
|
995
1036
|
/**
|
|
@@ -1000,49 +1041,40 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
1000
1041
|
* @param {PaneId} paneId pane id of the pane to remove
|
|
1001
1042
|
* @returns {Promise<void>}
|
|
1002
1043
|
*/
|
|
1003
|
-
|
|
1004
1044
|
}, {
|
|
1005
1045
|
key: "removeMemberVideoPane",
|
|
1006
1046
|
value: function removeMemberVideoPane(paneId) {
|
|
1007
1047
|
var _this$currentLayout$m2, _this$currentLayout$m3;
|
|
1008
|
-
|
|
1009
1048
|
if (!this.currentLayout) {
|
|
1010
1049
|
return _promise.default.reject(new Error('There is no current layout selected, call start() first'));
|
|
1011
1050
|
}
|
|
1012
|
-
|
|
1013
1051
|
if (!((_this$currentLayout$m2 = this.currentLayout.memberVideoPanes) !== null && _this$currentLayout$m2 !== void 0 && _this$currentLayout$m2.find(function (pane) {
|
|
1014
1052
|
return pane.id === paneId;
|
|
1015
1053
|
}))) {
|
|
1016
1054
|
// pane id doesn't exist, so nothing to do
|
|
1017
1055
|
_loggerProxy.default.logger.log("RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ".concat(paneId, " (pane not found in currentLayout.memberVideoPanes)"));
|
|
1018
|
-
|
|
1019
1056
|
return _promise.default.resolve();
|
|
1020
1057
|
}
|
|
1021
|
-
|
|
1022
1058
|
if (!this.media.video.memberPanes[paneId]) {
|
|
1023
1059
|
// pane id doesn't exist, so nothing to do
|
|
1024
1060
|
_loggerProxy.default.logger.log("RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ".concat(paneId, " (pane not found in this.media.video.memberPanes)"));
|
|
1025
|
-
|
|
1026
1061
|
return _promise.default.resolve();
|
|
1027
1062
|
}
|
|
1028
|
-
|
|
1029
1063
|
var remoteMedia = this.media.video.memberPanes[paneId];
|
|
1030
1064
|
var receiveSlot = remoteMedia.getUnderlyingReceiveSlot();
|
|
1031
|
-
|
|
1032
1065
|
if (receiveSlot) {
|
|
1033
1066
|
this.receiveSlotManager.releaseSlot(receiveSlot);
|
|
1034
1067
|
var index = this.slots.video.receiverSelected.indexOf(receiveSlot);
|
|
1035
|
-
|
|
1036
1068
|
if (index >= 0) {
|
|
1037
1069
|
this.slots.video.receiverSelected.splice(index, 1);
|
|
1038
1070
|
}
|
|
1039
1071
|
}
|
|
1040
|
-
|
|
1041
1072
|
remoteMedia.stop();
|
|
1042
1073
|
delete this.media.video.memberPanes[paneId];
|
|
1043
1074
|
(_this$currentLayout$m3 = this.currentLayout.memberVideoPanes) === null || _this$currentLayout$m3 === void 0 ? true : delete _this$currentLayout$m3[paneId];
|
|
1044
1075
|
return _promise.default.resolve();
|
|
1045
1076
|
}
|
|
1077
|
+
|
|
1046
1078
|
/**
|
|
1047
1079
|
* Pins an active speaker remote media object to the given CSI value. From that moment
|
|
1048
1080
|
* onwards the remote media will only play audio/video from that specific CSI until
|
|
@@ -1051,39 +1083,35 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
1051
1083
|
* @param {RemoteMedia} remoteMedia remote media object reference
|
|
1052
1084
|
* @param {CSI} csi CSI value to pin to, if undefined, then current CSI value is used
|
|
1053
1085
|
*/
|
|
1054
|
-
|
|
1055
1086
|
}, {
|
|
1056
1087
|
key: "pinActiveSpeakerVideoPane",
|
|
1057
1088
|
value: function pinActiveSpeakerVideoPane(remoteMedia, csi) {
|
|
1058
1089
|
var remoteMediaGroup = (0, _values.default)(this.media.video.activeSpeakerGroups).find(function (group) {
|
|
1059
1090
|
return group.includes(remoteMedia, 'unpinned');
|
|
1060
1091
|
});
|
|
1061
|
-
|
|
1062
1092
|
if (!remoteMediaGroup) {
|
|
1063
1093
|
throw new Error('remoteMedia not found among the unpinned remote media from any active speaker group');
|
|
1064
1094
|
}
|
|
1065
|
-
|
|
1066
1095
|
remoteMediaGroup.pin(remoteMedia, csi);
|
|
1067
1096
|
}
|
|
1097
|
+
|
|
1068
1098
|
/**
|
|
1069
1099
|
* Unpins a remote media object from the fixed CSI value it was pinned to.
|
|
1070
1100
|
*
|
|
1071
1101
|
* @param {RemoteMedia} remoteMedia remote media object reference
|
|
1072
1102
|
*/
|
|
1073
|
-
|
|
1074
1103
|
}, {
|
|
1075
1104
|
key: "unpinActiveSpeakerVideoPane",
|
|
1076
1105
|
value: function unpinActiveSpeakerVideoPane(remoteMedia) {
|
|
1077
1106
|
var remoteMediaGroup = (0, _values.default)(this.media.video.activeSpeakerGroups).find(function (group) {
|
|
1078
1107
|
return group.includes(remoteMedia, 'pinned');
|
|
1079
1108
|
});
|
|
1080
|
-
|
|
1081
1109
|
if (!remoteMediaGroup) {
|
|
1082
1110
|
throw new Error('remoteMedia not found among the pinned remote media from any active speaker group');
|
|
1083
1111
|
}
|
|
1084
|
-
|
|
1085
1112
|
remoteMediaGroup.unpin(remoteMedia);
|
|
1086
1113
|
}
|
|
1114
|
+
|
|
1087
1115
|
/**
|
|
1088
1116
|
* Returns true if a given remote media object belongs to an active speaker group and has been pinned.
|
|
1089
1117
|
* Throws an error if the remote media object doesn't belong to any active speaker remote media group.
|
|
@@ -1091,23 +1119,19 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
1091
1119
|
* @param {RemoteMedia} remoteMedia remote media object
|
|
1092
1120
|
* @returns {boolean}
|
|
1093
1121
|
*/
|
|
1094
|
-
|
|
1095
1122
|
}, {
|
|
1096
1123
|
key: "isPinned",
|
|
1097
1124
|
value: function isPinned(remoteMedia) {
|
|
1098
1125
|
var remoteMediaGroup = (0, _values.default)(this.media.video.activeSpeakerGroups).find(function (group) {
|
|
1099
1126
|
return group.includes(remoteMedia);
|
|
1100
1127
|
});
|
|
1101
|
-
|
|
1102
1128
|
if (!remoteMediaGroup) {
|
|
1103
1129
|
throw new Error('remoteMedia not found among any remote media (pinned or unpinned) from any active speaker group');
|
|
1104
1130
|
}
|
|
1105
|
-
|
|
1106
1131
|
return remoteMediaGroup.isPinned(remoteMedia);
|
|
1107
1132
|
}
|
|
1108
1133
|
}]);
|
|
1109
1134
|
return RemoteMediaManager;
|
|
1110
1135
|
}(_eventsScope.default);
|
|
1111
|
-
|
|
1112
1136
|
exports.RemoteMediaManager = RemoteMediaManager;
|
|
1113
1137
|
//# sourceMappingURL=remoteMediaManager.js.map
|