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