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