@webex/plugin-meetings 3.0.0-beta.4 → 3.0.0-beta.40
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 +546 -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 +48 -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 +109 -49
- 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 +15 -0
- package/dist/controls-options-manager/enums.js.map +1 -0
- package/dist/controls-options-manager/index.js +203 -0
- package/dist/controls-options-manager/index.js.map +1 -0
- package/dist/controls-options-manager/util.js +28 -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 +12 -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 +186 -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 +34 -91
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +66 -153
- 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 +13 -14
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2141 -2210
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +59 -82
- 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 +45 -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 +490 -560
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +24 -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 +78 -86
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +31 -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 +95 -200
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +16 -39
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +9 -38
- 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 +60 -82
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +60 -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 +360 -413
- 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 +147 -183
- 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 +322 -456
- 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 +361 -449
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +137 -81
- 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 +916 -0
- package/dist/types/controls-options-manager/constants.d.ts +4 -0
- package/dist/types/controls-options-manager/enums.d.ts +5 -0
- package/dist/types/controls-options-manager/index.d.ts +120 -0
- package/dist/types/controls-options-manager/util.d.ts +7 -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 +269 -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 +83 -0
- package/dist/types/meeting/index.d.ts +1699 -0
- package/dist/types/meeting/muteState.d.ts +116 -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 +146 -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 +320 -0
- package/dist/types/members/request.d.ts +50 -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 +46 -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 +241 -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 +140 -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 +117 -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 +199 -0
- package/src/breakouts/breakout.ts +130 -0
- package/src/breakouts/collection.ts +19 -0
- package/src/breakouts/edit-lock-error.ts +25 -0
- package/src/breakouts/index.ts +504 -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 +62 -5
- package/src/controls-options-manager/constants.ts +5 -0
- package/src/controls-options-manager/enums.ts +6 -0
- package/src/controls-options-manager/index.ts +183 -0
- package/src/controls-options-manager/util.ts +20 -0
- package/src/index.js +4 -1
- package/src/locus-info/controlsUtils.ts +114 -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} +150 -66
- 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} +123 -68
- package/src/media/{index.js → index.ts} +182 -173
- 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 +31 -3
- package/src/meeting/{index.js → index.ts} +2512 -1579
- package/src/meeting/{muteState.js → muteState.ts} +95 -49
- 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} +117 -119
- 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 +1159 -0
- package/src/meetings/{request.js → request.ts} +32 -25
- package/src/meetings/{util.js → util.ts} +58 -32
- package/src/member/{index.js → index.ts} +102 -56
- package/src/member/{util.js → util.ts} +52 -25
- package/src/members/{collection.js → collection.ts} +2 -2
- package/src/members/{index.js → index.ts} +221 -142
- package/src/members/{request.js → request.ts} +60 -16
- package/src/members/{util.js → util.ts} +50 -48
- 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 +35 -21
- package/src/multistream/remoteMedia.ts +38 -5
- package/src/multistream/remoteMediaGroup.ts +4 -3
- package/src/multistream/remoteMediaManager.ts +152 -36
- 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} +109 -85
- 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} +196 -103
- 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 +1234 -0
- package/src/statsAnalyzer/mqaUtil.ts +293 -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 +147 -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 +707 -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 +124 -0
- package/test/unit/spec/controls-options-manager/util.js +66 -0
- package/test/unit/spec/fixture/locus.js +92 -90
- package/test/unit/spec/locus-info/controlsUtils.js +25 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +104 -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 +97 -103
- package/test/unit/spec/locus-info/selfUtils.js +105 -12
- package/test/unit/spec/media/index.ts +39 -53
- package/test/unit/spec/media/properties.ts +9 -9
- package/test/unit/spec/meeting/in-meeting-actions.ts +13 -2
- package/test/unit/spec/meeting/index.js +2253 -811
- package/test/unit/spec/meeting/muteState.js +74 -55
- package/test/unit/spec/meeting/request.js +141 -43
- package/test/unit/spec/meeting/utils.js +106 -171
- 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 +0 -1
- package/test/unit/spec/member/util.js +31 -7
- package/test/unit/spec/members/index.js +104 -54
- package/test/unit/spec/members/request.js +29 -20
- package/test/unit/spec/members/utils.js +8 -5
- 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 +41 -13
- package/test/unit/spec/multistream/remoteMedia.ts +38 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +5 -5
- package/test/unit/spec/multistream/remoteMediaManager.ts +412 -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 +70 -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 +86 -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,127 +459,175 @@ 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
621
|
* Allocates receive slots to all video panes in the current selected layout
|
|
642
622
|
*/
|
|
643
|
-
|
|
644
623
|
}, {
|
|
645
624
|
key: "allocateSlotsToVideoPaneGroups",
|
|
646
625
|
value: function allocateSlotsToVideoPaneGroups() {
|
|
647
626
|
var _this$currentLayout2,
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
627
|
+
_this$currentLayout2$,
|
|
628
|
+
_this5 = this,
|
|
629
|
+
_this$currentLayout3,
|
|
630
|
+
_this$currentLayout3$;
|
|
653
631
|
this.receiveSlotAllocations = {
|
|
654
632
|
activeSpeaker: {},
|
|
655
633
|
receiverSelected: {}
|
|
@@ -658,14 +636,11 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
658
636
|
_this5.receiveSlotAllocations.activeSpeaker[group.id] = {
|
|
659
637
|
slots: []
|
|
660
638
|
};
|
|
661
|
-
|
|
662
639
|
for (var paneIndex = 0; paneIndex < group.numPanes; paneIndex += 1) {
|
|
663
640
|
// allocate a slot from the "unused" list
|
|
664
641
|
var freeSlot = _this5.slots.video.unused.pop();
|
|
665
|
-
|
|
666
642
|
if (freeSlot) {
|
|
667
643
|
_this5.slots.video.activeSpeaker.push(freeSlot);
|
|
668
|
-
|
|
669
644
|
_this5.receiveSlotAllocations.activeSpeaker[group.id].slots.push(freeSlot);
|
|
670
645
|
}
|
|
671
646
|
}
|
|
@@ -675,132 +650,111 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
675
650
|
var existingSlot = _this5.slots.video.receiverSelected.find(function (slot) {
|
|
676
651
|
return slot.csi === memberPane.csi;
|
|
677
652
|
});
|
|
678
|
-
|
|
679
653
|
var isExistingSlotAlreadyAllocated = (0, _values.default)(_this5.receiveSlotAllocations.receiverSelected).includes(existingSlot);
|
|
680
|
-
|
|
681
654
|
if (memberPane.csi !== undefined && existingSlot && !isExistingSlotAlreadyAllocated) {
|
|
682
655
|
// found it, so use it
|
|
683
656
|
_this5.receiveSlotAllocations.receiverSelected[memberPane.id] = existingSlot;
|
|
684
657
|
} else {
|
|
685
658
|
// allocate a slot from the "unused" list
|
|
686
659
|
var freeSlot = _this5.slots.video.unused.pop();
|
|
687
|
-
|
|
688
660
|
if (freeSlot) {
|
|
689
661
|
_this5.slots.video.receiverSelected.push(freeSlot);
|
|
690
|
-
|
|
691
662
|
_this5.receiveSlotAllocations.receiverSelected[memberPane.id] = freeSlot;
|
|
692
663
|
}
|
|
693
664
|
}
|
|
694
665
|
});
|
|
695
666
|
}
|
|
667
|
+
|
|
696
668
|
/**
|
|
697
669
|
* Makes sure we have the right number of receive slots created for the current layout
|
|
698
670
|
* and allocates them to the right video panes / pane groups
|
|
699
671
|
*
|
|
700
672
|
* @returns {Promise}
|
|
701
673
|
*/
|
|
702
|
-
|
|
703
674
|
}, {
|
|
704
675
|
key: "updateVideoReceiveSlots",
|
|
705
676
|
value: function () {
|
|
706
|
-
var _updateVideoReceiveSlots = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
677
|
+
var _updateVideoReceiveSlots = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
707
678
|
var _this$slots$video$unu4;
|
|
708
|
-
|
|
709
679
|
var requiredNumSlots, totalNumSlots, numSlotsToCreate;
|
|
710
|
-
return _regenerator.default.wrap(function
|
|
711
|
-
while (1) {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
if (!(totalNumSlots < requiredNumSlots)) {
|
|
718
|
-
_context5.next = 13;
|
|
719
|
-
break;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
numSlotsToCreate = requiredNumSlots - totalNumSlots;
|
|
723
|
-
|
|
724
|
-
case 4:
|
|
725
|
-
if (!(numSlotsToCreate > 0)) {
|
|
726
|
-
_context5.next = 13;
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
_context5.t0 = this.slots.video.unused;
|
|
731
|
-
_context5.next = 8;
|
|
732
|
-
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaConnection.MediaType.VideoMain);
|
|
733
|
-
|
|
734
|
-
case 8:
|
|
735
|
-
_context5.t1 = _context5.sent;
|
|
736
|
-
|
|
737
|
-
_context5.t0.push.call(_context5.t0, _context5.t1);
|
|
738
|
-
|
|
739
|
-
numSlotsToCreate -= 1;
|
|
740
|
-
_context5.next = 4;
|
|
680
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
681
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
682
|
+
case 0:
|
|
683
|
+
requiredNumSlots = this.getRequiredNumVideoSlotsForLayout(this.currentLayout);
|
|
684
|
+
totalNumSlots = this.slots.video.unused.length + this.slots.video.activeSpeaker.length + this.slots.video.receiverSelected.length; // ensure we have enough total slots for current layout
|
|
685
|
+
if (!(totalNumSlots < requiredNumSlots)) {
|
|
686
|
+
_context6.next = 13;
|
|
741
687
|
break;
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
688
|
+
}
|
|
689
|
+
numSlotsToCreate = requiredNumSlots - totalNumSlots;
|
|
690
|
+
case 4:
|
|
691
|
+
if (!(numSlotsToCreate > 0)) {
|
|
692
|
+
_context6.next = 13;
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
_context6.t0 = this.slots.video.unused;
|
|
696
|
+
_context6.next = 8;
|
|
697
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.VideoMain);
|
|
698
|
+
case 8:
|
|
699
|
+
_context6.t1 = _context6.sent;
|
|
700
|
+
_context6.t0.push.call(_context6.t0, _context6.t1);
|
|
701
|
+
numSlotsToCreate -= 1;
|
|
702
|
+
_context6.next = 4;
|
|
703
|
+
break;
|
|
704
|
+
case 13:
|
|
705
|
+
// move all no longer needed receiver-selected slots to "unused"
|
|
706
|
+
this.trimReceiverSelectedSlots();
|
|
707
|
+
|
|
708
|
+
// move all active speaker slots to "unused"
|
|
709
|
+
(_this$slots$video$unu4 = this.slots.video.unused).push.apply(_this$slots$video$unu4, (0, _toConsumableArray2.default)(this.slots.video.activeSpeaker));
|
|
710
|
+
this.slots.video.activeSpeaker.length = 0;
|
|
711
|
+
|
|
712
|
+
// allocate the slots to the right panes / pane groups
|
|
713
|
+
this.allocateSlotsToVideoPaneGroups();
|
|
714
|
+
_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));
|
|
715
|
+
|
|
716
|
+
// If this is the initial layout, there may be some "unused" slots left because of the preallocation
|
|
717
|
+
// done in this.preallocateVideoReceiveSlots(), so release them now
|
|
718
|
+
this.releaseUnusedVideoSlots();
|
|
719
|
+
case 19:
|
|
720
|
+
case "end":
|
|
721
|
+
return _context6.stop();
|
|
763
722
|
}
|
|
764
|
-
},
|
|
723
|
+
}, _callee6, this);
|
|
765
724
|
}));
|
|
766
|
-
|
|
767
725
|
function updateVideoReceiveSlots() {
|
|
768
726
|
return _updateVideoReceiveSlots.apply(this, arguments);
|
|
769
727
|
}
|
|
770
|
-
|
|
771
728
|
return updateVideoReceiveSlots;
|
|
772
729
|
}()
|
|
773
730
|
/**
|
|
774
731
|
* Creates new RemoteMedia and RemoteMediaGroup objects for the current layout
|
|
775
732
|
* and sends the media requests for all of them.
|
|
776
733
|
*/
|
|
777
|
-
|
|
778
734
|
}, {
|
|
779
735
|
key: "updateVideoRemoteMediaObjects",
|
|
780
736
|
value: function updateVideoRemoteMediaObjects() {
|
|
781
737
|
var _this6 = this;
|
|
782
|
-
|
|
783
738
|
// invalidate all the previous remote media objects and cancel their media requests
|
|
784
739
|
this.invalidateCurrentRemoteMedia({
|
|
785
740
|
audio: false,
|
|
786
741
|
video: true,
|
|
742
|
+
screenShareAudio: false,
|
|
743
|
+
screenShareVideo: false,
|
|
787
744
|
commit: false
|
|
788
|
-
});
|
|
745
|
+
});
|
|
789
746
|
|
|
747
|
+
// create new remoteMediaGroup objects
|
|
790
748
|
this.media.video.activeSpeakerGroups = {};
|
|
791
749
|
this.media.video.memberPanes = {};
|
|
792
|
-
|
|
793
750
|
var _loop = function _loop() {
|
|
794
751
|
var _this6$currentLayout, _this6$currentLayout$;
|
|
795
|
-
|
|
796
752
|
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
753
|
+
groupId = _Object$entries$_i[0],
|
|
754
|
+
group = _Object$entries$_i[1];
|
|
800
755
|
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) {
|
|
801
756
|
return groupInLayout.id === groupId;
|
|
802
757
|
});
|
|
803
|
-
|
|
804
758
|
if (paneGroupInCurrentLayout) {
|
|
805
759
|
var mediaGroup = new _remoteMediaGroup.RemoteMediaGroup(_this6.mediaRequestManagers.video, group.slots, paneGroupInCurrentLayout.priority, false, {
|
|
806
760
|
preferLiveVideo: _this6.config.video.preferLiveVideo,
|
|
@@ -812,61 +766,80 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
812
766
|
_loggerProxy.default.logger.warn("a group id ".concat(groupId, " from this.receiveSlotAllocations.activeSpeaker cannot be found in the current layout configuration"));
|
|
813
767
|
}
|
|
814
768
|
};
|
|
815
|
-
|
|
816
769
|
for (var _i = 0, _Object$entries = (0, _entries.default)(this.receiveSlotAllocations.activeSpeaker); _i < _Object$entries.length; _i++) {
|
|
817
770
|
_loop();
|
|
818
|
-
}
|
|
819
|
-
|
|
771
|
+
}
|
|
820
772
|
|
|
773
|
+
// create new remoteMedia objects
|
|
821
774
|
var _loop2 = function _loop2() {
|
|
822
775
|
var _this6$currentLayout2, _this6$currentLayout3;
|
|
823
|
-
|
|
824
776
|
var _Object$entries3$_i = (0, _slicedToArray2.default)(_Object$entries3[_i2], 2),
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
777
|
+
paneId = _Object$entries3$_i[0],
|
|
778
|
+
slot = _Object$entries3$_i[1];
|
|
828
779
|
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) {
|
|
829
780
|
return paneInLayout.id === paneId;
|
|
830
781
|
});
|
|
831
|
-
|
|
832
782
|
if (paneInCurrentLayout) {
|
|
833
783
|
var remoteMedia = new _remoteMedia.RemoteMedia(slot, _this6.mediaRequestManagers.video, {
|
|
834
784
|
resolution: paneInCurrentLayout.size
|
|
835
785
|
});
|
|
836
|
-
|
|
837
786
|
if (paneInCurrentLayout.csi) {
|
|
838
787
|
remoteMedia.sendMediaRequest(paneInCurrentLayout.csi, false);
|
|
839
788
|
}
|
|
840
|
-
|
|
841
789
|
_this6.media.video.memberPanes[paneId] = remoteMedia;
|
|
842
790
|
} else {
|
|
843
791
|
// this should never happen, because this.receiveSlotAllocations are created based on current layout configuration
|
|
844
792
|
_loggerProxy.default.logger.warn("a pane id ".concat(paneId, " from this.receiveSlotAllocations.receiverSelected cannot be found in the current layout configuration"));
|
|
845
793
|
}
|
|
846
794
|
};
|
|
847
|
-
|
|
848
795
|
for (var _i2 = 0, _Object$entries3 = (0, _entries.default)(this.receiveSlotAllocations.receiverSelected); _i2 < _Object$entries3.length; _i2++) {
|
|
849
796
|
_loop2();
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
797
|
+
}
|
|
853
798
|
this.mediaRequestManagers.video.commit();
|
|
854
799
|
}
|
|
800
|
+
|
|
855
801
|
/**
|
|
856
|
-
*
|
|
802
|
+
* Checks if current layout requires a screen share.
|
|
803
|
+
* If it does, it creates new RemoteMediaGroup object for screen share
|
|
804
|
+
* and sends the media requests for it.
|
|
805
|
+
* If it doesn't, it makes sure we clean up any RemoteMediaGroup objects
|
|
806
|
+
* created earlier for screen share (for previous layout).
|
|
857
807
|
*/
|
|
808
|
+
}, {
|
|
809
|
+
key: "updateScreenShareVideoRemoteMediaObject",
|
|
810
|
+
value: function updateScreenShareVideoRemoteMediaObject() {
|
|
811
|
+
var _this$currentLayout4;
|
|
812
|
+
this.invalidateCurrentRemoteMedia({
|
|
813
|
+
audio: false,
|
|
814
|
+
video: false,
|
|
815
|
+
screenShareAudio: false,
|
|
816
|
+
screenShareVideo: true,
|
|
817
|
+
commit: false
|
|
818
|
+
});
|
|
819
|
+
this.media.screenShare.video = undefined;
|
|
820
|
+
if ((_this$currentLayout4 = this.currentLayout) !== null && _this$currentLayout4 !== void 0 && _this$currentLayout4.screenShareVideo) {
|
|
821
|
+
// we create a group of 1, because for screen share we need to use the "active speaker" policy
|
|
822
|
+
this.media.screenShare.video = new _remoteMediaGroup.RemoteMediaGroup(this.mediaRequestManagers.screenShareVideo, [this.slots.screenShare.video], 255, false, {
|
|
823
|
+
resolution: this.currentLayout.screenShareVideo.size
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
this.mediaRequestManagers.screenShareVideo.commit();
|
|
827
|
+
}
|
|
858
828
|
|
|
829
|
+
/**
|
|
830
|
+
* Invalidates all remote media objects belonging to currently selected layout
|
|
831
|
+
*/
|
|
859
832
|
}, {
|
|
860
833
|
key: "invalidateCurrentRemoteMedia",
|
|
861
834
|
value: function invalidateCurrentRemoteMedia(options) {
|
|
862
835
|
var audio = options.audio,
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
836
|
+
video = options.video,
|
|
837
|
+
screenShareAudio = options.screenShareAudio,
|
|
838
|
+
screenShareVideo = options.screenShareVideo,
|
|
839
|
+
commit = options.commit;
|
|
866
840
|
if (audio && this.media.audio) {
|
|
867
841
|
this.media.audio.stop(commit);
|
|
868
842
|
}
|
|
869
|
-
|
|
870
843
|
if (video) {
|
|
871
844
|
(0, _values.default)(this.media.video.activeSpeakerGroups).forEach(function (remoteMediaGroup) {
|
|
872
845
|
remoteMediaGroup.stop(false);
|
|
@@ -874,21 +847,28 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
874
847
|
(0, _values.default)(this.media.video.memberPanes).forEach(function (remoteMedia) {
|
|
875
848
|
remoteMedia.stop(false);
|
|
876
849
|
});
|
|
877
|
-
|
|
878
850
|
if (commit) {
|
|
879
851
|
this.mediaRequestManagers.video.commit();
|
|
880
852
|
}
|
|
881
853
|
}
|
|
854
|
+
if (screenShareAudio && this.media.screenShare.audio) {
|
|
855
|
+
this.media.screenShare.audio.stop(commit);
|
|
856
|
+
}
|
|
857
|
+
if (screenShareVideo && this.media.screenShare.video) {
|
|
858
|
+
this.media.screenShare.video.stop(commit);
|
|
859
|
+
}
|
|
882
860
|
}
|
|
883
|
-
/** emits Event.VideoLayoutChanged */
|
|
884
861
|
|
|
862
|
+
/** emits Event.VideoLayoutChanged */
|
|
885
863
|
}, {
|
|
886
864
|
key: "emitVideoLayoutChangedEvent",
|
|
887
865
|
value: function emitVideoLayoutChangedEvent() {
|
|
866
|
+
var _this$media$screenSha;
|
|
888
867
|
// 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
|
|
868
|
+
// wait for our media requests to be fulfilled, but there is no API for that right now (we could wait for source updates
|
|
890
869
|
// but in some cases they might never come, or would need to always make sure to use a new set of receiver slots)
|
|
891
870
|
// for now it's fine to have it like this, we will re-evaluate if it needs improving after more testing
|
|
871
|
+
|
|
892
872
|
this.emit({
|
|
893
873
|
file: 'multistream/remoteMediaManager',
|
|
894
874
|
function: 'emitVideoLayoutChangedEvent'
|
|
@@ -896,30 +876,29 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
896
876
|
layoutId: this.currentLayoutId,
|
|
897
877
|
activeSpeakerVideoPanes: this.media.video.activeSpeakerGroups,
|
|
898
878
|
memberVideoPanes: this.media.video.memberPanes,
|
|
899
|
-
screenShareVideo:
|
|
900
|
-
|
|
879
|
+
screenShareVideo: (_this$media$screenSha = this.media.screenShare.video) === null || _this$media$screenSha === void 0 ? void 0 : _this$media$screenSha.getRemoteMedia()[0]
|
|
901
880
|
});
|
|
902
881
|
}
|
|
882
|
+
|
|
903
883
|
/**
|
|
904
884
|
* Sets a new CSI on a given remote media object
|
|
905
885
|
*
|
|
906
886
|
* @param {RemoteMedia} remoteMedia remote Media object to modify
|
|
907
887
|
* @param {CSI} csi new CSI value, can be null if we want to stop receiving media
|
|
908
888
|
*/
|
|
909
|
-
|
|
910
889
|
}, {
|
|
911
890
|
key: "setRemoteVideoCsi",
|
|
912
891
|
value: function setRemoteVideoCsi(remoteMedia, csi) {
|
|
913
892
|
if (!(0, _values.default)(this.media.video.memberPanes).includes(remoteMedia)) {
|
|
914
893
|
throw new Error('remoteMedia not found');
|
|
915
894
|
}
|
|
916
|
-
|
|
917
895
|
if (csi) {
|
|
918
896
|
remoteMedia.sendMediaRequest(csi, true);
|
|
919
897
|
} else {
|
|
920
898
|
remoteMedia.cancelMediaRequest(true);
|
|
921
899
|
}
|
|
922
900
|
}
|
|
901
|
+
|
|
923
902
|
/**
|
|
924
903
|
* Adds a new member video pane to the currently selected layout.
|
|
925
904
|
*
|
|
@@ -928,68 +907,53 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
928
907
|
* @param {MemberVideoPane} newPane
|
|
929
908
|
* @returns {Promise<RemoteMedia>}
|
|
930
909
|
*/
|
|
931
|
-
|
|
932
910
|
}, {
|
|
933
911
|
key: "addMemberVideoPane",
|
|
934
912
|
value: function () {
|
|
935
|
-
var _addMemberVideoPane = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
936
|
-
var _this$
|
|
937
|
-
|
|
913
|
+
var _addMemberVideoPane = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(newPane) {
|
|
914
|
+
var _this$currentLayout5;
|
|
938
915
|
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
|
-
}
|
|
916
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
917
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
918
|
+
case 0:
|
|
919
|
+
if (this.currentLayout) {
|
|
920
|
+
_context7.next = 2;
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
throw new Error('There is no current layout selected, call start() first');
|
|
924
|
+
case 2:
|
|
925
|
+
if (!((_this$currentLayout5 = this.currentLayout) !== null && _this$currentLayout5 !== void 0 && _this$currentLayout5.memberVideoPanes)) {
|
|
926
|
+
this.currentLayout.memberVideoPanes = [];
|
|
927
|
+
}
|
|
928
|
+
if (!(newPane.id in this.currentLayout.memberVideoPanes)) {
|
|
929
|
+
_context7.next = 5;
|
|
930
|
+
break;
|
|
931
|
+
}
|
|
932
|
+
throw new Error("duplicate pane id ".concat(newPane.id, " - this pane already exists in current layout's memberVideoPanes"));
|
|
933
|
+
case 5:
|
|
934
|
+
this.currentLayout.memberVideoPanes.push(newPane);
|
|
935
|
+
_context7.next = 8;
|
|
936
|
+
return this.receiveSlotManager.allocateSlot(_internalMediaCore.MediaType.VideoMain);
|
|
937
|
+
case 8:
|
|
938
|
+
receiveSlot = _context7.sent;
|
|
939
|
+
this.slots.video.receiverSelected.push(receiveSlot);
|
|
940
|
+
remoteMedia = new _remoteMedia.RemoteMedia(receiveSlot, this.mediaRequestManagers.video, {
|
|
941
|
+
resolution: newPane.size
|
|
942
|
+
});
|
|
943
|
+
if (newPane.csi) {
|
|
944
|
+
remoteMedia.sendMediaRequest(newPane.csi, true);
|
|
945
|
+
}
|
|
946
|
+
this.media.video.memberPanes[newPane.id] = remoteMedia;
|
|
947
|
+
return _context7.abrupt("return", remoteMedia);
|
|
948
|
+
case 14:
|
|
949
|
+
case "end":
|
|
950
|
+
return _context7.stop();
|
|
985
951
|
}
|
|
986
|
-
},
|
|
952
|
+
}, _callee7, this);
|
|
987
953
|
}));
|
|
988
|
-
|
|
989
954
|
function addMemberVideoPane(_x2) {
|
|
990
955
|
return _addMemberVideoPane.apply(this, arguments);
|
|
991
956
|
}
|
|
992
|
-
|
|
993
957
|
return addMemberVideoPane;
|
|
994
958
|
}()
|
|
995
959
|
/**
|
|
@@ -1000,49 +964,40 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
1000
964
|
* @param {PaneId} paneId pane id of the pane to remove
|
|
1001
965
|
* @returns {Promise<void>}
|
|
1002
966
|
*/
|
|
1003
|
-
|
|
1004
967
|
}, {
|
|
1005
968
|
key: "removeMemberVideoPane",
|
|
1006
969
|
value: function removeMemberVideoPane(paneId) {
|
|
1007
970
|
var _this$currentLayout$m2, _this$currentLayout$m3;
|
|
1008
|
-
|
|
1009
971
|
if (!this.currentLayout) {
|
|
1010
972
|
return _promise.default.reject(new Error('There is no current layout selected, call start() first'));
|
|
1011
973
|
}
|
|
1012
|
-
|
|
1013
974
|
if (!((_this$currentLayout$m2 = this.currentLayout.memberVideoPanes) !== null && _this$currentLayout$m2 !== void 0 && _this$currentLayout$m2.find(function (pane) {
|
|
1014
975
|
return pane.id === paneId;
|
|
1015
976
|
}))) {
|
|
1016
977
|
// pane id doesn't exist, so nothing to do
|
|
1017
978
|
_loggerProxy.default.logger.log("RemoteMediaManager#removeMemberVideoPane --> removeMemberVideoPane() called for a non-existent paneId: ".concat(paneId, " (pane not found in currentLayout.memberVideoPanes)"));
|
|
1018
|
-
|
|
1019
979
|
return _promise.default.resolve();
|
|
1020
980
|
}
|
|
1021
|
-
|
|
1022
981
|
if (!this.media.video.memberPanes[paneId]) {
|
|
1023
982
|
// pane id doesn't exist, so nothing to do
|
|
1024
983
|
_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
984
|
return _promise.default.resolve();
|
|
1027
985
|
}
|
|
1028
|
-
|
|
1029
986
|
var remoteMedia = this.media.video.memberPanes[paneId];
|
|
1030
987
|
var receiveSlot = remoteMedia.getUnderlyingReceiveSlot();
|
|
1031
|
-
|
|
1032
988
|
if (receiveSlot) {
|
|
1033
989
|
this.receiveSlotManager.releaseSlot(receiveSlot);
|
|
1034
990
|
var index = this.slots.video.receiverSelected.indexOf(receiveSlot);
|
|
1035
|
-
|
|
1036
991
|
if (index >= 0) {
|
|
1037
992
|
this.slots.video.receiverSelected.splice(index, 1);
|
|
1038
993
|
}
|
|
1039
994
|
}
|
|
1040
|
-
|
|
1041
995
|
remoteMedia.stop();
|
|
1042
996
|
delete this.media.video.memberPanes[paneId];
|
|
1043
997
|
(_this$currentLayout$m3 = this.currentLayout.memberVideoPanes) === null || _this$currentLayout$m3 === void 0 ? true : delete _this$currentLayout$m3[paneId];
|
|
1044
998
|
return _promise.default.resolve();
|
|
1045
999
|
}
|
|
1000
|
+
|
|
1046
1001
|
/**
|
|
1047
1002
|
* Pins an active speaker remote media object to the given CSI value. From that moment
|
|
1048
1003
|
* onwards the remote media will only play audio/video from that specific CSI until
|
|
@@ -1051,39 +1006,35 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
1051
1006
|
* @param {RemoteMedia} remoteMedia remote media object reference
|
|
1052
1007
|
* @param {CSI} csi CSI value to pin to, if undefined, then current CSI value is used
|
|
1053
1008
|
*/
|
|
1054
|
-
|
|
1055
1009
|
}, {
|
|
1056
1010
|
key: "pinActiveSpeakerVideoPane",
|
|
1057
1011
|
value: function pinActiveSpeakerVideoPane(remoteMedia, csi) {
|
|
1058
1012
|
var remoteMediaGroup = (0, _values.default)(this.media.video.activeSpeakerGroups).find(function (group) {
|
|
1059
1013
|
return group.includes(remoteMedia, 'unpinned');
|
|
1060
1014
|
});
|
|
1061
|
-
|
|
1062
1015
|
if (!remoteMediaGroup) {
|
|
1063
1016
|
throw new Error('remoteMedia not found among the unpinned remote media from any active speaker group');
|
|
1064
1017
|
}
|
|
1065
|
-
|
|
1066
1018
|
remoteMediaGroup.pin(remoteMedia, csi);
|
|
1067
1019
|
}
|
|
1020
|
+
|
|
1068
1021
|
/**
|
|
1069
1022
|
* Unpins a remote media object from the fixed CSI value it was pinned to.
|
|
1070
1023
|
*
|
|
1071
1024
|
* @param {RemoteMedia} remoteMedia remote media object reference
|
|
1072
1025
|
*/
|
|
1073
|
-
|
|
1074
1026
|
}, {
|
|
1075
1027
|
key: "unpinActiveSpeakerVideoPane",
|
|
1076
1028
|
value: function unpinActiveSpeakerVideoPane(remoteMedia) {
|
|
1077
1029
|
var remoteMediaGroup = (0, _values.default)(this.media.video.activeSpeakerGroups).find(function (group) {
|
|
1078
1030
|
return group.includes(remoteMedia, 'pinned');
|
|
1079
1031
|
});
|
|
1080
|
-
|
|
1081
1032
|
if (!remoteMediaGroup) {
|
|
1082
1033
|
throw new Error('remoteMedia not found among the pinned remote media from any active speaker group');
|
|
1083
1034
|
}
|
|
1084
|
-
|
|
1085
1035
|
remoteMediaGroup.unpin(remoteMedia);
|
|
1086
1036
|
}
|
|
1037
|
+
|
|
1087
1038
|
/**
|
|
1088
1039
|
* Returns true if a given remote media object belongs to an active speaker group and has been pinned.
|
|
1089
1040
|
* Throws an error if the remote media object doesn't belong to any active speaker remote media group.
|
|
@@ -1091,23 +1042,19 @@ var RemoteMediaManager = /*#__PURE__*/function (_EventsScope) {
|
|
|
1091
1042
|
* @param {RemoteMedia} remoteMedia remote media object
|
|
1092
1043
|
* @returns {boolean}
|
|
1093
1044
|
*/
|
|
1094
|
-
|
|
1095
1045
|
}, {
|
|
1096
1046
|
key: "isPinned",
|
|
1097
1047
|
value: function isPinned(remoteMedia) {
|
|
1098
1048
|
var remoteMediaGroup = (0, _values.default)(this.media.video.activeSpeakerGroups).find(function (group) {
|
|
1099
1049
|
return group.includes(remoteMedia);
|
|
1100
1050
|
});
|
|
1101
|
-
|
|
1102
1051
|
if (!remoteMediaGroup) {
|
|
1103
1052
|
throw new Error('remoteMedia not found among any remote media (pinned or unpinned) from any active speaker group');
|
|
1104
1053
|
}
|
|
1105
|
-
|
|
1106
1054
|
return remoteMediaGroup.isPinned(remoteMedia);
|
|
1107
1055
|
}
|
|
1108
1056
|
}]);
|
|
1109
1057
|
return RemoteMediaManager;
|
|
1110
1058
|
}(_eventsScope.default);
|
|
1111
|
-
|
|
1112
1059
|
exports.RemoteMediaManager = RemoteMediaManager;
|
|
1113
1060
|
//# sourceMappingURL=remoteMediaManager.js.map
|