fcr-ui-scene 3.4.5 → 3.5.1
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/lib/base.js +4 -1
- package/lib/creator.d.ts +4 -1
- package/lib/creator.js +66 -3
- package/lib/electron/app.js +0 -3
- package/lib/electron/bootstrap-dev.js +2 -0
- package/lib/electron/bootstrap-sdk.js +2 -0
- package/lib/electron/main.js +14 -3
- package/lib/electron/plugins/devtool-shortcut.js +5 -0
- package/lib/electron/plugins/screenshot.js +4 -1
- package/lib/modules/action-bar/components/apps/app-item/index.css +3 -3
- package/lib/modules/action-bar/components/apps/app-item/index.js +35 -24
- package/lib/modules/action-bar/components/apps/app-list.d.ts +3 -0
- package/lib/modules/action-bar/components/apps/app-list.js +45 -0
- package/lib/modules/action-bar/components/apps/index.css +1 -0
- package/lib/modules/action-bar/components/apps/index.js +7 -4
- package/lib/modules/action-bar/components/apps/useAppItemOptions.d.ts +10 -2
- package/lib/modules/action-bar/components/apps/useAppItemOptions.js +10 -6
- package/lib/modules/action-bar/components/apps/useBeautyBackground.d.ts +1 -1
- package/lib/modules/action-bar/components/apps/useBeautyBackground.js +2 -2
- package/lib/modules/action-bar/components/apps/useInterpreter.d.ts +1 -1
- package/lib/modules/action-bar/components/apps/useInterpreter.js +6 -6
- package/lib/modules/action-bar/components/apps/useLiveStreaming.d.ts +1 -1
- package/lib/modules/action-bar/components/apps/useLiveStreaming.js +2 -2
- package/lib/modules/action-bar/components/apps/useWidgetList.d.ts +10 -0
- package/lib/modules/action-bar/components/apps/useWidgetList.js +38 -0
- package/lib/modules/action-bar/components/chat/index.css +8 -0
- package/lib/modules/action-bar/components/chat/index.js +2 -1
- package/lib/modules/action-bar/components/collapse/index.d.ts +8 -6
- package/lib/modules/action-bar/components/collapse/index.js +60 -74
- package/lib/modules/action-bar/components/interpreter/index.js +3 -3
- package/lib/modules/action-bar/components/item/index.js +1 -1
- package/lib/modules/action-bar/components/more/index.js +13 -7
- package/lib/modules/action-bar/components/notification-bar/index.d.ts +1 -1
- package/lib/modules/action-bar/components/notification-bar/index.js +13 -6
- package/lib/modules/action-bar/components/participants/index.js +1 -1
- package/lib/modules/action-bar/components/screen-share/index.js +1 -1
- package/lib/modules/action-bar/components/screen-share/submenu.js +55 -18
- package/lib/modules/action-bar/components/security/index.js +8 -2
- package/lib/modules/action-bar/components/trigger-output-language/index.js +68 -55
- package/lib/modules/action-bar/components/trigger-subscribe-language/index.js +35 -18
- package/lib/modules/action-bar/index.css +8 -0
- package/lib/modules/action-bar/index.d.ts +8 -0
- package/lib/modules/action-bar/index.js +6 -3
- package/lib/modules/action-bar/store.d.ts +37 -22
- package/lib/modules/action-bar/store.js +275 -375
- package/lib/modules/action-bar/types.d.ts +8 -13
- package/lib/modules/action-bar/view.js +3 -8
- package/lib/modules/audio-stream/index.d.ts +6 -1
- package/lib/modules/audio-stream/index.js +77 -11
- package/lib/modules/chat/chat-room-store.d.ts +4 -7
- package/lib/modules/chat/chat-room-store.js +39 -62
- package/lib/modules/chat/components/chat-action/index.js +2 -2
- package/lib/modules/chat/components/chat-bar/index.css +4 -0
- package/lib/modules/chat/components/chat-bar/index.d.ts +1 -1
- package/lib/modules/chat/components/chat-bar/index.js +18 -16
- package/lib/modules/chat/components/chat-select/index.js +16 -147
- package/lib/modules/chat/components/chat-select/select-input/index.d.ts +7 -0
- package/lib/modules/chat/components/chat-select/select-input/index.js +35 -0
- package/lib/modules/chat/components/chat-select/select-item/index.d.ts +12 -0
- package/lib/modules/chat/components/chat-select/select-item/index.js +153 -0
- package/lib/modules/chat/components/chat-tabs/index.d.ts +2 -0
- package/lib/modules/chat/components/chat-tabs/index.js +61 -0
- package/lib/modules/chat/components/message-list/chat-empty/index.d.ts +2 -0
- package/lib/modules/chat/components/message-list/chat-empty/index.js +26 -0
- package/lib/modules/chat/components/message-list/history-unread-message-button/index.d.ts +7 -0
- package/lib/modules/chat/components/message-list/history-unread-message-button/index.js +55 -0
- package/lib/modules/chat/components/message-list/index.d.ts +1 -1
- package/lib/modules/chat/components/message-list/index.js +55 -359
- package/lib/modules/chat/components/message-list/message-item/index.d.ts +15 -0
- package/lib/modules/chat/components/message-list/message-item/index.js +309 -0
- package/lib/modules/chat/components/message-list/scroll-bottom-button/index.d.ts +9 -0
- package/lib/modules/chat/components/message-list/scroll-bottom-button/index.js +67 -0
- package/lib/modules/chat/index.css +9 -0
- package/lib/modules/chat/index.d.ts +6 -0
- package/lib/modules/chat/index.js +4 -1
- package/lib/modules/chat/store.d.ts +17 -7
- package/lib/modules/chat/store.js +75 -72
- package/lib/modules/chat/types.d.ts +7 -7
- package/lib/modules/chat/types.js +2 -1
- package/lib/modules/chat/view.js +22 -102
- package/lib/modules/components/device-control/store.d.ts +4 -3
- package/lib/modules/components/device-control/store.js +13 -24
- package/lib/modules/components/leave-meeting/components/assign-host.js +17 -2
- package/lib/modules/components/leave-meeting/index.js +8 -7
- package/lib/modules/components/leave-meeting/store.d.ts +15 -7
- package/lib/modules/components/leave-meeting/store.js +116 -95
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.d.ts +6 -0
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.js +36 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +40 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +170 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.d.ts +11 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +105 -0
- package/lib/modules/components/member-window/components/member-actions/components/layout/index.d.ts +9 -0
- package/lib/modules/components/member-window/components/member-actions/components/layout/index.js +42 -0
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +11 -0
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +157 -0
- package/lib/modules/components/member-window/components/member-actions/components/share-status.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-actions/components/share-status.js +34 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-info.d.ts +16 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-info.js +130 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.d.ts +12 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.js +57 -0
- package/lib/modules/components/member-window/components/member-actions/index.d.ts +3 -0
- package/lib/modules/components/member-window/components/member-actions/index.js +122 -0
- package/lib/modules/components/member-window/components/member-actions/libs/index.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-actions/libs/index.js +24 -0
- package/lib/modules/components/member-window/components/member-actions/provider.d.ts +21 -0
- package/lib/modules/components/member-window/components/member-actions/provider.js +77 -0
- package/lib/modules/components/member-window/components/member-actions/store.d.ts +48 -0
- package/lib/modules/components/member-window/components/member-actions/store.js +307 -0
- package/lib/modules/components/member-window/components/member-board.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-board.js +63 -0
- package/lib/modules/components/member-window/components/mic-volume.d.ts +2 -0
- package/lib/modules/components/member-window/components/mic-volume.js +23 -0
- package/lib/modules/components/member-window/components/video-player/components/local-video-player.d.ts +4 -0
- package/lib/modules/components/member-window/components/video-player/components/local-video-player.js +40 -0
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.d.ts +8 -0
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.js +62 -0
- package/lib/modules/components/member-window/components/video-player/index.d.ts +9 -0
- package/lib/modules/components/member-window/components/video-player/index.js +38 -0
- package/lib/modules/components/member-window/index.css +22 -2
- package/lib/modules/components/member-window/index.d.ts +10 -75
- package/lib/modules/components/member-window/index.js +20 -738
- package/lib/modules/components/member-window/types.d.ts +79 -0
- package/lib/modules/components/member-window/types.js +6 -0
- package/lib/modules/components/security-menu/index.css +0 -2
- package/lib/modules/components/security-menu/index.d.ts +5 -1
- package/lib/modules/components/security-menu/index.js +37 -59
- package/lib/modules/connection-gateway/index.d.ts +6 -0
- package/lib/modules/connection-gateway/index.js +4 -1
- package/lib/modules/connection-gateway/store.d.ts +12 -3
- package/lib/modules/connection-gateway/store.js +29 -27
- package/lib/modules/control-bar/components/meeting-details/index.js +11 -17
- package/lib/modules/control-bar/components/more-actions/index.js +5 -4
- package/lib/modules/control-bar/components/share-state-nav/index.js +22 -10
- package/lib/modules/control-bar/index.css +1 -2
- package/lib/modules/control-bar/index.d.ts +14 -0
- package/lib/modules/control-bar/index.js +10 -4
- package/lib/modules/control-bar/store.d.ts +40 -20
- package/lib/modules/control-bar/store.js +156 -191
- package/lib/modules/control-bar/view.js +65 -25
- package/lib/modules/device-pretest/audio-preview/microphone-detection.js +1 -1
- package/lib/modules/dialog/components/control-bar/index.d.ts +1 -1
- package/lib/modules/dialog/components/control-bar/index.js +43 -43
- package/lib/modules/dialog/components/device-setting/index.js +2 -1
- package/lib/modules/dialog/components/dialog-container/component/body.d.ts +1 -0
- package/lib/modules/dialog/components/dialog-container/component/body.js +3 -2
- package/lib/modules/dialog/components/dialog-container/index.d.ts +2 -0
- package/lib/modules/dialog/components/dialog-container/index.js +19 -13
- package/lib/modules/dialog/components/live-streaming/index.js +4 -2
- package/lib/modules/dialog/components/participant/index.js +2 -2
- package/lib/modules/dialog/components/share-screen-selection/index.js +3 -1
- package/lib/modules/dialog/components/system-preference/assets/bg1.png +0 -0
- package/lib/modules/dialog/components/system-preference/assets/bg2.png +0 -0
- package/lib/modules/dialog/components/system-preference/assets/fcr_png_host.png +0 -0
- package/lib/modules/dialog/components/system-preference/electron.js +6 -6
- package/lib/modules/dialog/components/system-preference/index.css +3 -0
- package/lib/modules/dialog/components/system-preference/index.d.ts +17 -2
- package/lib/modules/dialog/components/system-preference/index.js +47 -55
- package/lib/modules/dialog/components/video-window/index.d.ts +1 -1
- package/lib/modules/dialog/components/video-window/index.js +216 -101
- package/lib/modules/dialog/components/widget/electron.d.ts +5 -0
- package/lib/modules/dialog/components/widget/electron.js +37 -0
- package/lib/modules/dialog/components/widget/index.d.ts +6 -0
- package/lib/modules/dialog/components/widget/index.js +43 -0
- package/lib/modules/dialog/hooks/useElectron.d.ts +7 -0
- package/lib/modules/dialog/hooks/useElectron.js +226 -28
- package/lib/modules/dialog/index.css +1 -11
- package/lib/modules/dialog/index.d.ts +9 -6
- package/lib/modules/dialog/index.js +12 -12
- package/lib/modules/dialog/store.d.ts +26 -10
- package/lib/modules/dialog/store.js +151 -82
- package/lib/modules/dialog/type.d.ts +84 -0
- package/lib/modules/dialog/type.js +6 -0
- package/lib/modules/dialog/view.d.ts +1 -4
- package/lib/modules/dialog/view.js +12 -9
- package/lib/modules/event-confirm/index.css +11 -0
- package/lib/modules/event-confirm/index.d.ts +6 -0
- package/lib/modules/event-confirm/index.js +3 -2
- package/lib/modules/event-confirm/store.d.ts +10 -4
- package/lib/modules/event-confirm/store.js +91 -32
- package/lib/modules/event-confirm/view.js +63 -24
- package/lib/modules/event-toast/store.js +4 -2
- package/lib/modules/interpreter/action/edit-btn/index.js +5 -5
- package/lib/modules/interpreter/action/switch-btn/index.js +7 -7
- package/lib/modules/interpreter/index.d.ts +5 -1
- package/lib/modules/interpreter/index.js +4 -2
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-language/index.js +3 -3
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +6 -5
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/option-Item.js +2 -2
- package/lib/modules/interpreter/interpreter-list/interpreter-item/index.js +2 -2
- package/lib/modules/interpreter/store.d.ts +8 -5
- package/lib/modules/interpreter/store.js +90 -39
- package/lib/modules/interpreter/type.d.ts +5 -1
- package/lib/modules/interpreter/utils.d.ts +0 -1
- package/lib/modules/interpreter/utils.js +2 -23
- package/lib/modules/interpreter/view.js +2 -6
- package/lib/modules/invite/index.d.ts +4 -0
- package/lib/modules/invite/index.js +3 -1
- package/lib/modules/invite/store.d.ts +11 -2
- package/lib/modules/invite/store.js +27 -4
- package/lib/modules/layout/components/Aside.js +1 -1
- package/lib/modules/layout/components/Carousel.js +36 -14
- package/lib/modules/layout/components/Gallery.js +33 -11
- package/lib/modules/layout/index.css +2 -2
- package/lib/modules/layout/index.d.ts +6 -0
- package/lib/modules/layout/index.js +4 -1
- package/lib/modules/layout/store.d.ts +23 -10
- package/lib/modules/layout/store.js +185 -163
- package/lib/modules/layout/type.d.ts +2 -0
- package/lib/modules/live-streaming/index.d.ts +2 -0
- package/lib/modules/live-streaming/index.js +2 -2
- package/lib/modules/live-streaming/store.d.ts +4 -8
- package/lib/modules/live-streaming/store.js +9 -19
- package/lib/modules/notification/index.css +17 -0
- package/lib/modules/notification/store.js +4 -2
- package/lib/modules/notification/view.js +7 -2
- package/lib/modules/offscreen-pulling/index.d.ts +1 -0
- package/lib/modules/offscreen-pulling/index.js +4 -0
- package/lib/modules/participant/components/confirm-input/index.d.ts +6 -0
- package/lib/modules/participant/components/confirm-input/index.js +50 -0
- package/lib/modules/participant/components/mute-all/index.d.ts +3 -7
- package/lib/modules/participant/components/mute-all/index.js +21 -33
- package/lib/modules/participant/components/participants/components/footer/components/buttons.d.ts +6 -0
- package/lib/modules/participant/components/participants/components/footer/components/buttons.js +52 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.css +60 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.js +166 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/util.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/util.js +28 -0
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.css +13 -0
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.js +242 -0
- package/lib/modules/participant/components/participants/components/footer/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/footer/index.js +48 -0
- package/lib/modules/participant/components/participants/components/merge/index.d.ts +11 -0
- package/lib/modules/participant/components/participants/components/merge/index.js +49 -0
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.css +191 -0
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.d.ts +4 -0
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.js +204 -0
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.css +49 -0
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.js +219 -0
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.js +70 -0
- package/lib/modules/participant/components/participants/components/participants/index.css +104 -0
- package/lib/modules/participant/components/participants/components/participants/index.d.ts +3 -0
- package/lib/modules/participant/components/participants/components/participants/index.js +110 -0
- package/lib/modules/participant/components/participants/components/render-tab/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/components/render-tab/index.js +49 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/interpreter-tag/index.d.ts +3 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/interpreter-tag/index.js +48 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/microphone-indicator/index.d.ts +6 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/microphone-indicator/index.js +28 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/user-avatar/index.d.ts +7 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/user-avatar/index.js +39 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.css +69 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.js +135 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/audio-button/index.d.ts +7 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/audio-button/index.js +31 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.d.ts +12 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.js +82 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-to-mainroom-button/index.d.ts +4 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-to-mainroom-button/index.js +26 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/index.js +75 -0
- package/lib/modules/participant/components/participants/components/render-user/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/render-user/index.js +21 -0
- package/lib/modules/participant/components/participants/index.js +18 -112
- package/lib/modules/participant/components/participants/types.d.ts +96 -0
- package/lib/modules/participant/components/participants/types.js +37 -0
- package/lib/modules/participant/index.css +3 -0
- package/lib/modules/participant/index.d.ts +12 -0
- package/lib/modules/participant/index.js +7 -1
- package/lib/modules/participant/member-list-data-source.d.ts +2 -2
- package/lib/modules/participant/member-list-data-source.js +11 -17
- package/lib/modules/participant/store.d.ts +44 -37
- package/lib/modules/participant/store.js +527 -536
- package/lib/modules/participant/type.d.ts +2 -9
- package/lib/modules/pc-audio-connect/store.d.ts +1 -1
- package/lib/modules/pc-audio-connect/store.js +9 -6
- package/lib/modules/setting/audio-settings/audio-settings.js +5 -4
- package/lib/modules/setting/audio-settings/index.css +11 -2
- package/lib/modules/setting/config.js +1 -1
- package/lib/modules/setting/store.d.ts +1 -0
- package/lib/modules/setting/store.js +20 -2
- package/lib/modules/setting/video-settings/index.css +12 -17
- package/lib/modules/setting/video-settings/video-settings-basic.js +40 -44
- package/lib/modules/share-screen/components/selection/index.js +70 -80
- package/lib/modules/share-screen/index.d.ts +6 -1
- package/lib/modules/share-screen/index.js +4 -1
- package/lib/modules/share-screen/store.d.ts +37 -33
- package/lib/modules/share-screen/store.js +330 -438
- package/lib/modules/sound-effect/sound-effect-player.d.ts +0 -4
- package/lib/modules/sound-effect/sound-effect-player.js +4 -4
- package/lib/modules/state-bar/index.css +2 -15
- package/lib/modules/state-bar/index.d.ts +10 -0
- package/lib/modules/state-bar/index.js +6 -1
- package/lib/modules/state-bar/live-streaming-state.js +0 -17
- package/lib/modules/state-bar/meeting-details.js +12 -24
- package/lib/modules/state-bar/meeting-time.js +5 -10
- package/lib/modules/state-bar/store.d.ts +31 -8
- package/lib/modules/state-bar/store.js +146 -100
- package/lib/modules/state-bar/view.js +63 -32
- package/lib/modules/video-window/components/deviceState/index.d.ts +7 -0
- package/lib/modules/video-window/components/deviceState/index.js +75 -0
- package/lib/modules/video-window/components/members/index.css +51 -0
- package/lib/modules/video-window/components/members/index.d.ts +2 -0
- package/lib/modules/video-window/components/members/index.js +131 -0
- package/lib/modules/video-window/components/speaking/index.css +86 -0
- package/lib/modules/video-window/components/speaking/index.d.ts +3 -0
- package/lib/modules/video-window/components/speaking/index.js +48 -0
- package/lib/modules/video-window/components/topControl/index.css +35 -0
- package/lib/modules/video-window/components/topControl/index.d.ts +3 -0
- package/lib/modules/video-window/components/topControl/index.js +79 -0
- package/lib/modules/video-window/index.d.ts +7 -0
- package/lib/modules/video-window/index.js +14 -20
- package/lib/modules/video-window/store.d.ts +19 -88
- package/lib/modules/video-window/store.js +98 -365
- package/lib/modules/video-window/type.d.ts +40 -4
- package/lib/modules/video-window/type.js +4 -4
- package/lib/modules/video-window/view.js +11 -23
- package/lib/modules/whiteboard/index.d.ts +1 -0
- package/lib/modules/whiteboard/index.js +7 -4
- package/lib/modules/widget/index.css +17 -0
- package/lib/modules/widget/index.d.ts +10 -0
- package/lib/modules/widget/index.js +114 -0
- package/lib/modules/widget/sdk.d.ts +30 -0
- package/lib/modules/widget/sdk.js +224 -0
- package/lib/modules/widget/store.d.ts +14 -0
- package/lib/modules/widget/store.js +28 -0
- package/lib/modules/widget/type.d.ts +156 -0
- package/lib/modules/widget/type.js +6 -0
- package/lib/modules/widget/view.d.ts +2 -0
- package/lib/modules/widget/view.js +47 -0
- package/lib/modules/widget/web-widget.d.ts +29 -0
- package/lib/modules/widget/web-widget.js +234 -0
- package/lib/providers/ability-provider.d.ts +24 -0
- package/lib/providers/ability-provider.js +38 -0
- package/lib/providers/chat-provider.d.ts +16 -9
- package/lib/providers/chat-provider.js +76 -8
- package/lib/providers/device-privilege-provider.d.ts +5 -1
- package/lib/providers/device-privilege-provider.js +21 -1
- package/lib/providers/device-provider.js +5 -2
- package/lib/providers/device-stream-provider.d.ts +15 -3
- package/lib/providers/device-stream-provider.js +118 -34
- package/lib/providers/dialog-provider.d.ts +9 -8
- package/lib/providers/dialog-provider.js +8 -4
- package/lib/providers/event-provider.js +4 -2
- package/lib/providers/interpreter-provider.d.ts +7 -26
- package/lib/providers/interpreter-provider.js +473 -706
- package/lib/providers/local-storage-provider.d.ts +6 -1
- package/lib/providers/local-storage-provider.js +15 -2
- package/lib/providers/message-provider.js +4 -2
- package/lib/providers/phone-audio-provider.js +24 -18
- package/lib/providers/privilege-provider.d.ts +13 -12
- package/lib/providers/privilege-provider.js +19 -11
- package/lib/providers/renderer-provider.d.ts +5 -0
- package/lib/providers/renderer-provider.js +8 -1
- package/lib/providers/room-provider.d.ts +7 -17
- package/lib/providers/room-provider.js +113 -161
- package/lib/providers/screen-share-provider.d.ts +19 -0
- package/lib/providers/screen-share-provider.js +102 -10
- package/lib/providers/widget-provider.d.ts +52 -0
- package/lib/providers/widget-provider.js +171 -0
- package/lib/scenes/main-scene.d.ts +11 -0
- package/lib/scenes/main-scene.js +60 -33
- package/lib/scenes/waiting-scene.d.ts +9 -0
- package/lib/scenes/waiting-scene.js +27 -26
- package/lib/schema.d.ts +114 -0
- package/lib/schema.js +77 -0
- package/lib/shared-data-source/chat-data.d.ts +11 -0
- package/lib/shared-data-source/chat-data.js +17 -6
- package/lib/shared-data-source/interpreter.d.ts +34 -21
- package/lib/shared-data-source/interpreter.js +104 -103
- package/lib/shared-data-source/meeting-time.d.ts +68 -0
- package/lib/shared-data-source/meeting-time.js +299 -0
- package/lib/shared-data-source/member-data.d.ts +126 -0
- package/lib/shared-data-source/member-data.js +451 -0
- package/lib/shared-data-source/pin-data.d.ts +8 -4
- package/lib/shared-data-source/pin-data.js +92 -4
- package/lib/shared-data-source/security-data.d.ts +35 -0
- package/lib/shared-data-source/security-data.js +156 -0
- package/lib/shared-data-source/setting.d.ts +3 -1
- package/lib/shared-data-source/setting.js +12 -1
- package/lib/shared-data-source/video-window.d.ts +7 -8
- package/lib/shared-data-source/video-window.js +97 -94
- package/lib/shared-data-source/waiting-room.d.ts +29 -2
- package/lib/shared-data-source/waiting-room.js +103 -39
- package/lib/translations/enUS.d.ts +25 -12
- package/lib/translations/enUS.js +47 -68
- package/lib/translations/zhCN.d.ts +26 -12
- package/lib/translations/zhCN.js +63 -83
- package/lib/type.d.ts +64 -48
- package/lib/type.js +14 -1
- package/lib/ui-manager.d.ts +3 -2
- package/lib/ui-manager.js +8 -7
- package/lib/ui-scene.d.ts +7 -1
- package/lib/ui-scene.js +187 -97
- package/lib/utilities/constant.d.ts +7 -3
- package/lib/utilities/constant.js +4 -0
- package/lib/utilities/default-config.d.ts +5 -1
- package/lib/utilities/default-config.js +28 -2
- package/lib/utilities/logger.d.ts +8 -0
- package/lib/utilities/logger.js +42 -0
- package/lib/utilities/meeting-detail.js +11 -10
- package/lib/utilities/parameters.d.ts +4 -0
- package/lib/utilities/parameters.js +13 -1
- package/lib/utilities/renderer.d.ts +1 -0
- package/lib/utilities/renderer.js +4 -1
- package/lib/utilities/tools.d.ts +7 -6
- package/lib/utilities/tools.js +2 -6
- package/lib/utilities/validate-params.d.ts +2 -0
- package/lib/utilities/validate-params.js +16 -0
- package/lib/waiting-room-control-manager.d.ts +28 -0
- package/lib/waiting-room-control-manager.js +212 -0
- package/lib/widget-sdk.d.ts +2 -0
- package/lib/widget-sdk.js +13 -0
- package/package.json +7 -6
- package/public/index.html +12 -6
|
@@ -11,62 +11,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
11
11
|
value: true
|
|
12
12
|
});
|
|
13
13
|
exports.FcrUIInterpreterProviderImpl = void 0;
|
|
14
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
14
|
require("core-js/modules/es.array.concat.js");
|
|
16
15
|
require("core-js/modules/es.array.filter.js");
|
|
17
16
|
require("core-js/modules/es.array.find.js");
|
|
18
17
|
require("core-js/modules/es.array.for-each.js");
|
|
19
|
-
require("core-js/modules/es.array.from.js");
|
|
20
18
|
require("core-js/modules/es.array.includes.js");
|
|
21
|
-
require("core-js/modules/es.array.iterator.js");
|
|
22
19
|
require("core-js/modules/es.array.join.js");
|
|
23
|
-
require("core-js/modules/es.array.map.js");
|
|
24
20
|
require("core-js/modules/es.array.push.js");
|
|
25
21
|
require("core-js/modules/es.object.to-string.js");
|
|
26
|
-
require("core-js/modules/es.set.js");
|
|
27
22
|
require("core-js/modules/es.string.includes.js");
|
|
28
|
-
require("core-js/modules/es.string.iterator.js");
|
|
29
23
|
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
30
24
|
require("core-js/modules/esnext.async-iterator.find.js");
|
|
31
25
|
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
32
|
-
require("core-js/modules/esnext.async-iterator.map.js");
|
|
33
26
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
34
27
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
35
28
|
require("core-js/modules/esnext.iterator.find.js");
|
|
36
29
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
37
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
38
|
-
require("core-js/modules/esnext.set.add-all.js");
|
|
39
|
-
require("core-js/modules/esnext.set.delete-all.js");
|
|
40
|
-
require("core-js/modules/esnext.set.difference.v2.js");
|
|
41
|
-
require("core-js/modules/esnext.set.difference.js");
|
|
42
|
-
require("core-js/modules/esnext.set.every.js");
|
|
43
|
-
require("core-js/modules/esnext.set.filter.js");
|
|
44
|
-
require("core-js/modules/esnext.set.find.js");
|
|
45
|
-
require("core-js/modules/esnext.set.intersection.v2.js");
|
|
46
|
-
require("core-js/modules/esnext.set.intersection.js");
|
|
47
|
-
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
|
48
|
-
require("core-js/modules/esnext.set.is-disjoint-from.js");
|
|
49
|
-
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
|
50
|
-
require("core-js/modules/esnext.set.is-subset-of.js");
|
|
51
|
-
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
|
52
|
-
require("core-js/modules/esnext.set.is-superset-of.js");
|
|
53
|
-
require("core-js/modules/esnext.set.join.js");
|
|
54
|
-
require("core-js/modules/esnext.set.map.js");
|
|
55
|
-
require("core-js/modules/esnext.set.reduce.js");
|
|
56
|
-
require("core-js/modules/esnext.set.some.js");
|
|
57
|
-
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
|
58
|
-
require("core-js/modules/esnext.set.symmetric-difference.js");
|
|
59
|
-
require("core-js/modules/esnext.set.union.v2.js");
|
|
60
|
-
require("core-js/modules/esnext.set.union.js");
|
|
61
30
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
62
|
-
require("
|
|
63
|
-
require("core-js/modules/web.timers.js");
|
|
31
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
64
32
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
65
33
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
66
34
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
67
35
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
68
36
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
69
|
-
var _logger = require("agora-foundation/lib/logger");
|
|
70
37
|
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
71
38
|
var _base = require("../base");
|
|
72
39
|
var _fcrCore = require("fcr-core");
|
|
@@ -78,10 +45,10 @@ var _type3 = require("fcr-core/lib/type");
|
|
|
78
45
|
var _utils = require("../modules/interpreter/utils");
|
|
79
46
|
var _constant = require("../utilities/constant");
|
|
80
47
|
var _enums = require("../modules/action-bar/enums");
|
|
81
|
-
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
82
48
|
var _lodash = require("lodash");
|
|
49
|
+
var _logger = require("../utilities/logger");
|
|
83
50
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
84
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
51
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // import { FcrUIPrivilegeProvider } from './privilege-provider';
|
|
85
52
|
var getRoomJoinOptions = function getRoomJoinOptions(localUser) {
|
|
86
53
|
var roomJoinOptions = {
|
|
87
54
|
userName: localUser.userName,
|
|
@@ -106,48 +73,113 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
106
73
|
var _this = this;
|
|
107
74
|
(0, _classCallCheck2["default"])(this, FcrUIInterpreterProviderImpl);
|
|
108
75
|
// @internal
|
|
109
|
-
(0, _defineProperty2["default"])(this, "logger", (0, _logger.
|
|
76
|
+
(0, _defineProperty2["default"])(this, "logger", (0, _logger.createLogger)({
|
|
77
|
+
prefix: 'FcrUIInterpreterProviderImpl'
|
|
78
|
+
}));
|
|
110
79
|
(0, _defineProperty2["default"])(this, "_observable", new _observable.AgoraObservable());
|
|
111
|
-
|
|
112
|
-
(0, _defineProperty2["default"])(this, "_indicateTimerId", null);
|
|
113
|
-
(0, _defineProperty2["default"])(this, "_volumeTimerId", null);
|
|
114
|
-
(0, _defineProperty2["default"])(this, "_hasSubscribedLanguageList", new Set([_interpreter.ORIGIN]));
|
|
80
|
+
// private _hasSubscribedLanguageList = new Set<FcrUILanguage>([ORIGIN]);
|
|
115
81
|
(0, _defineProperty2["default"])(this, "_observerStream", {
|
|
116
82
|
onStreamVolumeIndicationUpdated: (0, _lodash.throttle)(function (roomId, streamId, volume) {
|
|
117
|
-
|
|
83
|
+
// HLD: 判断 volume > 10 ,避免波动, 则认为是在说话
|
|
84
|
+
var isSpeaking = Math.floor(volume / 255 * 100) > 10;
|
|
85
|
+
if (isSpeaking) {
|
|
86
|
+
// HLD: 主房输出音量设置为25,语言房间设置输出音频为100
|
|
87
|
+
_this._observable.notifyObservers('onSubscribeLanguageVolumePrioritized', isSpeaking);
|
|
88
|
+
} else {
|
|
89
|
+
// PRD: 参会人听到的是译员的声音及轻微的原始音频声音。当语言频道内 6 秒内没有译员发言,原始音频的音量将在接下来的 2 秒内逐渐放大到正常音量。
|
|
90
|
+
_this._observable.notifyObservers('onSubscribeLanguageVolumePrioritized', isSpeaking);
|
|
91
|
+
}
|
|
118
92
|
}, 500)
|
|
119
93
|
});
|
|
120
|
-
(0, _defineProperty2["default"])(this, "
|
|
121
|
-
|
|
122
|
-
_this
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
94
|
+
(0, _defineProperty2["default"])(this, "_publishEvent", {
|
|
95
|
+
onLocalBecomeInterpreter: function onLocalBecomeInterpreter() {
|
|
96
|
+
var _this$_sharedInterpre = _this._sharedInterpreterDataSource,
|
|
97
|
+
preLocalInterpreterUserInfo = _this$_sharedInterpre.preLocalInterpreterUserInfo,
|
|
98
|
+
localInterpreterUserInfo = _this$_sharedInterpre.localInterpreterUserInfo,
|
|
99
|
+
outputLanguage = _this$_sharedInterpre.outputLanguage,
|
|
100
|
+
supportedLanguages = _this$_sharedInterpre.supportedLanguages;
|
|
101
|
+
if (localInterpreterUserInfo && !preLocalInterpreterUserInfo && outputLanguage) {
|
|
102
|
+
_this._observable.notifyObservers('onLocalBecomeInterpreter', supportedLanguages, outputLanguage);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
onSubscribeLanguageListUpdated: function onSubscribeLanguageListUpdated() {
|
|
106
|
+
var state = _this.getInterpretationState();
|
|
107
|
+
if (state) {
|
|
108
|
+
var languageList = _this.getSubscribeLanguageList();
|
|
109
|
+
_this._observable.notifyObservers('onSubscribeLanguageListUpdated', languageList);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
onInterpretationEnabled: function onInterpretationEnabled(operatorUser) {
|
|
113
|
+
var interpreterList = _this.getInterpreterList();
|
|
114
|
+
var state = _this.getInterpretationState();
|
|
115
|
+
if (state && interpreterList && operatorUser) {
|
|
116
|
+
_this._observable.notifyObservers('onInterpretationEnabled', interpreterList, operatorUser);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
onInterpretationDisabled: function onInterpretationDisabled(operatorUser) {
|
|
120
|
+
var state = _this.getInterpretationState();
|
|
121
|
+
if (!state && operatorUser) {
|
|
122
|
+
_this._observable.notifyObservers('onInterpretationDisabled', operatorUser);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
onInterpreterListUpdated: function onInterpreterListUpdated(users, operatorUser) {
|
|
126
|
+
if (users && operatorUser) {
|
|
127
|
+
_this._observable.notifyObservers('onInterpreterListUpdated', users, operatorUser);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
onLocalNotInterpreter: function onLocalNotInterpreter() {
|
|
131
|
+
var _this$_sharedInterpre2 = _this._sharedInterpreterDataSource,
|
|
132
|
+
preLocalInterpreterUserInfo = _this$_sharedInterpre2.preLocalInterpreterUserInfo,
|
|
133
|
+
localInterpreterUserInfo = _this$_sharedInterpre2.localInterpreterUserInfo;
|
|
134
|
+
if (preLocalInterpreterUserInfo && !localInterpreterUserInfo) {
|
|
135
|
+
_this._observable.notifyObservers('onLocalNotInterpreter');
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
onLocalBecameInterpreter: function onLocalBecameInterpreter() {
|
|
139
|
+
var _this$_sharedInterpre3 = _this._sharedInterpreterDataSource,
|
|
140
|
+
localInterpreterUserInfo = _this$_sharedInterpre3.localInterpreterUserInfo,
|
|
141
|
+
supportedLanguages = _this$_sharedInterpre3.supportedLanguages;
|
|
142
|
+
if (localInterpreterUserInfo) {
|
|
143
|
+
var targetLanguage = localInterpreterUserInfo.targetLanguage;
|
|
144
|
+
_this._observable.notifyObservers('onLocalBecameInterpreter', supportedLanguages, targetLanguage);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
onLanguageUnsubscribed: function onLanguageUnsubscribed(language) {
|
|
148
|
+
_this._observable.notifyObservers('onLanguageUnsubscribed', language);
|
|
149
|
+
},
|
|
150
|
+
onLanguageSubscribed: function onLanguageSubscribed(language) {
|
|
151
|
+
_this._observable.notifyObservers('onLanguageSubscribed', language);
|
|
152
|
+
},
|
|
153
|
+
onLocalInterpreterWillUpdate: function onLocalInterpreterWillUpdate(language) {
|
|
154
|
+
var isSupportedLanguagesUpdate = _this._sharedInterpreterDataSource.isSupportedLanguagesUpdate;
|
|
155
|
+
if (isSupportedLanguagesUpdate) {
|
|
156
|
+
_this._observable.notifyObservers('onLocalInterpreterWillUpdate', language);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
onLocalInterpreterUpdated: function onLocalInterpreterUpdated() {
|
|
160
|
+
var _this$_sharedInterpre4 = _this._sharedInterpreterDataSource,
|
|
161
|
+
isSupportedLanguagesUpdate = _this$_sharedInterpre4.isSupportedLanguagesUpdate,
|
|
162
|
+
supportedLanguages = _this$_sharedInterpre4.supportedLanguages,
|
|
163
|
+
outputLanguage = _this$_sharedInterpre4.outputLanguage;
|
|
164
|
+
if (isSupportedLanguagesUpdate && outputLanguage) {
|
|
165
|
+
_this._observable.notifyObservers('onLocalInterpreterUpdated', supportedLanguages, outputLanguage);
|
|
166
|
+
}
|
|
127
167
|
}
|
|
128
168
|
});
|
|
129
169
|
(0, _defineProperty2["default"])(this, "_observerInterpreter", {
|
|
130
170
|
onInterpreterStateUpdated: function () {
|
|
131
171
|
var _onInterpreterStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(roomId, state, operatorUser) {
|
|
132
|
-
var interpreterList, languageList;
|
|
133
172
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
134
173
|
while (1) switch (_context.prev = _context.next) {
|
|
135
174
|
case 0:
|
|
136
175
|
_context.next = 2;
|
|
137
|
-
return _this.
|
|
176
|
+
return _this._refresh(operatorUser);
|
|
138
177
|
case 2:
|
|
139
|
-
_this._publishEvent();
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
languageList = _this.getSubscribeLanguageList();
|
|
146
|
-
_this._observable.notifyObservers('onSubscribeLanguageListUpdated', languageList);
|
|
147
|
-
} else {
|
|
148
|
-
_this._observable.notifyObservers('onInterpretationDisabled', operatorUser);
|
|
149
|
-
}
|
|
150
|
-
case 4:
|
|
178
|
+
_this._publishEvent.onLocalBecomeInterpreter();
|
|
179
|
+
_this._publishEvent.onInterpretationEnabled(operatorUser);
|
|
180
|
+
_this._publishEvent.onSubscribeLanguageListUpdated();
|
|
181
|
+
_this._publishEvent.onInterpretationDisabled(operatorUser);
|
|
182
|
+
case 6:
|
|
151
183
|
case "end":
|
|
152
184
|
return _context.stop();
|
|
153
185
|
}
|
|
@@ -160,32 +192,17 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
160
192
|
}(),
|
|
161
193
|
onInterpreterUsersUpdated: function () {
|
|
162
194
|
var _onInterpreterUsersUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(roomId, users, operatorUser) {
|
|
163
|
-
var _this$_sharedInterpre, preInterpreterInfo, interpreterInfo, localInterpreterUpdate, outputLanguage, languageList;
|
|
164
195
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
165
196
|
while (1) switch (_context2.prev = _context2.next) {
|
|
166
197
|
case 0:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
case
|
|
175
|
-
outputLanguage = _this._sharedInterpreterDataSource.outputLanguage;
|
|
176
|
-
if (interpreterInfo && localInterpreterUpdate && outputLanguage) {
|
|
177
|
-
_this._observable.notifyObservers('onLocalInterpreterUpdated', [interpreterInfo.sourceLanguage, interpreterInfo.targetLanguage], outputLanguage);
|
|
178
|
-
}
|
|
179
|
-
_this._publishEvent();
|
|
180
|
-
if (users && operatorUser) {
|
|
181
|
-
_this._observable.notifyObservers('onInterpreterListUpdated', users, operatorUser);
|
|
182
|
-
}
|
|
183
|
-
languageList = _this.getSubscribeLanguageList();
|
|
184
|
-
_this._observable.notifyObservers('onSubscribeLanguageListUpdated', languageList);
|
|
185
|
-
if (preInterpreterInfo && !interpreterInfo) {
|
|
186
|
-
_this._observable.notifyObservers('onLocalNotInterpreter');
|
|
187
|
-
}
|
|
188
|
-
case 12:
|
|
198
|
+
_context2.next = 2;
|
|
199
|
+
return _this._refresh(operatorUser);
|
|
200
|
+
case 2:
|
|
201
|
+
_this._publishEvent.onLocalBecomeInterpreter();
|
|
202
|
+
_this._publishEvent.onInterpreterListUpdated(users, operatorUser);
|
|
203
|
+
_this._publishEvent.onSubscribeLanguageListUpdated();
|
|
204
|
+
_this._publishEvent.onLocalNotInterpreter();
|
|
205
|
+
case 6:
|
|
189
206
|
case "end":
|
|
190
207
|
return _context2.stop();
|
|
191
208
|
}
|
|
@@ -206,292 +223,136 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
206
223
|
userControl = params.userControl,
|
|
207
224
|
sharedInterpreterDataSource = params.sharedInterpreterDataSource,
|
|
208
225
|
eventProvider = params.eventProvider,
|
|
209
|
-
streamControl = params.streamControl,
|
|
210
|
-
deviceProvider = params.deviceProvider,
|
|
211
226
|
devicePrivilegeProvider = params.devicePrivilegeProvider;
|
|
212
227
|
this._privilegeProvider = privilegeProvider;
|
|
213
228
|
this._interpreterControl = interpreterControl;
|
|
214
229
|
this._userControl = userControl;
|
|
215
230
|
this._sharedInterpreterDataSource = sharedInterpreterDataSource;
|
|
216
231
|
this._eventProvider = eventProvider;
|
|
217
|
-
this._mainStreamControl = streamControl;
|
|
218
|
-
this._deviceProvider = deviceProvider;
|
|
219
232
|
this._devicePrivilegeProvider = devicePrivilegeProvider;
|
|
220
|
-
this._deviceProvider.addObserver(this._observerMicrophoneChanged);
|
|
221
233
|
this._interpreterControl.addObserver(this._observerInterpreter);
|
|
222
|
-
this.
|
|
234
|
+
this._refresh(this._userControl.getLocalUser());
|
|
235
|
+
this._publishEvent.onLocalBecameInterpreter();
|
|
223
236
|
}
|
|
224
237
|
return (0, _createClass2["default"])(FcrUIInterpreterProviderImpl, [{
|
|
225
|
-
key: "
|
|
226
|
-
value: function
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (interpreterInfo) {
|
|
232
|
-
if (!preInterpreterInfo) {
|
|
233
|
-
var _supportedLanguages = [interpreterInfo.sourceLanguage, interpreterInfo.targetLanguage];
|
|
234
|
-
this._observable.notifyObservers('onLocalBecomeInterpreter', _supportedLanguages, outputLanguage || interpreterInfo.targetLanguage);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
key: "_triggerDvicePrivilege",
|
|
240
|
-
value: function _triggerDvicePrivilege() {
|
|
241
|
-
var interpreterInfo = this._sharedInterpreterDataSource.interpreterInfo;
|
|
242
|
-
if (interpreterInfo) {
|
|
243
|
-
this._devicePrivilegeProvider.setAlwaysHasMicrophonePrivilege(true);
|
|
244
|
-
this._devicePrivilegeProvider.setAutoUpdateAudioStreamPrivilege(false);
|
|
245
|
-
} else {
|
|
246
|
-
this._devicePrivilegeProvider.setAlwaysHasMicrophonePrivilege(false);
|
|
247
|
-
this._devicePrivilegeProvider.setAutoUpdateAudioStreamPrivilege(true);
|
|
238
|
+
key: "_clearRetryTaskTimer",
|
|
239
|
+
value: function _clearRetryTaskTimer() {
|
|
240
|
+
this._retryTask.isAllowRetry = false;
|
|
241
|
+
if (this._retryTask.timerId) {
|
|
242
|
+
clearTimeout(this._retryTask.timerId);
|
|
243
|
+
this._retryTask.timerId = null;
|
|
248
244
|
}
|
|
249
245
|
}
|
|
250
246
|
}, {
|
|
251
|
-
key: "
|
|
247
|
+
key: "_refresh",
|
|
252
248
|
value: function () {
|
|
253
|
-
var
|
|
249
|
+
var _refresh2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(operatorUse) {
|
|
254
250
|
var _this2 = this;
|
|
255
|
-
var
|
|
251
|
+
var triggerDvicePrivilege, updateLanguageRoomListByStatus, getOutputLanguage, getSubscribeLanguageList, outputLanguage;
|
|
256
252
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
257
253
|
while (1) switch (_context3.prev = _context3.next) {
|
|
258
254
|
case 0:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
_this2._updateLanguageRoomListByStatus(languageRoomLisByStatus);
|
|
270
|
-
}
|
|
255
|
+
triggerDvicePrivilege = function triggerDvicePrivilege() {
|
|
256
|
+
var localInterpreterUserInfo = _this2._sharedInterpreterDataSource.localInterpreterUserInfo;
|
|
257
|
+
if (localInterpreterUserInfo) {
|
|
258
|
+
_this2._devicePrivilegeProvider.setAlwaysHasMicrophonePrivilege(true);
|
|
259
|
+
_this2._devicePrivilegeProvider.setAutoUpdateAudioStreamPrivilege(false);
|
|
260
|
+
} else {
|
|
261
|
+
_this2._devicePrivilegeProvider.setAlwaysHasMicrophonePrivilege(false);
|
|
262
|
+
_this2._devicePrivilegeProvider.setAutoUpdateAudioStreamPrivilege(true);
|
|
271
263
|
}
|
|
272
264
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
updateLanguageRoomListByStatus = function updateLanguageRoomListByStatus() {
|
|
266
|
+
var rooms = _this2._interpreterControl.getInterpreterRoomList() || []; //语言房间列表
|
|
267
|
+
rooms.forEach(function (ele) {
|
|
268
|
+
var languageRoom = _this2._sharedInterpreterDataSource.languageRoomListByStatus.get(ele.language);
|
|
269
|
+
_this2._sharedInterpreterDataSource.languageRoomListByStatus.set(ele.language, languageRoom ? languageRoom : _objectSpread(_objectSpread({}, ele), {}, {
|
|
270
|
+
control: _this2._interpreterControl.createRoomControl(ele.roomId),
|
|
271
|
+
status: _type.UpdateType.LEFT
|
|
272
|
+
}));
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
getOutputLanguage = function getOutputLanguage() {
|
|
276
|
+
var _this2$_sharedInterpr = _this2._sharedInterpreterDataSource,
|
|
277
|
+
localInterpreterUserInfo = _this2$_sharedInterpr.localInterpreterUserInfo,
|
|
278
|
+
outputLanguage = _this2$_sharedInterpr.outputLanguage,
|
|
279
|
+
supportedLanguages = _this2$_sharedInterpr.supportedLanguages;
|
|
280
|
+
return outputLanguage && supportedLanguages.includes(outputLanguage) ? outputLanguage : (localInterpreterUserInfo === null || localInterpreterUserInfo === void 0 ? void 0 : localInterpreterUserInfo.targetLanguage) || null;
|
|
281
|
+
};
|
|
282
|
+
getSubscribeLanguageList = function getSubscribeLanguageList() {
|
|
283
|
+
var _this2$_sharedInterpr2 = _this2._sharedInterpreterDataSource,
|
|
284
|
+
hasSubscribedLanguageList = _this2$_sharedInterpr2.hasSubscribedLanguageList,
|
|
285
|
+
subscribeLanguageOptionList = _this2$_sharedInterpr2.subscribeLanguageOptionList;
|
|
286
|
+
var updateLanguageList = hasSubscribedLanguageList.filter(function (ele) {
|
|
287
|
+
return subscribeLanguageOptionList.includes(ele);
|
|
288
|
+
});
|
|
289
|
+
return updateLanguageList.length === 0 ? [_interpreter.ORIGIN] : updateLanguageList;
|
|
290
|
+
};
|
|
291
|
+
triggerDvicePrivilege();
|
|
292
|
+
updateLanguageRoomListByStatus();
|
|
293
|
+
outputLanguage = getOutputLanguage();
|
|
294
|
+
if (operatorUse && operatorUse.userId !== this._userControl.getLocalUser().userId && outputLanguage) {
|
|
295
|
+
this._publishEvent.onLocalInterpreterWillUpdate(outputLanguage);
|
|
285
296
|
}
|
|
286
|
-
|
|
297
|
+
_context3.next = 10;
|
|
298
|
+
return this._updateOutputLanguage(outputLanguage);
|
|
299
|
+
case 10:
|
|
300
|
+
this._publishEvent.onLocalInterpreterUpdated();
|
|
301
|
+
_context3.next = 13;
|
|
302
|
+
return this._updateSubscribeLanguage(getSubscribeLanguageList());
|
|
303
|
+
case 13:
|
|
287
304
|
case "end":
|
|
288
305
|
return _context3.stop();
|
|
289
306
|
}
|
|
290
307
|
}, _callee3, this);
|
|
291
308
|
}));
|
|
292
|
-
function
|
|
293
|
-
return
|
|
309
|
+
function _refresh(_x7) {
|
|
310
|
+
return _refresh2.apply(this, arguments);
|
|
294
311
|
}
|
|
295
|
-
return
|
|
312
|
+
return _refresh;
|
|
296
313
|
}()
|
|
297
314
|
}, {
|
|
298
|
-
key: "
|
|
315
|
+
key: "_joinInterpreterRoom",
|
|
299
316
|
value: function () {
|
|
300
|
-
var
|
|
301
|
-
var
|
|
302
|
-
var _this$_sharedInterpre3, interpreterInfo, subscribeLanguageList, outputLanguage, subscribeLanguageOptionList, rooms, copyLanguageRoomListByStatus, outputLanguageList, language, languageList;
|
|
317
|
+
var _joinInterpreterRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref) {
|
|
318
|
+
var language, isToggleInterperterRemoteAudio, interpreterRoom, roomJoinOptions, _params;
|
|
303
319
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
304
320
|
while (1) switch (_context4.prev = _context4.next) {
|
|
305
321
|
case 0:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
copyLanguageRoomListByStatus = (0, _toConsumableArray2["default"])(this._languageRoomListByStatus);
|
|
311
|
-
rooms.forEach(function (ele) {
|
|
312
|
-
var languageRomm = copyLanguageRoomListByStatus.find(function (item) {
|
|
313
|
-
return item.language === ele.language;
|
|
314
|
-
});
|
|
315
|
-
if (languageRomm) {
|
|
316
|
-
return;
|
|
317
|
-
} else {
|
|
318
|
-
copyLanguageRoomListByStatus.push(_objectSpread(_objectSpread({}, ele), {}, {
|
|
319
|
-
status: _type.UpdateType.LEFT,
|
|
320
|
-
control: _this3._interpreterControl.createRoomControl(ele.roomId)
|
|
321
|
-
}));
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
this._languageRoomListByStatus = copyLanguageRoomListByStatus;
|
|
325
|
-
}
|
|
326
|
-
outputLanguageList = [];
|
|
327
|
-
if (interpreterInfo) {
|
|
328
|
-
outputLanguageList.push(interpreterInfo.sourceLanguage, interpreterInfo.targetLanguage);
|
|
329
|
-
}
|
|
330
|
-
language = outputLanguageList.includes(outputLanguage) ? outputLanguage : (interpreterInfo === null || interpreterInfo === void 0 ? void 0 : interpreterInfo.targetLanguage) || null;
|
|
331
|
-
_context4.next = 9;
|
|
332
|
-
return this._updateOutputLanguage(language);
|
|
333
|
-
case 9:
|
|
334
|
-
languageList = subscribeLanguageList.filter(function (ele) {
|
|
335
|
-
return subscribeLanguageOptionList.includes(ele);
|
|
336
|
-
});
|
|
337
|
-
_context4.next = 12;
|
|
338
|
-
return this._updateSubscribeLanguage(languageList);
|
|
339
|
-
case 12:
|
|
340
|
-
case "end":
|
|
341
|
-
return _context4.stop();
|
|
342
|
-
}
|
|
343
|
-
}, _callee4, this);
|
|
344
|
-
}));
|
|
345
|
-
function _update() {
|
|
346
|
-
return _update2.apply(this, arguments);
|
|
347
|
-
}
|
|
348
|
-
return _update;
|
|
349
|
-
}()
|
|
350
|
-
}, {
|
|
351
|
-
key: "_unload",
|
|
352
|
-
value: function _unload() {}
|
|
353
|
-
}, {
|
|
354
|
-
key: "_clearTimer",
|
|
355
|
-
value: function _clearTimer() {
|
|
356
|
-
if (this._indicateTimerId) {
|
|
357
|
-
clearTimeout(this._indicateTimerId);
|
|
358
|
-
this._indicateTimerId = null;
|
|
359
|
-
}
|
|
360
|
-
if (this._volumeTimerId) {
|
|
361
|
-
clearInterval(this._volumeTimerId);
|
|
362
|
-
this._volumeTimerId = null;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}, {
|
|
366
|
-
key: "_onStreamVolumeIndicationUpdated",
|
|
367
|
-
value: function _onStreamVolumeIndicationUpdated(roomId, streamId, volume) {
|
|
368
|
-
var _this4 = this;
|
|
369
|
-
var setMainRoomVolume = function setMainRoomVolume(volume) {
|
|
370
|
-
_this4._mainStreamControl.getStreamList().forEach(function (stream) {
|
|
371
|
-
var needSetVolume = [_imports.AgoraRteMediaStreamType.AUDIO, _imports.AgoraRteMediaStreamType.BOTH].includes(stream.streamType);
|
|
372
|
-
if (needSetVolume) _this4._mainStreamControl.adjustRemoteAudioStreamVolume(stream.streamId, volume);
|
|
373
|
-
});
|
|
374
|
-
};
|
|
375
|
-
var restoreVolumeByMainRoom = function restoreVolumeByMainRoom() {
|
|
376
|
-
if (_this4._volumeTimerId) return;
|
|
377
|
-
var startValue = 25; // 主房间初始音量
|
|
378
|
-
var endValue = 100; // 最大音量
|
|
379
|
-
var duration = 2000; // 在 2 秒内逐渐放大
|
|
380
|
-
var interval = 50; // 更新间隔为 50ms
|
|
381
|
-
|
|
382
|
-
var volume = startValue;
|
|
383
|
-
var steps = (endValue - startValue) / (duration / interval);
|
|
384
|
-
_this4._volumeTimerId = setInterval(function () {
|
|
385
|
-
volume += steps;
|
|
386
|
-
if (volume >= endValue) {
|
|
387
|
-
volume = endValue;
|
|
388
|
-
_this4._clearTimer();
|
|
389
|
-
}
|
|
390
|
-
setMainRoomVolume(volume);
|
|
391
|
-
}, interval);
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
// HLD: 判断 volume > 10 ,避免波动, 则认为是在说话
|
|
395
|
-
var isSpeaking = Math.floor(volume / 255 * 100) > 10;
|
|
396
|
-
if (isSpeaking) {
|
|
397
|
-
// HLD: 主房输出音量设置为25,语言房间设置输出音频为100
|
|
398
|
-
this._observable.notifyObservers('onSubscribeLanguageVolumePrioritized', isSpeaking);
|
|
399
|
-
setMainRoomVolume(25);
|
|
400
|
-
this._clearTimer();
|
|
401
|
-
} else {
|
|
402
|
-
// PRD: 参会人听到的是译员的声音及轻微的原始音频声音。当语言频道内 6 秒内没有译员发言,原始音频的音量将在接下来的 2 秒内逐渐放大到正常音量。
|
|
403
|
-
this._indicateTimerId = setTimeout(function () {
|
|
404
|
-
_this4._observable.notifyObservers('onSubscribeLanguageVolumePrioritized', isSpeaking);
|
|
405
|
-
restoreVolumeByMainRoom();
|
|
406
|
-
}, 6000);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}, {
|
|
410
|
-
key: "_updateLanguageRoomListByStatus",
|
|
411
|
-
value: function _updateLanguageRoomListByStatus(executeRoomList) {
|
|
412
|
-
this._languageRoomListByStatus = (0, _utils.mergeArrays)(this._languageRoomListByStatus, executeRoomList, 'language');
|
|
413
|
-
}
|
|
414
|
-
}, {
|
|
415
|
-
key: "_clearRetryTaskTimer",
|
|
416
|
-
value: function _clearRetryTaskTimer() {
|
|
417
|
-
this._retryTask.isAllowRetry = false;
|
|
418
|
-
if (this._retryTask.timerId) {
|
|
419
|
-
clearTimeout(this._retryTask.timerId);
|
|
420
|
-
this._retryTask.timerId = null;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}, {
|
|
424
|
-
key: "_getRoomInfo",
|
|
425
|
-
value: function _getRoomInfo(language) {
|
|
426
|
-
var room = this._languageRoomListByStatus.find(function (languageRoom) {
|
|
427
|
-
return languageRoom.language === language;
|
|
428
|
-
});
|
|
429
|
-
return room;
|
|
430
|
-
}
|
|
431
|
-
}, {
|
|
432
|
-
key: "_bindLocalMicrophoneId",
|
|
433
|
-
value: function _bindLocalMicrophoneId(room, _microphoneId) {
|
|
434
|
-
var microphoneId = _microphoneId || this._deviceProvider.currentDeviceId.microphoneDeviceId;
|
|
435
|
-
if (microphoneId) {
|
|
436
|
-
var streamList = room.control.getStreamControl().getStreamsByUserId(room.control.getUserControl().getLocalUser().userId);
|
|
437
|
-
var micStream = streamList.find(function (stream) {
|
|
438
|
-
return stream.audioSourceType === _fcrCore.FcrAudioSourceType.MICROPHONE;
|
|
439
|
-
});
|
|
440
|
-
if (micStream && micStream.audioSourceId !== microphoneId) {
|
|
441
|
-
var _room$control$getRoom;
|
|
442
|
-
this.logger.info("bind local microphone id to stream: [".concat(micStream.streamId, "], room: ").concat((_room$control$getRoom = room.control.getRoomInfo()) === null || _room$control$getRoom === void 0 ? void 0 : _room$control$getRoom.roomId));
|
|
443
|
-
room.control.getStreamControl().bindLocalStreams([{
|
|
444
|
-
streamId: micStream.streamId,
|
|
445
|
-
audioSourceId: microphoneId
|
|
446
|
-
}]);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}, {
|
|
451
|
-
key: "_joinInterpreterRoom",
|
|
452
|
-
value: function () {
|
|
453
|
-
var _joinInterpreterRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref) {
|
|
454
|
-
var language, _ref$isToggleInterper, isToggleInterperterRemoteAudio, room, roomJoinOptions, _params;
|
|
455
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
456
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
457
|
-
case 0:
|
|
458
|
-
language = _ref.language, _ref$isToggleInterper = _ref.isToggleInterperterRemoteAudio, isToggleInterperterRemoteAudio = _ref$isToggleInterper === void 0 ? true : _ref$isToggleInterper;
|
|
459
|
-
room = this._getRoomInfo(language);
|
|
460
|
-
if (!(room && room.status !== _type.UpdateType.JOIN)) {
|
|
461
|
-
_context5.next = 17;
|
|
322
|
+
language = _ref.language, isToggleInterperterRemoteAudio = _ref.isToggleInterperterRemoteAudio;
|
|
323
|
+
interpreterRoom = this._sharedInterpreterDataSource.languageRoomListByStatus.get(language);
|
|
324
|
+
if (!(interpreterRoom && interpreterRoom.status !== _type.UpdateType.JOIN)) {
|
|
325
|
+
_context4.next = 16;
|
|
462
326
|
break;
|
|
463
327
|
}
|
|
464
328
|
roomJoinOptions = getRoomJoinOptions(this._userControl.getLocalUser());
|
|
465
|
-
_params = _objectSpread(_objectSpread({},
|
|
329
|
+
_params = _objectSpread(_objectSpread({}, interpreterRoom), {}, {
|
|
466
330
|
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio,
|
|
467
|
-
roomJoinOptions: roomJoinOptions
|
|
331
|
+
roomJoinOptions: roomJoinOptions,
|
|
332
|
+
control: interpreterRoom.control
|
|
468
333
|
});
|
|
469
|
-
|
|
334
|
+
_context4.prev = 5;
|
|
470
335
|
this._observable.notifyObservers('onJoinInterpretingRoom', _params);
|
|
471
|
-
|
|
472
|
-
return
|
|
336
|
+
_context4.next = 9;
|
|
337
|
+
return interpreterRoom.control.join(roomJoinOptions);
|
|
473
338
|
case 9:
|
|
474
339
|
this._observable.notifyObservers('onJoinInterpretingRoomSuccess', _params);
|
|
475
|
-
|
|
476
|
-
//TODO 更新房间状态
|
|
477
|
-
this._updateLanguageRoomListByStatus([_objectSpread(_objectSpread({}, room), {}, {
|
|
340
|
+
this._sharedInterpreterDataSource.languageRoomListByStatus.set(interpreterRoom.language, _objectSpread(_objectSpread({}, interpreterRoom), {}, {
|
|
478
341
|
status: _type.UpdateType.JOIN
|
|
479
|
-
})
|
|
480
|
-
|
|
481
|
-
this._bindLocalMicrophoneId(room);
|
|
482
|
-
_context5.next = 17;
|
|
342
|
+
}));
|
|
343
|
+
_context4.next = 16;
|
|
483
344
|
break;
|
|
484
|
-
case
|
|
485
|
-
|
|
486
|
-
|
|
345
|
+
case 13:
|
|
346
|
+
_context4.prev = 13;
|
|
347
|
+
_context4.t0 = _context4["catch"](5);
|
|
487
348
|
this._observable.notifyObservers('onJoinInterpretingRoomFailed', _params);
|
|
488
|
-
case
|
|
349
|
+
case 16:
|
|
489
350
|
case "end":
|
|
490
|
-
return
|
|
351
|
+
return _context4.stop();
|
|
491
352
|
}
|
|
492
|
-
},
|
|
353
|
+
}, _callee4, this, [[5, 13]]);
|
|
493
354
|
}));
|
|
494
|
-
function _joinInterpreterRoom(
|
|
355
|
+
function _joinInterpreterRoom(_x8) {
|
|
495
356
|
return _joinInterpreterRoom2.apply(this, arguments);
|
|
496
357
|
}
|
|
497
358
|
return _joinInterpreterRoom;
|
|
@@ -499,264 +360,171 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
499
360
|
}, {
|
|
500
361
|
key: "_leaveInterpreterRoom",
|
|
501
362
|
value: function () {
|
|
502
|
-
var _leaveInterpreterRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
503
|
-
var language,
|
|
504
|
-
return _regenerator["default"].wrap(function
|
|
505
|
-
while (1) switch (
|
|
363
|
+
var _leaveInterpreterRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref2) {
|
|
364
|
+
var language, interpreterRoom, param;
|
|
365
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
366
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
506
367
|
case 0:
|
|
507
368
|
language = _ref2.language;
|
|
508
|
-
|
|
509
|
-
if (!(
|
|
510
|
-
|
|
369
|
+
interpreterRoom = this._sharedInterpreterDataSource.languageRoomListByStatus.get(language);
|
|
370
|
+
if (!(interpreterRoom && interpreterRoom.status === _type.UpdateType.JOIN)) {
|
|
371
|
+
_context5.next = 15;
|
|
511
372
|
break;
|
|
512
373
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
374
|
+
param = _objectSpread(_objectSpread({}, interpreterRoom), {}, {
|
|
375
|
+
control: interpreterRoom.control
|
|
376
|
+
});
|
|
377
|
+
_context5.prev = 4;
|
|
378
|
+
this._observable.notifyObservers('onLeaveInterpretingRoom', param);
|
|
379
|
+
_context5.next = 8;
|
|
380
|
+
return interpreterRoom.control.leave();
|
|
518
381
|
case 8:
|
|
519
|
-
this._observable.notifyObservers('onLeaveInterpretingRoomSuccess',
|
|
520
|
-
|
|
382
|
+
this._observable.notifyObservers('onLeaveInterpretingRoomSuccess', param);
|
|
383
|
+
_context5.next = 14;
|
|
521
384
|
break;
|
|
522
385
|
case 11:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
this._observable.notifyObservers('onLeaveInterpretingRoomFailed',
|
|
386
|
+
_context5.prev = 11;
|
|
387
|
+
_context5.t0 = _context5["catch"](4);
|
|
388
|
+
this._observable.notifyObservers('onLeaveInterpretingRoomFailed', param);
|
|
526
389
|
case 14:
|
|
527
|
-
this.
|
|
390
|
+
this._sharedInterpreterDataSource.languageRoomListByStatus.set(interpreterRoom.language, _objectSpread(_objectSpread({}, interpreterRoom), {}, {
|
|
528
391
|
status: _type.UpdateType.LEFT
|
|
529
|
-
})
|
|
392
|
+
}));
|
|
530
393
|
case 15:
|
|
531
394
|
case "end":
|
|
532
|
-
return
|
|
395
|
+
return _context5.stop();
|
|
533
396
|
}
|
|
534
|
-
},
|
|
397
|
+
}, _callee5, this, [[4, 11]]);
|
|
535
398
|
}));
|
|
536
|
-
function _leaveInterpreterRoom(
|
|
399
|
+
function _leaveInterpreterRoom(_x9) {
|
|
537
400
|
return _leaveInterpreterRoom2.apply(this, arguments);
|
|
538
401
|
}
|
|
539
402
|
return _leaveInterpreterRoom;
|
|
540
403
|
}()
|
|
541
|
-
}, {
|
|
542
|
-
key: "_setMainRoomStream",
|
|
543
|
-
value: function () {
|
|
544
|
-
var _setMainRoomStream2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(open) {
|
|
545
|
-
var _this5 = this;
|
|
546
|
-
var localStreamList, micStreams, streamId, streamInfo, hasAudioPublishPrivilege, streamsConfig;
|
|
547
|
-
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
548
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
549
|
-
case 0:
|
|
550
|
-
localStreamList = this._mainStreamControl.getStreamsByUserId(this._userControl.getLocalUser().userId);
|
|
551
|
-
micStreams = localStreamList.filter(function (ele) {
|
|
552
|
-
return ele.audioSourceType === _type2.AgoraRteAudioSourceType.MICROPHONE;
|
|
553
|
-
});
|
|
554
|
-
streamId = !!micStreams.length ? micStreams[0].streamId : null;
|
|
555
|
-
if (!streamId) {
|
|
556
|
-
_context7.next = 10;
|
|
557
|
-
break;
|
|
558
|
-
}
|
|
559
|
-
streamInfo = this._mainStreamControl.getStreamByStreamId(streamId);
|
|
560
|
-
hasAudioPublishPrivilege = streamInfo && (streamInfo.streamType === _fcrCore.FcrStreamType.BOTH || streamInfo.streamType === _fcrCore.FcrStreamType.AUDIO);
|
|
561
|
-
if (!hasAudioPublishPrivilege) {
|
|
562
|
-
_context7.next = 10;
|
|
563
|
-
break;
|
|
564
|
-
}
|
|
565
|
-
streamsConfig = (0, _defineProperty2["default"])({}, streamId, {
|
|
566
|
-
audioPrivilege: open ? _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
|
|
567
|
-
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
568
|
-
});
|
|
569
|
-
_context7.next = 10;
|
|
570
|
-
return (0, _utils.retryTask)(function () {
|
|
571
|
-
return _this5._mainStreamControl.updatePublishPrivilegeOfStreams(streamsConfig);
|
|
572
|
-
}, this._retryTask);
|
|
573
|
-
case 10:
|
|
574
|
-
case "end":
|
|
575
|
-
return _context7.stop();
|
|
576
|
-
}
|
|
577
|
-
}, _callee7, this);
|
|
578
|
-
}));
|
|
579
|
-
function _setMainRoomStream(_x9) {
|
|
580
|
-
return _setMainRoomStream2.apply(this, arguments);
|
|
581
|
-
}
|
|
582
|
-
return _setMainRoomStream;
|
|
583
|
-
}()
|
|
584
404
|
}, {
|
|
585
405
|
key: "_updateOutputLanguage",
|
|
586
406
|
value: function () {
|
|
587
|
-
var _updateOutputLanguage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
588
|
-
var
|
|
589
|
-
var setUiOutputLanguage, setInterpreterRoomStreams,
|
|
590
|
-
return _regenerator["default"].wrap(function
|
|
591
|
-
while (1) switch (
|
|
407
|
+
var _updateOutputLanguage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(language) {
|
|
408
|
+
var _this3 = this;
|
|
409
|
+
var setUiOutputLanguage, setInterpreterRoomStreams, outputLanguage;
|
|
410
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
411
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
592
412
|
case 0:
|
|
593
413
|
setUiOutputLanguage = /*#__PURE__*/function () {
|
|
594
|
-
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
414
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(language) {
|
|
595
415
|
var interpreterLangCode;
|
|
596
|
-
return _regenerator["default"].wrap(function
|
|
597
|
-
while (1) switch (
|
|
416
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
417
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
598
418
|
case 0:
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
interpreterLangCode =
|
|
419
|
+
_this3._sharedInterpreterDataSource.outputLanguage = language;
|
|
420
|
+
_context6.prev = 1;
|
|
421
|
+
interpreterLangCode = _this3._userControl.getUserPropertiesByKeyPath('interpreterLangCode', _this3._userControl.getLocalUser().userId);
|
|
602
422
|
if (!(!language && !interpreterLangCode)) {
|
|
603
|
-
|
|
423
|
+
_context6.next = 5;
|
|
604
424
|
break;
|
|
605
425
|
}
|
|
606
|
-
return
|
|
426
|
+
return _context6.abrupt("return");
|
|
607
427
|
case 5:
|
|
608
|
-
|
|
609
|
-
return
|
|
428
|
+
_context6.next = 7;
|
|
429
|
+
return _this3._userControl.updateUserProperties({
|
|
610
430
|
interpreterLangCode: language
|
|
611
|
-
}, {},
|
|
431
|
+
}, {}, _this3._userControl.getLocalUser().userId);
|
|
612
432
|
case 7:
|
|
613
|
-
|
|
614
|
-
_context8.next = 13;
|
|
433
|
+
_context6.next = 12;
|
|
615
434
|
break;
|
|
616
|
-
case
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
case
|
|
435
|
+
case 9:
|
|
436
|
+
_context6.prev = 9;
|
|
437
|
+
_context6.t0 = _context6["catch"](1);
|
|
438
|
+
_this3.logger.info("interpreter log update user properties interpreterLangCode:".concat(language, " fail"));
|
|
439
|
+
case 12:
|
|
621
440
|
case "end":
|
|
622
|
-
return
|
|
441
|
+
return _context6.stop();
|
|
623
442
|
}
|
|
624
|
-
},
|
|
443
|
+
}, _callee6, null, [[1, 9]]);
|
|
625
444
|
}));
|
|
626
|
-
return function setUiOutputLanguage(
|
|
445
|
+
return function setUiOutputLanguage(_x11) {
|
|
627
446
|
return _ref3.apply(this, arguments);
|
|
628
447
|
};
|
|
629
448
|
}();
|
|
630
449
|
setInterpreterRoomStreams = /*#__PURE__*/function () {
|
|
631
|
-
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
632
|
-
var
|
|
633
|
-
return _regenerator["default"].wrap(function
|
|
634
|
-
while (1) switch (
|
|
450
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(language, open) {
|
|
451
|
+
var interpreterRoom, streamControl, streamList, stream;
|
|
452
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
453
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
635
454
|
case 0:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
_context9.next = 9;
|
|
455
|
+
if (!open) {
|
|
456
|
+
_context7.next = 3;
|
|
639
457
|
break;
|
|
640
458
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
459
|
+
_context7.next = 3;
|
|
460
|
+
return _this3._joinInterpreterRoom({
|
|
461
|
+
language: language,
|
|
462
|
+
isToggleInterperterRemoteAudio: false
|
|
463
|
+
});
|
|
464
|
+
case 3:
|
|
465
|
+
interpreterRoom = _this3._sharedInterpreterDataSource.languageRoomListByStatus.get(language);
|
|
466
|
+
if (!(interpreterRoom && interpreterRoom.status === _type.UpdateType.JOIN)) {
|
|
467
|
+
_context7.next = 11;
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
streamControl = interpreterRoom.control.getStreamControl();
|
|
471
|
+
streamList = streamControl.getStreamsByUserId(_this3._userControl.getLocalUser().userId);
|
|
644
472
|
if (!(streamList.length > 0)) {
|
|
645
|
-
|
|
473
|
+
_context7.next = 11;
|
|
646
474
|
break;
|
|
647
475
|
}
|
|
648
476
|
stream = streamList[0];
|
|
649
|
-
|
|
477
|
+
_context7.next = 11;
|
|
650
478
|
return streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, stream.streamId, {
|
|
651
479
|
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION,
|
|
652
480
|
audioPrivilege: open ? _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE
|
|
653
481
|
}));
|
|
654
|
-
case
|
|
482
|
+
case 11:
|
|
655
483
|
case "end":
|
|
656
|
-
return
|
|
484
|
+
return _context7.stop();
|
|
657
485
|
}
|
|
658
|
-
},
|
|
486
|
+
}, _callee7);
|
|
659
487
|
}));
|
|
660
|
-
return function setInterpreterRoomStreams(
|
|
488
|
+
return function setInterpreterRoomStreams(_x12, _x13) {
|
|
661
489
|
return _ref4.apply(this, arguments);
|
|
662
490
|
};
|
|
663
491
|
}();
|
|
664
492
|
this._clearRetryTaskTimer(); // 清除当前重试任务
|
|
665
|
-
|
|
666
|
-
_context10.next = 6;
|
|
667
|
-
return this._setMainRoomStream(language ? false : true);
|
|
668
|
-
case 6:
|
|
669
|
-
isToggleInterperterRemoteAudio = false; // 开启
|
|
493
|
+
outputLanguage = this._sharedInterpreterDataSource.outputLanguage; // 开启
|
|
670
494
|
if (!language) {
|
|
671
|
-
|
|
495
|
+
_context8.next = 12;
|
|
672
496
|
break;
|
|
673
497
|
}
|
|
674
498
|
if (!outputLanguage) {
|
|
675
|
-
|
|
499
|
+
_context8.next = 10;
|
|
676
500
|
break;
|
|
677
501
|
}
|
|
678
|
-
|
|
679
|
-
return this._joinInterpreterRoom({
|
|
680
|
-
language: language,
|
|
681
|
-
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio
|
|
682
|
-
});
|
|
683
|
-
case 11:
|
|
684
|
-
_context10.next = 13;
|
|
502
|
+
_context8.next = 8;
|
|
685
503
|
return setInterpreterRoomStreams(language, true);
|
|
686
|
-
case
|
|
687
|
-
|
|
504
|
+
case 8:
|
|
505
|
+
_context8.next = 12;
|
|
688
506
|
break;
|
|
689
|
-
case
|
|
690
|
-
|
|
691
|
-
return (0, _utils.retryTask)(function () {
|
|
692
|
-
return _this6._joinInterpreterRoom({
|
|
693
|
-
language: language,
|
|
694
|
-
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio
|
|
695
|
-
});
|
|
696
|
-
}, this._retryTask);
|
|
697
|
-
case 17:
|
|
698
|
-
_context10.next = 19;
|
|
507
|
+
case 10:
|
|
508
|
+
_context8.next = 12;
|
|
699
509
|
return (0, _utils.retryTask)(function () {
|
|
700
510
|
return setInterpreterRoomStreams(language, true);
|
|
701
511
|
}, this._retryTask);
|
|
702
|
-
case
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
preOutputLanguageList = [];
|
|
706
|
-
if (interpreterInfo) {
|
|
707
|
-
outputLanguageList.push(interpreterInfo.sourceLanguage, interpreterInfo.targetLanguage);
|
|
708
|
-
}
|
|
709
|
-
if (preInterpreterInfo) {
|
|
710
|
-
preOutputLanguageList.push(preInterpreterInfo.sourceLanguage, preInterpreterInfo.targetLanguage);
|
|
711
|
-
}
|
|
712
|
-
closeOutputLanguageList = [].concat((0, _toConsumableArray2["default"])(outputLanguageList.filter(function (ele) {
|
|
713
|
-
return ele !== language;
|
|
714
|
-
})), (0, _toConsumableArray2["default"])(preOutputLanguageList.filter(function (ele) {
|
|
715
|
-
return ele !== language;
|
|
716
|
-
})));
|
|
717
|
-
closeOutputLanguageList = Array.from(new Set(closeOutputLanguageList));
|
|
718
|
-
index = 0;
|
|
719
|
-
case 26:
|
|
720
|
-
if (!(index < closeOutputLanguageList.length)) {
|
|
721
|
-
_context10.next = 38;
|
|
722
|
-
break;
|
|
723
|
-
}
|
|
724
|
-
languageRoom = closeOutputLanguageList[index];
|
|
725
|
-
if (!(outputLanguageList.includes(languageRoom) || subscribeLanguageList.includes(languageRoom))) {
|
|
726
|
-
_context10.next = 33;
|
|
512
|
+
case 12:
|
|
513
|
+
if (!(outputLanguage && language !== outputLanguage)) {
|
|
514
|
+
_context8.next = 15;
|
|
727
515
|
break;
|
|
728
516
|
}
|
|
729
|
-
|
|
730
|
-
return setInterpreterRoomStreams(
|
|
731
|
-
case
|
|
732
|
-
_context10.next = 35;
|
|
733
|
-
break;
|
|
734
|
-
case 33:
|
|
735
|
-
_context10.next = 35;
|
|
736
|
-
return this._leaveInterpreterRoom({
|
|
737
|
-
language: languageRoom
|
|
738
|
-
});
|
|
739
|
-
case 35:
|
|
740
|
-
index++;
|
|
741
|
-
_context10.next = 26;
|
|
742
|
-
break;
|
|
743
|
-
case 38:
|
|
517
|
+
_context8.next = 15;
|
|
518
|
+
return setInterpreterRoomStreams(outputLanguage, false);
|
|
519
|
+
case 15:
|
|
744
520
|
setUiOutputLanguage(language);
|
|
745
|
-
|
|
746
|
-
// if (localInterpreterUpdate) {
|
|
747
|
-
// this._observable.notifyObservers(
|
|
748
|
-
// 'onLocalInterpreterUpdated',
|
|
749
|
-
// [interpreterInfo.sourceLanguage, interpreterInfo.targetLanguage],
|
|
750
|
-
// language,
|
|
751
|
-
// );
|
|
752
|
-
// }
|
|
753
|
-
case 39:
|
|
521
|
+
case 16:
|
|
754
522
|
case "end":
|
|
755
|
-
return
|
|
523
|
+
return _context8.stop();
|
|
756
524
|
}
|
|
757
|
-
},
|
|
525
|
+
}, _callee8, this);
|
|
758
526
|
}));
|
|
759
|
-
function _updateOutputLanguage(_x10
|
|
527
|
+
function _updateOutputLanguage(_x10) {
|
|
760
528
|
return _updateOutputLanguage2.apply(this, arguments);
|
|
761
529
|
}
|
|
762
530
|
return _updateOutputLanguage;
|
|
@@ -764,151 +532,146 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
764
532
|
}, {
|
|
765
533
|
key: "_updateSubscribeLanguage",
|
|
766
534
|
value: function () {
|
|
767
|
-
var _updateSubscribeLanguage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
768
|
-
var
|
|
769
|
-
var handlesubscribeLanguage,
|
|
770
|
-
return _regenerator["default"].wrap(function
|
|
771
|
-
while (1) switch (
|
|
535
|
+
var _updateSubscribeLanguage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(updateLanguageList) {
|
|
536
|
+
var _this4 = this;
|
|
537
|
+
var handlesubscribeLanguage, index, languageRoom, hasSubscribedLanguageList, closeSubscribeLanguageList, _index, _languageRoom;
|
|
538
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
539
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
772
540
|
case 0:
|
|
541
|
+
_context10.prev = 0;
|
|
773
542
|
handlesubscribeLanguage = /*#__PURE__*/function () {
|
|
774
|
-
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
775
|
-
var language,
|
|
776
|
-
return _regenerator["default"].wrap(function
|
|
777
|
-
while (1) switch (
|
|
543
|
+
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(_ref5) {
|
|
544
|
+
var language, open, interpreterRoom, _supportedLanguages;
|
|
545
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
546
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
778
547
|
case 0:
|
|
779
|
-
language = _ref5.language,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
_context11.next = 21;
|
|
548
|
+
language = _ref5.language, open = _ref5.open;
|
|
549
|
+
interpreterRoom = _this4._sharedInterpreterDataSource.languageRoomListByStatus.get(language);
|
|
550
|
+
if (!interpreterRoom) {
|
|
551
|
+
_context9.next = 22;
|
|
784
552
|
break;
|
|
785
553
|
}
|
|
786
|
-
if (!
|
|
787
|
-
|
|
554
|
+
if (!open) {
|
|
555
|
+
_context9.next = 14;
|
|
788
556
|
break;
|
|
789
557
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
event: event
|
|
793
|
-
});
|
|
794
|
-
_context11.next = 21;
|
|
795
|
-
break;
|
|
796
|
-
case 8:
|
|
797
|
-
if (!(event === _enums.EventType.STOP)) {
|
|
798
|
-
_context11.next = 18;
|
|
799
|
-
break;
|
|
800
|
-
}
|
|
801
|
-
if (!((interpreterInfo === null || interpreterInfo === void 0 ? void 0 : interpreterInfo.sourceLanguage) === language || (interpreterInfo === null || interpreterInfo === void 0 ? void 0 : interpreterInfo.targetLanguage) === language)) {
|
|
802
|
-
_context11.next = 13;
|
|
558
|
+
if (!(interpreterRoom.status !== _type.UpdateType.JOIN)) {
|
|
559
|
+
_context9.next = 10;
|
|
803
560
|
break;
|
|
804
561
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
562
|
+
_context9.next = 7;
|
|
563
|
+
return _this4._joinInterpreterRoom({
|
|
564
|
+
language: language,
|
|
565
|
+
isToggleInterperterRemoteAudio: true
|
|
808
566
|
});
|
|
809
|
-
|
|
567
|
+
case 7:
|
|
568
|
+
interpreterRoom.control.getStreamControl().addObserver(_this4._observerStream);
|
|
569
|
+
_context9.next = 12;
|
|
810
570
|
break;
|
|
811
|
-
case
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
// TODO 移除监听音量变化
|
|
820
|
-
room.control.getStreamControl().removeObserver(_this7._observerStream);
|
|
821
|
-
_context11.next = 21;
|
|
571
|
+
case 10:
|
|
572
|
+
_this4._eventProvider.sendEvent(_constant.FcrUIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
573
|
+
roomControl: interpreterRoom.control,
|
|
574
|
+
event: _enums.EventType.START
|
|
575
|
+
});
|
|
576
|
+
interpreterRoom.control.getStreamControl().addObserver(_this4._observerStream);
|
|
577
|
+
case 12:
|
|
578
|
+
_context9.next = 22;
|
|
822
579
|
break;
|
|
823
|
-
case
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
580
|
+
case 14:
|
|
581
|
+
_supportedLanguages = _this4._sharedInterpreterDataSource.supportedLanguages;
|
|
582
|
+
if (!_supportedLanguages.includes(language)) {
|
|
583
|
+
_context9.next = 19;
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
if (interpreterRoom.status === _type.UpdateType.JOIN) {
|
|
587
|
+
_this4._eventProvider.sendEvent(_constant.FcrUIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
588
|
+
roomControl: interpreterRoom.control,
|
|
589
|
+
event: _enums.EventType.START
|
|
828
590
|
});
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
591
|
+
}
|
|
592
|
+
_context9.next = 21;
|
|
593
|
+
break;
|
|
594
|
+
case 19:
|
|
595
|
+
_context9.next = 21;
|
|
596
|
+
return _this4._leaveInterpreterRoom({
|
|
597
|
+
language: language
|
|
598
|
+
});
|
|
833
599
|
case 21:
|
|
600
|
+
interpreterRoom.control.getStreamControl().removeObserver(_this4._observerStream);
|
|
601
|
+
case 22:
|
|
834
602
|
case "end":
|
|
835
|
-
return
|
|
603
|
+
return _context9.stop();
|
|
836
604
|
}
|
|
837
|
-
},
|
|
605
|
+
}, _callee9);
|
|
838
606
|
}));
|
|
839
|
-
return function handlesubscribeLanguage(
|
|
607
|
+
return function handlesubscribeLanguage(_x15) {
|
|
840
608
|
return _ref6.apply(this, arguments);
|
|
841
609
|
};
|
|
842
610
|
}();
|
|
843
|
-
this.
|
|
844
|
-
|
|
611
|
+
this._eventProvider.sendEvent(_constant.FcrUIAction.TOGGLE_MAINROOM_REMOTE_AUDIO, {
|
|
612
|
+
event: updateLanguageList.includes(_interpreter.ORIGIN) ? _enums.EventType.START : _enums.EventType.STOP
|
|
613
|
+
});
|
|
845
614
|
index = 0;
|
|
846
615
|
case 4:
|
|
847
|
-
if (!(index <
|
|
848
|
-
|
|
616
|
+
if (!(index < updateLanguageList.length)) {
|
|
617
|
+
_context10.next = 12;
|
|
849
618
|
break;
|
|
850
619
|
}
|
|
851
|
-
languageRoom =
|
|
852
|
-
if (!(languageRoom
|
|
853
|
-
|
|
620
|
+
languageRoom = updateLanguageList[index];
|
|
621
|
+
if (!(languageRoom !== _interpreter.ORIGIN)) {
|
|
622
|
+
_context10.next = 9;
|
|
854
623
|
break;
|
|
855
624
|
}
|
|
856
|
-
|
|
857
|
-
event: _enums.EventType.START
|
|
858
|
-
});
|
|
859
|
-
_context12.next = 12;
|
|
860
|
-
break;
|
|
861
|
-
case 10:
|
|
862
|
-
_context12.next = 12;
|
|
625
|
+
_context10.next = 9;
|
|
863
626
|
return handlesubscribeLanguage({
|
|
864
627
|
language: languageRoom,
|
|
865
|
-
|
|
628
|
+
open: true
|
|
866
629
|
});
|
|
867
|
-
case
|
|
630
|
+
case 9:
|
|
868
631
|
index++;
|
|
869
|
-
|
|
632
|
+
_context10.next = 4;
|
|
870
633
|
break;
|
|
871
|
-
case
|
|
872
|
-
|
|
873
|
-
closeSubscribeLanguageList =
|
|
874
|
-
return !
|
|
634
|
+
case 12:
|
|
635
|
+
hasSubscribedLanguageList = this._sharedInterpreterDataSource.hasSubscribedLanguageList;
|
|
636
|
+
closeSubscribeLanguageList = hasSubscribedLanguageList.filter(function (ele) {
|
|
637
|
+
return !updateLanguageList.includes(ele);
|
|
875
638
|
});
|
|
876
639
|
_index = 0;
|
|
877
|
-
case
|
|
640
|
+
case 15:
|
|
878
641
|
if (!(_index < closeSubscribeLanguageList.length)) {
|
|
879
|
-
|
|
642
|
+
_context10.next = 23;
|
|
880
643
|
break;
|
|
881
644
|
}
|
|
882
645
|
_languageRoom = closeSubscribeLanguageList[_index];
|
|
883
|
-
if (!(_languageRoom
|
|
884
|
-
|
|
646
|
+
if (!(_languageRoom !== _interpreter.ORIGIN)) {
|
|
647
|
+
_context10.next = 20;
|
|
885
648
|
break;
|
|
886
649
|
}
|
|
887
|
-
|
|
888
|
-
event: _enums.EventType.STOP
|
|
889
|
-
});
|
|
890
|
-
_context12.next = 26;
|
|
891
|
-
break;
|
|
892
|
-
case 24:
|
|
893
|
-
_context12.next = 26;
|
|
650
|
+
_context10.next = 20;
|
|
894
651
|
return handlesubscribeLanguage({
|
|
895
652
|
language: _languageRoom,
|
|
896
|
-
|
|
653
|
+
open: false
|
|
897
654
|
});
|
|
898
|
-
case
|
|
655
|
+
case 20:
|
|
899
656
|
_index++;
|
|
900
|
-
|
|
657
|
+
_context10.next = 15;
|
|
658
|
+
break;
|
|
659
|
+
case 23:
|
|
660
|
+
this._sharedInterpreterDataSource.preHasSubscribedLanguageList = hasSubscribedLanguageList;
|
|
661
|
+
this._sharedInterpreterDataSource.hasSubscribedLanguageList = updateLanguageList;
|
|
662
|
+
_context10.next = 30;
|
|
901
663
|
break;
|
|
902
|
-
case
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
664
|
+
case 27:
|
|
665
|
+
_context10.prev = 27;
|
|
666
|
+
_context10.t0 = _context10["catch"](0);
|
|
667
|
+
this.logger.info("interpreter log update subscribe language fail ".concat(updateLanguageList.join(',')));
|
|
668
|
+
case 30:
|
|
906
669
|
case "end":
|
|
907
|
-
return
|
|
670
|
+
return _context10.stop();
|
|
908
671
|
}
|
|
909
|
-
},
|
|
672
|
+
}, _callee10, this, [[0, 27]]);
|
|
910
673
|
}));
|
|
911
|
-
function _updateSubscribeLanguage(
|
|
674
|
+
function _updateSubscribeLanguage(_x14) {
|
|
912
675
|
return _updateSubscribeLanguage2.apply(this, arguments);
|
|
913
676
|
}
|
|
914
677
|
return _updateSubscribeLanguage;
|
|
@@ -916,45 +679,36 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
916
679
|
}, {
|
|
917
680
|
key: "setOutputLanguage",
|
|
918
681
|
value: function () {
|
|
919
|
-
var _setOutputLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
920
|
-
var
|
|
921
|
-
return _regenerator["default"].wrap(function
|
|
922
|
-
while (1) switch (
|
|
682
|
+
var _setOutputLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(language, successCallback, failureCallback) {
|
|
683
|
+
var localInterpreterUserInfo;
|
|
684
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
685
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
923
686
|
case 0:
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
_context13.next = 7;
|
|
687
|
+
localInterpreterUserInfo = this._sharedInterpreterDataSource.localInterpreterUserInfo;
|
|
688
|
+
if (!localInterpreterUserInfo) {
|
|
689
|
+
_context11.next = 11;
|
|
928
690
|
break;
|
|
929
691
|
}
|
|
930
|
-
|
|
931
|
-
|
|
692
|
+
_context11.prev = 2;
|
|
693
|
+
_context11.next = 5;
|
|
694
|
+
return this._updateOutputLanguage(language);
|
|
932
695
|
case 5:
|
|
933
696
|
successCallback && successCallback();
|
|
934
|
-
|
|
935
|
-
// TODO 触发麦克风关闭提示
|
|
936
|
-
if (!this._deviceProvider.microphoneEnabled) {
|
|
937
|
-
this._eventProvider.showToast({
|
|
938
|
-
type: 'info',
|
|
939
|
-
message: (0, _i18n.transI18n)('fmt_interpretation_interpreter_toast_label_open_micro')
|
|
940
|
-
});
|
|
941
|
-
}
|
|
942
|
-
case 7:
|
|
943
|
-
_context13.next = 12;
|
|
697
|
+
_context11.next = 11;
|
|
944
698
|
break;
|
|
945
|
-
case
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
failureCallback && failureCallback(
|
|
699
|
+
case 8:
|
|
700
|
+
_context11.prev = 8;
|
|
701
|
+
_context11.t0 = _context11["catch"](2);
|
|
702
|
+
failureCallback && failureCallback(_context11.t0);
|
|
703
|
+
case 11:
|
|
704
|
+
return _context11.abrupt("return", !!localInterpreterUserInfo);
|
|
949
705
|
case 12:
|
|
950
|
-
return _context13.abrupt("return", !!interpreterInfo);
|
|
951
|
-
case 13:
|
|
952
706
|
case "end":
|
|
953
|
-
return
|
|
707
|
+
return _context11.stop();
|
|
954
708
|
}
|
|
955
|
-
},
|
|
709
|
+
}, _callee11, this, [[2, 8]]);
|
|
956
710
|
}));
|
|
957
|
-
function setOutputLanguage(_x17, _x18
|
|
711
|
+
function setOutputLanguage(_x16, _x17, _x18) {
|
|
958
712
|
return _setOutputLanguage.apply(this, arguments);
|
|
959
713
|
}
|
|
960
714
|
return setOutputLanguage;
|
|
@@ -962,83 +716,98 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
962
716
|
}, {
|
|
963
717
|
key: "subscribeLanguage",
|
|
964
718
|
value: function () {
|
|
965
|
-
var _subscribeLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
966
|
-
var
|
|
967
|
-
return _regenerator["default"].wrap(function
|
|
968
|
-
while (1) switch (
|
|
719
|
+
var _subscribeLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(language, successCallback, failureCallback) {
|
|
720
|
+
var hasSubscribedLanguageList, _subscribeLanguage2, removeLanguage;
|
|
721
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
722
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
969
723
|
case 0:
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
if (
|
|
974
|
-
|
|
724
|
+
_context12.prev = 0;
|
|
725
|
+
hasSubscribedLanguageList = this._sharedInterpreterDataSource.hasSubscribedLanguageList;
|
|
726
|
+
_subscribeLanguage2 = [];
|
|
727
|
+
if (hasSubscribedLanguageList.length === 2) {
|
|
728
|
+
if (language === _interpreter.ORIGIN) {
|
|
729
|
+
_subscribeLanguage2 = [_interpreter.ORIGIN];
|
|
730
|
+
} else {
|
|
731
|
+
_subscribeLanguage2 = [_interpreter.ORIGIN, language];
|
|
732
|
+
}
|
|
733
|
+
} else {
|
|
734
|
+
_subscribeLanguage2 = [language];
|
|
975
735
|
}
|
|
976
|
-
|
|
977
|
-
return this._updateSubscribeLanguage(
|
|
736
|
+
_context12.next = 6;
|
|
737
|
+
return this._updateSubscribeLanguage(_subscribeLanguage2);
|
|
978
738
|
case 6:
|
|
979
739
|
successCallback && successCallback();
|
|
980
|
-
|
|
981
|
-
// TODO
|
|
982
|
-
// 该方法会使`该方法会使` 时只有一种语言, 之前有的语言移除
|
|
983
|
-
if (this._hasSubscribedLanguageList.size === 1) {
|
|
984
|
-
this._hasSubscribedLanguageList.clear();
|
|
985
|
-
this._hasSubscribedLanguageList.add(language);
|
|
986
|
-
}
|
|
987
|
-
removeLanguage = subscribeLanguageList.find(function (ele) {
|
|
740
|
+
removeLanguage = hasSubscribedLanguageList.find(function (ele) {
|
|
988
741
|
return ele !== _interpreter.ORIGIN && ele !== language;
|
|
989
742
|
});
|
|
990
743
|
if (removeLanguage) {
|
|
991
|
-
this.
|
|
744
|
+
this._publishEvent.onLanguageUnsubscribed(removeLanguage);
|
|
992
745
|
}
|
|
993
|
-
this.
|
|
994
|
-
|
|
746
|
+
this._publishEvent.onLanguageSubscribed(language);
|
|
747
|
+
_context12.next = 15;
|
|
995
748
|
break;
|
|
996
|
-
case
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
failureCallback && failureCallback(
|
|
1000
|
-
case
|
|
749
|
+
case 12:
|
|
750
|
+
_context12.prev = 12;
|
|
751
|
+
_context12.t0 = _context12["catch"](0);
|
|
752
|
+
failureCallback && failureCallback(_context12.t0);
|
|
753
|
+
case 15:
|
|
1001
754
|
case "end":
|
|
1002
|
-
return
|
|
755
|
+
return _context12.stop();
|
|
1003
756
|
}
|
|
1004
|
-
},
|
|
757
|
+
}, _callee12, this, [[0, 12]]);
|
|
1005
758
|
}));
|
|
1006
|
-
function subscribeLanguage(_x20, _x21
|
|
759
|
+
function subscribeLanguage(_x19, _x20, _x21) {
|
|
1007
760
|
return _subscribeLanguage.apply(this, arguments);
|
|
1008
761
|
}
|
|
1009
762
|
return subscribeLanguage;
|
|
1010
763
|
}()
|
|
1011
764
|
}, {
|
|
1012
765
|
key: "subscribeExtraOriginLanguage",
|
|
1013
|
-
value: function
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
766
|
+
value: function () {
|
|
767
|
+
var _subscribeExtraOriginLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13(subscribe) {
|
|
768
|
+
var hasSubscribedLanguageList, subscribeLanguageList, isHasOrigin;
|
|
769
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
770
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
771
|
+
case 0:
|
|
772
|
+
hasSubscribedLanguageList = this._sharedInterpreterDataSource.hasSubscribedLanguageList;
|
|
773
|
+
subscribeLanguageList = hasSubscribedLanguageList.filter(function (language) {
|
|
774
|
+
return language !== _interpreter.ORIGIN;
|
|
775
|
+
});
|
|
776
|
+
subscribeLanguageList = subscribe ? [].concat((0, _toConsumableArray2["default"])(subscribeLanguageList), [_interpreter.ORIGIN]) : subscribeLanguageList;
|
|
777
|
+
if (subscribeLanguageList.length === 0) {
|
|
778
|
+
subscribeLanguageList = [_interpreter.ORIGIN];
|
|
779
|
+
}
|
|
780
|
+
_context13.next = 6;
|
|
781
|
+
return this._updateSubscribeLanguage(subscribeLanguageList);
|
|
782
|
+
case 6:
|
|
783
|
+
isHasOrigin = hasSubscribedLanguageList.includes(_interpreter.ORIGIN);
|
|
784
|
+
if (subscribe && !isHasOrigin) {
|
|
785
|
+
this._publishEvent.onLanguageSubscribed(_interpreter.ORIGIN);
|
|
786
|
+
}
|
|
787
|
+
if (!subscribe && isHasOrigin) {
|
|
788
|
+
this._publishEvent.onLanguageUnsubscribed(_interpreter.ORIGIN);
|
|
789
|
+
}
|
|
790
|
+
case 9:
|
|
791
|
+
case "end":
|
|
792
|
+
return _context13.stop();
|
|
793
|
+
}
|
|
794
|
+
}, _callee13, this);
|
|
795
|
+
}));
|
|
796
|
+
function subscribeExtraOriginLanguage(_x22) {
|
|
797
|
+
return _subscribeExtraOriginLanguage.apply(this, arguments);
|
|
1025
798
|
}
|
|
1026
|
-
|
|
799
|
+
return subscribeExtraOriginLanguage;
|
|
800
|
+
}()
|
|
1027
801
|
}, {
|
|
1028
802
|
key: "getHasSubscribedLanguageList",
|
|
1029
803
|
value: function getHasSubscribedLanguageList() {
|
|
1030
|
-
this.
|
|
1031
|
-
var hasSubscribedLanguageList = [];
|
|
1032
|
-
this._hasSubscribedLanguageList.forEach(function (ele) {
|
|
1033
|
-
hasSubscribedLanguageList.push(ele);
|
|
1034
|
-
});
|
|
1035
|
-
return hasSubscribedLanguageList;
|
|
804
|
+
return this._sharedInterpreterDataSource.hasSubscribedLanguageList;
|
|
1036
805
|
}
|
|
1037
806
|
}, {
|
|
1038
807
|
key: "userIsInterpreter",
|
|
1039
808
|
value: function userIsInterpreter(userId) {
|
|
1040
|
-
var
|
|
1041
|
-
return !!(
|
|
809
|
+
var interpreterUserList = this._interpreterControl.getInterpreterUserList();
|
|
810
|
+
return !!(interpreterUserList !== null && interpreterUserList !== void 0 && interpreterUserList.find(function (ele) {
|
|
1042
811
|
return ele.userId === userId;
|
|
1043
812
|
}));
|
|
1044
813
|
}
|
|
@@ -1059,12 +828,12 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
1059
828
|
}, {
|
|
1060
829
|
key: "getSubscribeLanguageList",
|
|
1061
830
|
value: function getSubscribeLanguageList() {
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1064
|
-
|
|
1065
|
-
|
|
831
|
+
var interpreterUserList = this._interpreterControl.getInterpreterUserList();
|
|
832
|
+
var hasSubscribedLanguageList = [_interpreter.ORIGIN];
|
|
833
|
+
interpreterUserList === null || interpreterUserList === void 0 || interpreterUserList.forEach(function (ele) {
|
|
834
|
+
hasSubscribedLanguageList.push(ele.sourceLanguage, ele.targetLanguage);
|
|
1066
835
|
});
|
|
1067
|
-
return
|
|
836
|
+
return hasSubscribedLanguageList;
|
|
1068
837
|
}
|
|
1069
838
|
}, {
|
|
1070
839
|
key: "getOutputLanguageOptionList",
|
|
@@ -1074,26 +843,26 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
1074
843
|
}, {
|
|
1075
844
|
key: "setInterpreterUsers",
|
|
1076
845
|
value: function () {
|
|
1077
|
-
var _setInterpreterUsers = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1078
|
-
return _regenerator["default"].wrap(function
|
|
1079
|
-
while (1) switch (
|
|
846
|
+
var _setInterpreterUsers = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14(params, successCallback, failureCallback) {
|
|
847
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
|
848
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1080
849
|
case 0:
|
|
1081
|
-
|
|
1082
|
-
|
|
850
|
+
_context14.prev = 0;
|
|
851
|
+
_context14.next = 3;
|
|
1083
852
|
return this._interpreterControl.setInterpreterUsers(params);
|
|
1084
853
|
case 3:
|
|
1085
854
|
successCallback && successCallback();
|
|
1086
|
-
|
|
855
|
+
_context14.next = 9;
|
|
1087
856
|
break;
|
|
1088
857
|
case 6:
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
failureCallback && failureCallback(
|
|
858
|
+
_context14.prev = 6;
|
|
859
|
+
_context14.t0 = _context14["catch"](0);
|
|
860
|
+
failureCallback && failureCallback(_context14.t0);
|
|
1092
861
|
case 9:
|
|
1093
862
|
case "end":
|
|
1094
|
-
return
|
|
863
|
+
return _context14.stop();
|
|
1095
864
|
}
|
|
1096
|
-
},
|
|
865
|
+
}, _callee14, this, [[0, 6]]);
|
|
1097
866
|
}));
|
|
1098
867
|
function setInterpreterUsers(_x23, _x24, _x25) {
|
|
1099
868
|
return _setInterpreterUsers.apply(this, arguments);
|
|
@@ -1134,8 +903,6 @@ var FcrUIInterpreterProviderImpl = exports.FcrUIInterpreterProviderImpl = /*#__P
|
|
|
1134
903
|
key: "release",
|
|
1135
904
|
value: function release() {
|
|
1136
905
|
this._clearRetryTaskTimer();
|
|
1137
|
-
this._clearTimer();
|
|
1138
|
-
this._deviceProvider.removeObserver(this._observerMicrophoneChanged);
|
|
1139
906
|
this._interpreterControl.removeObserver(this._observerInterpreter);
|
|
1140
907
|
}
|
|
1141
908
|
}]);
|