fcr-ui-scene 3.4.0 → 3.4.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/ scenes/base.d.ts +10 -0
- package/lib/ scenes/base.js +75 -0
- package/lib/ scenes/main-scene.d.ts +43 -0
- package/lib/ scenes/main-scene.js +368 -0
- package/lib/ scenes/waiting-scene.d.ts +31 -0
- package/lib/ scenes/waiting-scene.js +119 -0
- package/lib/common/device-store.d.ts +1 -2
- package/lib/common/device-store.js +169 -153
- package/lib/common/device-stream-store.d.ts +5 -29
- package/lib/common/device-stream-store.js +47 -93
- package/lib/common/room-store.js +4 -4
- package/lib/common/security-store.d.ts +6 -16
- package/lib/common/security-store.js +16 -17
- package/lib/common/type.d.ts +8 -0
- package/lib/common/type.js +6 -0
- package/lib/creator.js +3 -3
- package/lib/electron/app.js +21 -5
- package/lib/electron/bootstrap-sdk.js +1 -2
- package/lib/electron/injections.d.ts +1 -1
- package/lib/error-fallback.css +62 -0
- package/lib/error-fallback.d.ts +2 -0
- package/lib/error-fallback.js +19 -0
- package/lib/modules/Interpreter/action/delete-btn/index.d.ts +1 -1
- package/lib/modules/Interpreter/action/edit-btn/index.d.ts +0 -1
- package/lib/modules/Interpreter/action/edit-btn/index.js +0 -2
- package/lib/modules/Interpreter/action/switch-btn/index.css +3 -0
- package/lib/modules/Interpreter/action/switch-btn/index.d.ts +2 -4
- package/lib/modules/Interpreter/action/switch-btn/index.js +3 -3
- package/lib/modules/Interpreter/footer/index.css +4 -3
- package/lib/modules/Interpreter/index.d.ts +2 -17
- package/lib/modules/Interpreter/index.js +2 -18
- package/lib/modules/Interpreter/interpreter-list/index.css +5 -1
- package/lib/modules/Interpreter/interpreter-list/index.d.ts +1 -0
- package/lib/modules/Interpreter/interpreter-list/index.js +3 -1
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.css +0 -6
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.d.ts +1 -1
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.css +1 -3
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.d.ts +1 -6
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +55 -81
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/option-Item.d.ts +6 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/option-Item.js +58 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.d.ts +1 -1
- package/lib/modules/Interpreter/store.d.ts +36 -29
- package/lib/modules/Interpreter/store.js +575 -606
- package/lib/modules/Interpreter/type.d.ts +41 -0
- package/lib/modules/Interpreter/type.js +20 -0
- package/lib/modules/Interpreter/utils.d.ts +12 -0
- package/lib/modules/Interpreter/utils.js +139 -0
- package/lib/modules/Interpreter/view.d.ts +0 -1
- package/lib/modules/Interpreter/view.js +3 -5
- package/lib/modules/action-bar/action-bar-collapes-items.d.ts +1 -1
- package/lib/modules/action-bar/action-bar-collapes-items.js +11 -11
- package/lib/modules/action-bar/apps/useInterpreter.js +4 -2
- package/lib/modules/action-bar/components/apps/app-item/index.css +35 -0
- package/lib/modules/action-bar/components/apps/app-item/index.d.ts +12 -0
- package/lib/modules/action-bar/components/apps/app-item/index.js +61 -0
- package/lib/modules/action-bar/components/apps/appitems.d.ts +5 -0
- package/lib/modules/action-bar/components/apps/appitems.js +45 -0
- package/lib/modules/action-bar/components/apps/index.css +8 -0
- package/lib/modules/action-bar/components/apps/index.d.ts +4 -0
- package/lib/modules/action-bar/components/apps/index.js +57 -0
- package/lib/modules/action-bar/components/apps/useAppItemOptions.d.ts +9 -0
- package/lib/modules/action-bar/components/apps/useAppItemOptions.js +29 -0
- package/lib/modules/action-bar/components/apps/useBeautyBackground.d.ts +10 -0
- package/lib/modules/action-bar/components/apps/useBeautyBackground.js +36 -0
- package/lib/modules/action-bar/components/apps/useInterpreter.d.ts +14 -0
- package/lib/modules/action-bar/components/apps/useInterpreter.js +37 -0
- package/lib/modules/action-bar/components/apps/useLiveStreaming.d.ts +16 -0
- package/lib/modules/action-bar/components/apps/useLiveStreaming.js +41 -0
- package/lib/modules/action-bar/components/board/index.d.ts +4 -0
- package/lib/modules/action-bar/components/board/index.js +34 -0
- package/lib/modules/action-bar/components/breakout-room/index.d.ts +4 -0
- package/lib/modules/action-bar/components/breakout-room/index.js +32 -0
- package/lib/modules/action-bar/components/chat/index.css +80 -0
- package/lib/modules/action-bar/components/chat/index.d.ts +5 -0
- package/lib/modules/action-bar/components/chat/index.js +154 -0
- package/lib/modules/action-bar/components/device/index.css +162 -0
- package/lib/modules/action-bar/components/device/index.d.ts +8 -0
- package/lib/modules/action-bar/components/device/index.js +611 -0
- package/lib/modules/action-bar/components/interpreter/index.d.ts +6 -0
- package/lib/modules/action-bar/components/interpreter/index.js +41 -0
- package/lib/modules/action-bar/components/item.d.ts +27 -0
- package/lib/modules/action-bar/components/item.js +164 -0
- package/lib/modules/action-bar/components/leave/assign-host.d.ts +10 -0
- package/lib/modules/action-bar/components/leave/assign-host.js +64 -0
- package/lib/modules/action-bar/components/leave/index.css +126 -0
- package/lib/modules/action-bar/components/leave/index.d.ts +3 -0
- package/lib/modules/action-bar/components/leave/index.js +159 -0
- package/lib/modules/action-bar/components/leave/leave-meeting.d.ts +18 -0
- package/lib/modules/action-bar/components/leave/leave-meeting.js +153 -0
- package/lib/modules/action-bar/components/live-streaming/index.d.ts +4 -0
- package/lib/modules/action-bar/components/live-streaming/index.js +39 -0
- package/lib/modules/action-bar/components/more/index.css +114 -0
- package/lib/modules/action-bar/components/more/index.d.ts +5 -0
- package/lib/modules/action-bar/components/more/index.js +83 -0
- package/lib/modules/action-bar/components/more/poppover-content.d.ts +8 -0
- package/lib/modules/action-bar/components/more/poppover-content.js +400 -0
- package/lib/modules/action-bar/components/participants/index.css +21 -0
- package/lib/modules/action-bar/components/participants/index.d.ts +5 -0
- package/lib/modules/action-bar/components/participants/index.js +83 -0
- package/lib/modules/action-bar/components/record/index.css +39 -0
- package/lib/modules/action-bar/components/record/index.d.ts +5 -0
- package/lib/modules/action-bar/components/record/index.js +166 -0
- package/lib/modules/action-bar/components/record/stop-record-dialog.d.ts +5 -0
- package/lib/modules/action-bar/components/record/stop-record-dialog.js +48 -0
- package/lib/modules/action-bar/components/respond/index.d.ts +4 -0
- package/lib/modules/action-bar/components/respond/index.js +32 -0
- package/lib/modules/action-bar/components/screen-share/index.d.ts +4 -0
- package/lib/modules/action-bar/components/screen-share/index.js +106 -0
- package/lib/modules/action-bar/components/screen-share/submenu.d.ts +1 -0
- package/lib/modules/action-bar/components/screen-share/submenu.js +154 -0
- package/lib/modules/action-bar/components/security/index.d.ts +4 -0
- package/lib/modules/action-bar/components/security/index.js +58 -0
- package/lib/modules/action-bar/components/settings/index.d.ts +4 -0
- package/lib/modules/action-bar/components/settings/index.js +42 -0
- package/lib/modules/action-bar/index.css +23 -1
- package/lib/modules/action-bar/index.d.ts +2 -22
- package/lib/modules/action-bar/index.dev.js +37 -16
- package/lib/modules/action-bar/notification-bar/components/interpreter/index.css +58 -0
- package/lib/modules/action-bar/notification-bar/components/interpreter/index.d.ts +8 -0
- package/lib/modules/action-bar/notification-bar/components/interpreter/index.js +100 -0
- package/lib/modules/action-bar/notification-bar/components/virtual-image/index.css +56 -0
- package/lib/modules/action-bar/notification-bar/components/virtual-image/index.d.ts +5 -0
- package/lib/modules/action-bar/notification-bar/components/virtual-image/index.js +33 -0
- package/lib/modules/action-bar/notification-bar/dome.png +0 -0
- package/lib/modules/action-bar/notification-bar/fcr_translateswitch.png +0 -0
- package/lib/modules/action-bar/notification-bar/index.css +74 -0
- package/lib/modules/action-bar/notification-bar/index.d.ts +2 -0
- package/lib/modules/action-bar/notification-bar/index.js +99 -0
- package/lib/modules/action-bar/screen-share/index.js +5 -0
- package/lib/modules/action-bar/security/index.js +1 -0
- package/lib/modules/action-bar/smaller.js +2 -2
- package/lib/modules/action-bar/store.d.ts +6 -7
- package/lib/modules/action-bar/store.js +114 -128
- package/lib/modules/action-bar/trigger-input-language-room/fcr_translateswitch.png +0 -0
- package/lib/modules/action-bar/trigger-input-language-room/index.css +86 -0
- package/lib/modules/action-bar/trigger-input-language-room/index.d.ts +15 -0
- package/lib/modules/action-bar/trigger-input-language-room/index.js +220 -0
- package/lib/modules/action-bar/trigger-output-language-room/constant.d.ts +10 -0
- package/lib/modules/action-bar/trigger-output-language-room/constant.js +8 -0
- package/lib/modules/action-bar/trigger-output-language-room/guide-tooltip/index.css +22 -0
- package/lib/modules/action-bar/trigger-output-language-room/guide-tooltip/index.d.ts +14 -0
- package/lib/modules/action-bar/trigger-output-language-room/guide-tooltip/index.js +75 -0
- package/lib/modules/action-bar/trigger-output-language-room/index.d.ts +4 -0
- package/lib/modules/action-bar/trigger-output-language-room/index.js +98 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-language-room.d.ts +5 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-language-room.js +66 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-main-room.d.ts +5 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-main-room.js +36 -0
- package/lib/modules/action-bar/trigger-output-language-room/useChangeOutputRoomTool.d.ts +12 -0
- package/lib/modules/action-bar/trigger-output-language-room/useChangeOutputRoomTool.js +138 -0
- package/lib/modules/action-bar/view.js +6 -6
- package/lib/modules/audio-stream/index.d.ts +2 -15
- package/lib/modules/audio-stream/index.js +1 -3
- package/lib/modules/chat/chat-bar/index.css +5 -0
- package/lib/modules/chat/chat-bar/index.js +16 -14
- package/lib/modules/chat/chat-select/index.css +6 -3
- package/lib/modules/chat/chat.js +7 -6
- package/lib/modules/chat/index.css +10 -0
- package/lib/modules/chat/index.d.ts +2 -12
- package/lib/modules/chat/index.dev.js +14 -3
- package/lib/modules/chat/index.js +7 -20
- package/lib/modules/chat/message-list.js +1 -0
- package/lib/modules/chat/store.js +1 -1
- package/lib/modules/components/device-control/components/audio-menu/index.js +4 -4
- package/lib/modules/components/device-control/index.css +3 -0
- package/lib/modules/components/dialog-container/component/body.d.ts +7 -0
- package/lib/modules/components/dialog-container/component/body.js +46 -0
- package/lib/modules/components/dialog-container/index.css +78 -0
- package/lib/modules/components/dialog-container/index.d.ts +11 -0
- package/lib/modules/components/dialog-container/index.js +110 -0
- package/lib/modules/components/member-window/index.css +419 -0
- package/lib/modules/components/member-window/index.d.ts +76 -0
- package/lib/modules/components/member-window/index.js +888 -0
- package/lib/modules/components/security-menu/index.css +9 -0
- package/lib/modules/components/security-menu/index.js +74 -23
- package/lib/modules/components/tab-frame/index.css +40 -0
- package/lib/modules/components/tab-frame/index.d.ts +12 -0
- package/lib/modules/components/tab-frame/index.js +57 -0
- package/lib/modules/connection-gateway/components/computer/index.css +1 -0
- package/lib/modules/connection-gateway/components/phone/index.css +1 -1
- package/lib/modules/connection-gateway/index.d.ts +2 -9
- package/lib/modules/connection-gateway/store.d.ts +3 -11
- package/lib/modules/connection-gateway/store.js +1 -17
- package/lib/modules/connection-gateway/view.js +21 -4
- package/lib/modules/control-bar/components/cloud-recording-buttons.js +1 -1
- package/lib/modules/control-bar/index.d.ts +2 -16
- package/lib/modules/control-bar/index.js +10 -19
- package/lib/modules/control-bar/store.d.ts +3 -16
- package/lib/modules/control-bar/store.js +23 -5
- package/lib/modules/control-bar/view.js +17 -10
- package/lib/modules/device-pretest/settings/virtual-background-setting.js +1 -1
- package/lib/modules/dialog/components/Interpreter/electron.js +3 -25
- package/lib/modules/dialog/components/Interpreter/index.js +14 -43
- package/lib/modules/dialog/components/chat/electron.d.ts +1 -1
- package/lib/modules/dialog/components/chat/electron.js +6 -13
- package/lib/modules/dialog/components/chat/index.d.ts +1 -4
- package/lib/modules/dialog/components/chat/index.js +35 -41
- package/lib/modules/dialog/components/confirm/index.js +6 -7
- package/lib/modules/dialog/components/connection-gateway/electron.d.ts +1 -1
- package/lib/modules/dialog/components/connection-gateway/electron.js +9 -28
- package/lib/modules/dialog/components/connection-gateway/index.d.ts +0 -1
- package/lib/modules/dialog/components/connection-gateway/index.js +11 -56
- package/lib/modules/dialog/components/control-bar/index.js +6 -7
- package/lib/modules/dialog/components/device-setting/electron.js +4 -26
- package/lib/modules/dialog/components/device-setting/index.js +13 -41
- package/lib/modules/dialog/components/invite/index.js +16 -35
- package/lib/modules/dialog/components/live-streaming/index.js +18 -53
- package/lib/modules/dialog/components/participant/electron.js +4 -17
- package/lib/modules/dialog/components/participant/index.js +35 -26
- package/lib/modules/dialog/components/remove-admit-waiting-room/electron.js +3 -6
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.d.ts +1 -1
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.js +4 -14
- package/lib/modules/dialog/components/share-screen-selection/index.js +20 -5
- package/lib/modules/dialog/components/system-preference/electron.js +5 -8
- package/lib/modules/dialog/components/system-preference/index.js +4 -15
- package/lib/modules/dialog/components/toast/index.js +8 -12
- package/lib/modules/dialog/dialogs.js +2 -1
- package/lib/modules/dialog/hooks/useElectron.d.ts +6 -0
- package/lib/modules/dialog/hooks/useElectron.js +51 -9
- package/lib/modules/dialog/index.css +0 -2
- package/lib/modules/dialog/index.d.ts +2 -17
- package/lib/modules/dialog/store.d.ts +7 -39
- package/lib/modules/dialog/store.js +53 -152
- package/lib/modules/dialog/types/index.d.ts +59 -0
- package/lib/modules/event-confirm/view.js +4 -1
- package/lib/modules/invite/view.d.ts +4 -0
- package/lib/modules/invite/view.js +18 -22
- package/lib/modules/invite/voip-invite.js +3 -3
- package/lib/modules/layout/components/Aside.js +11 -1
- package/lib/modules/layout/components/Carousel.js +1 -1
- package/lib/modules/layout/components/Layout.js +7 -4
- package/lib/modules/layout/components/index.css +6 -1
- package/lib/modules/layout/index.js +8 -7
- package/lib/modules/layout/member-window/index.css +22 -9
- package/lib/modules/layout/member-window/index.js +16 -3
- package/lib/modules/layout/store.d.ts +1 -1
- package/lib/modules/layout/store.js +1 -7
- package/lib/modules/layout/video-window-datasource.js +11 -3
- package/lib/modules/notification/index.css +1 -0
- package/lib/modules/participant/attendee/index.css +1 -0
- package/lib/modules/participant/attendee/index.js +2 -1
- package/lib/modules/participant/components/drop-menu/index.css +1 -0
- package/lib/modules/participant/components/drop-menu/index.js +9 -9
- package/lib/modules/participant/index.css +5 -0
- package/lib/modules/participant/index.d.ts +2 -17
- package/lib/modules/participant/index.dev.js +38 -27
- package/lib/modules/participant/store.d.ts +4 -17
- package/lib/modules/participant/store.js +13 -13
- package/lib/modules/setting/audio-settings/audio-settings.js +13 -10
- package/lib/modules/setting/audio-settings/index.css +26 -1
- package/lib/modules/setting/general-settings/index.css +1 -1
- package/lib/modules/setting/index.css +2 -1
- package/lib/modules/setting/index.d.ts +2 -15
- package/lib/modules/setting/index.dev.js +19 -10
- package/lib/modules/setting/store.d.ts +5 -18
- package/lib/modules/setting/store.js +48 -20
- package/lib/modules/setting/translate-settings/index.css +3 -1
- package/lib/modules/setting/video-settings/index.css +5 -2
- package/lib/modules/share-screen/index.dev.js +20 -19
- package/lib/modules/share-screen/selection/index.css +2 -0
- package/lib/modules/share-screen/selection/index.js +83 -97
- package/lib/modules/share-screen/store.js +16 -36
- package/lib/modules/sound-effect/index.d.ts +2 -13
- package/lib/modules/sound-effect/index.js +1 -2
- package/lib/modules/state-bar/index.css +13 -2
- package/lib/modules/state-bar/index.d.ts +1 -5
- package/lib/modules/state-bar/index.dev.js +1 -1
- package/lib/modules/state-bar/index.js +0 -27
- package/lib/modules/state-bar/layout-config.js +1 -1
- package/lib/modules/state-bar/meeting-network-state.css +1 -1
- package/lib/modules/state-bar/recording.js +7 -4
- package/lib/modules/state-bar/view.js +1 -1
- package/lib/modules/video-window/index.d.ts +2 -2
- package/lib/modules/video-window/store.d.ts +2 -1
- package/lib/modules/video-window/store.js +2 -2
- package/lib/modules/waiting-room-layout/index.css +1 -3
- package/lib/modules/waiting-room-layout/index.d.ts +3 -1
- package/lib/modules/waiting-room-layout/index.js +10 -3
- package/lib/modules/whiteboard/index.d.ts +2 -13
- package/lib/modules/whiteboard/index.js +4 -5
- package/lib/providers/device-privilege-provider.d.ts +30 -0
- package/lib/providers/device-privilege-provider.js +386 -0
- package/lib/providers/device-provider.d.ts +246 -0
- package/lib/providers/device-provider.js +1741 -0
- package/lib/providers/device-stream-provider.d.ts +36 -0
- package/lib/providers/device-stream-provider.js +460 -0
- package/lib/providers/event-provider.d.ts +108 -0
- package/lib/providers/event-provider.js +288 -0
- package/lib/providers/interpreter-provider.d.ts +25 -0
- package/lib/providers/interpreter-provider.js +151 -0
- package/lib/providers/local-storage-provider.d.ts +8 -0
- package/lib/providers/local-storage-provider.js +31 -0
- package/lib/providers/monitor-provider.d.ts +15 -0
- package/lib/providers/monitor-provider.js +29 -0
- package/lib/providers/privilege-provider.d.ts +216 -0
- package/lib/providers/privilege-provider.js +966 -0
- package/lib/providers/renderer-provider.d.ts +43 -0
- package/lib/providers/renderer-provider.js +245 -0
- package/lib/providers/room-provider.d.ts +79 -0
- package/lib/providers/room-provider.js +439 -0
- package/lib/providers/session-provider.d.ts +26 -0
- package/lib/providers/session-provider.js +49 -0
- package/lib/runtime.d.ts +1 -1
- package/lib/scenes/base.d.ts +10 -0
- package/lib/scenes/base.js +75 -0
- package/lib/scenes/main-scene.d.ts +48 -0
- package/lib/scenes/main-scene.js +390 -0
- package/lib/scenes/waiting-scene.d.ts +31 -0
- package/lib/scenes/waiting-scene.js +129 -0
- package/lib/shared-data-source/config.d.ts +16 -0
- package/lib/shared-data-source/config.js +21 -0
- package/lib/type.d.ts +26 -1
- package/lib/ui-manager.d.ts +3 -0
- package/lib/ui-manager.js +154 -233
- package/lib/ui-node.d.ts +25 -0
- package/lib/ui-node.js +156 -0
- package/lib/utilities/constant.d.ts +15 -15
- package/lib/utilities/constant.js +15 -15
- package/lib/utilities/tools.d.ts +2 -0
- package/lib/utilities/tools.js +42 -10
- package/package.json +12 -11
- package/public/assets/fcr_leave2.svg +58 -0
- package/public/index.html +150 -13
|
@@ -37,11 +37,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
37
37
|
value: true
|
|
38
38
|
});
|
|
39
39
|
exports["default"] = exports.StoreContext = void 0;
|
|
40
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
41
40
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
42
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
43
41
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
44
42
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
43
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
45
44
|
require("core-js/modules/es.array.concat.js");
|
|
46
45
|
require("core-js/modules/es.array.every.js");
|
|
47
46
|
require("core-js/modules/es.array.filter.js");
|
|
@@ -52,6 +51,7 @@ require("core-js/modules/es.array.includes.js");
|
|
|
52
51
|
require("core-js/modules/es.array.iterator.js");
|
|
53
52
|
require("core-js/modules/es.array.map.js");
|
|
54
53
|
require("core-js/modules/es.array.push.js");
|
|
54
|
+
require("core-js/modules/es.array.some.js");
|
|
55
55
|
require("core-js/modules/es.array.sort.js");
|
|
56
56
|
require("core-js/modules/es.function.bind.js");
|
|
57
57
|
require("core-js/modules/es.object.keys.js");
|
|
@@ -65,12 +65,14 @@ require("core-js/modules/esnext.async-iterator.filter.js");
|
|
|
65
65
|
require("core-js/modules/esnext.async-iterator.find.js");
|
|
66
66
|
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
67
67
|
require("core-js/modules/esnext.async-iterator.map.js");
|
|
68
|
+
require("core-js/modules/esnext.async-iterator.some.js");
|
|
68
69
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
69
70
|
require("core-js/modules/esnext.iterator.every.js");
|
|
70
71
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
71
72
|
require("core-js/modules/esnext.iterator.find.js");
|
|
72
73
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
73
74
|
require("core-js/modules/esnext.iterator.map.js");
|
|
75
|
+
require("core-js/modules/esnext.iterator.some.js");
|
|
74
76
|
require("core-js/modules/esnext.set.add-all.js");
|
|
75
77
|
require("core-js/modules/esnext.set.delete-all.js");
|
|
76
78
|
require("core-js/modules/esnext.set.difference.v2.js");
|
|
@@ -99,6 +101,7 @@ require("core-js/modules/esnext.weak-map.emplace.js");
|
|
|
99
101
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
100
102
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
101
103
|
require("core-js/modules/web.timers.js");
|
|
104
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
102
105
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
103
106
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
104
107
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -113,15 +116,18 @@ var _constant = require("../../utilities/constant");
|
|
|
113
116
|
var _type2 = require("agora-rte-sdk/lib/core/scene/type");
|
|
114
117
|
var _type3 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
115
118
|
var _type4 = require("agora-rte-sdk/lib/type");
|
|
116
|
-
var _constant2 = require("./constant");
|
|
117
|
-
var _switchOutputLanguageRoom = require("../action-bar/switch-output-language-room");
|
|
118
119
|
var _logger = require("agora-foundation/lib/logger");
|
|
119
120
|
var _store = require("../action-bar/store");
|
|
120
121
|
var _react = require("react");
|
|
121
122
|
var _useLanguageConfig = require("./interpreter-list/interpreter-item/components/pick-language/useLanguageConfig");
|
|
123
|
+
var _constant2 = require("../action-bar/trigger-output-language-room/constant");
|
|
124
|
+
var _type5 = require("./type");
|
|
125
|
+
var _utils = require("./utils");
|
|
122
126
|
var _excluded = ["randomKey"];
|
|
123
127
|
var _InterpreterStore;
|
|
124
|
-
var _initProto, _init__isSpeaking,
|
|
128
|
+
var _initProto, _init__isSpeaking, _init__languageRoomLisByStatus, _init_localInterpreterUsers, _init_orgInterpreterUsers, _init_interpreterUsersEditState, _init_initUsers, _init_interpreterState, _init_currentDialogId, _init_retryTaskTimeoutId, _init__language, _openInterpreterStateDecs, _closeInterpreterStateDecs, _setInterpreterListEditStateDecs, _addInterpreterUsersDecs, _deleteInterpreterUsersDecs, _updateInterpreterUsersDecs, _queryInterpreterUsersDecs, _setMainRoomStreamDecs, _setLanguageRoomJoinOrLeaveDecs, _updateInterpreterDecs, _resetInterpreterDecs, _setInputLanguageRoomDecs, _initLanguageRoomListByStatusDecs, _updateLanguageRoomListByStatusDecs, _updateUserPropertiesDecs, _updateStreamsDecs, _triggerLanguageRoomStreamDecs, _handleOutputLanguageRoomDecs, _triggerOutputLanguageDecs, _joinInterpreterRoomDecs, _leaveInterpreterRoomDecs, _bindLocalMicrophoneIdDecs, _getInterpreterStateDecs, _openInterpreterDialogDecs, _closeInterpreterDialogDecs, _getLocalUserByInterpreterDecs, _checkIsSelfOperationDecs, _interpreterUsersUpdatedToastDecs, _interpreterStateUpdatedToastDecs, _openUpdateInterpreterStateToastDecs, _updateInterpreterUsersToastDecs, _interpreterUsersJoinToastDecs, _closeConfirmDialogDecs, _openUpdateLanguageDialogDecs, _openCreateInterpreterStatusToastDecs, _openCancelInterpreterStatusToastDecs, _getInitUsersDecs, _updateUsersDecs, _clearTimerDecs, _clearRetryTaskTimerDecs, _restoreVolumeByMainRoomDecs, _adjustMainRoomVolumeDecs, _onStreamVolumeIndicationUpdatedDecs, _ref;
|
|
129
|
+
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; }
|
|
130
|
+
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; }
|
|
125
131
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
126
132
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
127
133
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
@@ -132,14 +138,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
132
138
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
133
139
|
function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
134
140
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
|
|
135
|
-
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; }
|
|
136
|
-
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; }
|
|
137
|
-
// 生成本地翻译员初始值
|
|
138
|
-
var getInterpreterItem = function getInterpreterItem() {
|
|
139
|
-
return _objectSpread(_objectSpread({}, _constant2.initInterpreterItemModel), {}, {
|
|
140
|
-
randomKey: (0, _uuid.v4)()
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
141
|
var _A = /*#__PURE__*/new WeakMap();
|
|
144
142
|
var _B = /*#__PURE__*/new WeakMap();
|
|
145
143
|
var _C = /*#__PURE__*/new WeakMap();
|
|
@@ -148,12 +146,13 @@ var _E = /*#__PURE__*/new WeakMap();
|
|
|
148
146
|
var _F = /*#__PURE__*/new WeakMap();
|
|
149
147
|
var _G = /*#__PURE__*/new WeakMap();
|
|
150
148
|
var _H = /*#__PURE__*/new WeakMap();
|
|
151
|
-
|
|
149
|
+
var _I = /*#__PURE__*/new WeakMap();
|
|
150
|
+
var _J = /*#__PURE__*/new WeakMap();
|
|
151
|
+
_ref = (_openInterpreterStateDecs = [_mobx.action, _mobx.action.bound], _closeInterpreterStateDecs = [_mobx.action, _mobx.action.bound], _setInterpreterListEditStateDecs = [_mobx.action, _mobx.action.bound], _addInterpreterUsersDecs = [_mobx.action, _mobx.action.bound], _deleteInterpreterUsersDecs = [_mobx.action, _mobx.action.bound], _updateInterpreterUsersDecs = [_mobx.action, _mobx.action.bound], _queryInterpreterUsersDecs = [_mobx.action, _mobx.action.bound], _setMainRoomStreamDecs = [_mobx.action, _mobx.action.bound], _setLanguageRoomJoinOrLeaveDecs = [_mobx.action, _mobx.action.bound], _updateInterpreterDecs = [_mobx.action, _mobx.action.bound], _resetInterpreterDecs = [_mobx.action, _mobx.action.bound], _setInputLanguageRoomDecs = [_mobx.action, _mobx.action.bound], _initLanguageRoomListByStatusDecs = [_mobx.action, _mobx.action.bound], _updateLanguageRoomListByStatusDecs = [_mobx.action, _mobx.action.bound], _updateUserPropertiesDecs = [_mobx.action, _mobx.action.bound], _updateStreamsDecs = [_mobx.action, _mobx.action.bound], _triggerLanguageRoomStreamDecs = [_mobx.action, _mobx.action.bound], _handleOutputLanguageRoomDecs = [_mobx.action, _mobx.action.bound], _triggerOutputLanguageDecs = [_mobx.action, _mobx.action.bound], _joinInterpreterRoomDecs = [_mobx.action, _mobx.action.bound], _leaveInterpreterRoomDecs = [_mobx.action, _mobx.action.bound], _bindLocalMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _getInterpreterStateDecs = [_mobx.action, _mobx.action.bound], _openInterpreterDialogDecs = [_mobx.action, _mobx.action.bound], _closeInterpreterDialogDecs = [_mobx.action, _mobx.action.bound], _getLocalUserByInterpreterDecs = [_mobx.action, _mobx.action.bound], _checkIsSelfOperationDecs = [_mobx.action, _mobx.action.bound], _interpreterUsersUpdatedToastDecs = [_mobx.action, _mobx.action.bound], _interpreterStateUpdatedToastDecs = [_mobx.action, _mobx.action.bound], _openUpdateInterpreterStateToastDecs = [_mobx.action, _mobx.action.bound], _updateInterpreterUsersToastDecs = [_mobx.action, _mobx.action.bound], _interpreterUsersJoinToastDecs = [_mobx.action, _mobx.action.bound], _closeConfirmDialogDecs = [_mobx.action, _mobx.action.bound], _openUpdateLanguageDialogDecs = [_mobx.action, _mobx.action.bound], _openCreateInterpreterStatusToastDecs = [_mobx.action, _mobx.action.bound], _openCancelInterpreterStatusToastDecs = [_mobx.action, _mobx.action.bound], _getInitUsersDecs = [_mobx.action, _mobx.action.bound], _updateUsersDecs = [_mobx.action, _mobx.action.bound], _clearTimerDecs = [_mobx.action, _mobx.action.bound], _clearRetryTaskTimerDecs = [_mobx.action, _mobx.action.bound], _restoreVolumeByMainRoomDecs = [_mobx.action, _mobx.action.bound], _adjustMainRoomVolumeDecs = [_mobx.action, _mobx.action.bound], _onStreamVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
152
152
|
var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
153
153
|
function InterpreterStore(_ref2) {
|
|
154
154
|
var _this = this;
|
|
155
155
|
var roomControl = _ref2.roomControl,
|
|
156
|
-
interpreterControl = _ref2.interpreterControl,
|
|
157
156
|
uiEventStore = _ref2.uiEventStore,
|
|
158
157
|
deviceStore = _ref2.deviceStore,
|
|
159
158
|
roomStore = _ref2.roomStore,
|
|
@@ -170,7 +169,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
170
169
|
});
|
|
171
170
|
(0, _defineProperty2["default"])(this, "_confirmDialogs", new Set());
|
|
172
171
|
_classPrivateFieldInitSpec(this, _A, _init__isSpeaking(this, false));
|
|
173
|
-
_classPrivateFieldInitSpec(this, _B,
|
|
172
|
+
_classPrivateFieldInitSpec(this, _B, _init__languageRoomLisByStatus(this, []));
|
|
174
173
|
// 语言房间列表
|
|
175
174
|
_classPrivateFieldInitSpec(this, _C, _init_localInterpreterUsers(this, []));
|
|
176
175
|
// 本地同声传译列表
|
|
@@ -182,8 +181,10 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
182
181
|
// 历史用户列表
|
|
183
182
|
_classPrivateFieldInitSpec(this, _G, _init_interpreterState(this));
|
|
184
183
|
_classPrivateFieldInitSpec(this, _H, _init_currentDialogId(this, null));
|
|
184
|
+
_classPrivateFieldInitSpec(this, _I, _init_retryTaskTimeoutId(this, null));
|
|
185
|
+
_classPrivateFieldInitSpec(this, _J, _init__language(this, null));
|
|
185
186
|
this._mainRoomControl = roomControl;
|
|
186
|
-
this._interpreterControl =
|
|
187
|
+
this._interpreterControl = roomControl.getInterpreterControl();
|
|
187
188
|
this._uiEventStore = uiEventStore;
|
|
188
189
|
this._deviceStore = deviceStore;
|
|
189
190
|
this._roomStore = roomStore;
|
|
@@ -194,14 +195,14 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
194
195
|
this._localUser = this._userControl.getLocalUser();
|
|
195
196
|
this.interpreterState = this.getInterpreterState();
|
|
196
197
|
this._getInitUsers(); // 初始化历史参会者列表
|
|
197
|
-
this.
|
|
198
|
+
this._initLanguageRoomListByStatus(); // 初始化语言房间
|
|
198
199
|
this.interpreterUsersJoinToast();
|
|
199
200
|
this._interpreterControl.addObserver({
|
|
200
201
|
onInterpreterStateUpdated: function onInterpreterStateUpdated() {
|
|
202
|
+
_this._initLanguageRoomListByStatus();
|
|
201
203
|
_this.interpreterStateUpdatedToast.apply(_this, arguments);
|
|
202
204
|
_this.interpreterState = _this.getInterpreterState();
|
|
203
205
|
_this.queryInterpreterUsers(); // 查询同声传译列表
|
|
204
|
-
_this.updateLanguageRoomList();
|
|
205
206
|
},
|
|
206
207
|
onInterpreterUsersUpdated: function onInterpreterUsersUpdated(roomId, users, operatorUser) {
|
|
207
208
|
_this.interpreterUsersUpdatedToast(roomId, users, operatorUser);
|
|
@@ -209,7 +210,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
209
210
|
_this.interpreterUsersEditState = false;
|
|
210
211
|
},
|
|
211
212
|
onInterpreterRoomListUpdated: function onInterpreterRoomListUpdated() {
|
|
212
|
-
_this.
|
|
213
|
+
_this._initLanguageRoomListByStatus();
|
|
213
214
|
}
|
|
214
215
|
});
|
|
215
216
|
// 监听参会者人员变化
|
|
@@ -219,14 +220,14 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
219
220
|
_this._updateUsers({
|
|
220
221
|
roomId: roomId,
|
|
221
222
|
events: events
|
|
222
|
-
},
|
|
223
|
+
}, _type5.UpdateType.JOIN);
|
|
223
224
|
},
|
|
224
225
|
//成员离开
|
|
225
226
|
onRemoteUsersLeft: function onRemoteUsersLeft(roomId, events) {
|
|
226
227
|
_this._updateUsers({
|
|
227
228
|
roomId: roomId,
|
|
228
229
|
events: events
|
|
229
|
-
},
|
|
230
|
+
}, _type5.UpdateType.LEFT);
|
|
230
231
|
},
|
|
231
232
|
onUserInfoUpdated: function onUserInfoUpdated(roomId, event) {
|
|
232
233
|
_this._updateUsers({
|
|
@@ -236,13 +237,13 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
236
237
|
}
|
|
237
238
|
});
|
|
238
239
|
this._uiEventStore.addObserver({
|
|
239
|
-
onEvent: this.
|
|
240
|
+
onEvent: this._handleUiEvents.bind(this)
|
|
240
241
|
});
|
|
241
242
|
this._deviceStore.addObserver({
|
|
242
243
|
onMicrophoneChanged: function onMicrophoneChanged(microphoneId) {
|
|
243
244
|
var _this$_languageRoomLi;
|
|
244
|
-
(_this$_languageRoomLi = _this.
|
|
245
|
-
if (room.status ===
|
|
245
|
+
(_this$_languageRoomLi = _this._languageRoomLisByStatus) === null || _this$_languageRoomLi === void 0 || _this$_languageRoomLi.forEach(function (room) {
|
|
246
|
+
if (room.status === _type5.UpdateType.JOIN) {
|
|
246
247
|
_this.bindLocalMicrophoneId(room, microphoneId);
|
|
247
248
|
}
|
|
248
249
|
});
|
|
@@ -254,13 +255,33 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
254
255
|
_this._adjustMainRoomVolume(speaking);
|
|
255
256
|
}, {
|
|
256
257
|
delay: 500
|
|
257
|
-
}))
|
|
258
|
+
}), (0, _mobx.reaction)(function () {
|
|
259
|
+
return _this._deviceStore.microphoneEnabled;
|
|
260
|
+
}, /*#__PURE__*/function () {
|
|
261
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(microphoneEnabled) {
|
|
262
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
263
|
+
while (1) switch (_context.prev = _context.next) {
|
|
264
|
+
case 0:
|
|
265
|
+
if (!_this._language) {
|
|
266
|
+
_context.next = 3;
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
_context.next = 3;
|
|
270
|
+
return _this._updateStreams(_this._language, microphoneEnabled);
|
|
271
|
+
case 3:
|
|
272
|
+
case "end":
|
|
273
|
+
return _context.stop();
|
|
274
|
+
}
|
|
275
|
+
}, _callee);
|
|
276
|
+
}));
|
|
277
|
+
return function (_x) {
|
|
278
|
+
return _ref3.apply(this, arguments);
|
|
279
|
+
};
|
|
280
|
+
}()));
|
|
258
281
|
|
|
259
282
|
// @ts-ignore
|
|
260
283
|
window._interpreterStore = this;
|
|
261
284
|
}
|
|
262
|
-
|
|
263
|
-
// 同声传译——开关------------------------------------
|
|
264
285
|
return (0, _createClass2["default"])(InterpreterStore, [{
|
|
265
286
|
key: "_isSpeaking",
|
|
266
287
|
get: function get() {
|
|
@@ -270,7 +291,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
270
291
|
_classPrivateFieldSet(_A, this, v);
|
|
271
292
|
}
|
|
272
293
|
}, {
|
|
273
|
-
key: "
|
|
294
|
+
key: "_languageRoomLisByStatus",
|
|
274
295
|
get: function get() {
|
|
275
296
|
return _classPrivateFieldGet(_B, this);
|
|
276
297
|
},
|
|
@@ -325,6 +346,22 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
325
346
|
set: function set(v) {
|
|
326
347
|
_classPrivateFieldSet(_H, this, v);
|
|
327
348
|
}
|
|
349
|
+
}, {
|
|
350
|
+
key: "retryTaskTimeoutId",
|
|
351
|
+
get: function get() {
|
|
352
|
+
return _classPrivateFieldGet(_I, this);
|
|
353
|
+
},
|
|
354
|
+
set: function set(v) {
|
|
355
|
+
_classPrivateFieldSet(_I, this, v);
|
|
356
|
+
}
|
|
357
|
+
}, {
|
|
358
|
+
key: "_language",
|
|
359
|
+
get: function get() {
|
|
360
|
+
return _classPrivateFieldGet(_J, this);
|
|
361
|
+
},
|
|
362
|
+
set: function set(v) {
|
|
363
|
+
_classPrivateFieldSet(_J, this, v);
|
|
364
|
+
}
|
|
328
365
|
}, {
|
|
329
366
|
key: "hasEnableInterpreterPermission",
|
|
330
367
|
get: function get() {
|
|
@@ -335,15 +372,14 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
335
372
|
}, {
|
|
336
373
|
key: "interpreterUsersCheckPass",
|
|
337
374
|
get: function get() {
|
|
338
|
-
var
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
375
|
+
var remainingKeys = Object.keys(_type5.initInterpreterItemModel).filter(function (key) {
|
|
376
|
+
return key !== 'randomKey';
|
|
377
|
+
});
|
|
378
|
+
return this.localInterpreterUsers.every(function (obj) {
|
|
342
379
|
return remainingKeys.every(function (key) {
|
|
343
380
|
return obj[key] !== null && obj[key] !== undefined && obj[key] !== '';
|
|
344
381
|
});
|
|
345
382
|
});
|
|
346
|
-
return hasNonNullValuesExcludingKey;
|
|
347
383
|
}
|
|
348
384
|
|
|
349
385
|
// 同声传译列表-翻译官是否全部离线
|
|
@@ -351,13 +387,12 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
351
387
|
key: "interpreterUsersAllOffLine",
|
|
352
388
|
get: function get() {
|
|
353
389
|
var _this2 = this;
|
|
354
|
-
|
|
390
|
+
return this.localInterpreterUsers.every(function (ele) {
|
|
355
391
|
var _this2$initUsers$find;
|
|
356
392
|
return (_this2$initUsers$find = _this2.initUsers.find(function (item) {
|
|
357
393
|
return item.userId === ele.userId;
|
|
358
394
|
})) === null || _this2$initUsers$find === void 0 ? void 0 : _this2$initUsers$find.isOffLine;
|
|
359
395
|
});
|
|
360
|
-
return isAllOffLine;
|
|
361
396
|
}
|
|
362
397
|
|
|
363
398
|
// 语言列表
|
|
@@ -387,8 +422,6 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
387
422
|
this._interpreterControl.close();
|
|
388
423
|
this.closeInterpreterDialog();
|
|
389
424
|
}
|
|
390
|
-
|
|
391
|
-
// 同声传译——列表------------------------------------
|
|
392
425
|
}, {
|
|
393
426
|
key: "setInterpreterListEditState",
|
|
394
427
|
value: function
|
|
@@ -401,7 +434,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
401
434
|
value: function
|
|
402
435
|
//传译列表-增加
|
|
403
436
|
addInterpreterUsers() {
|
|
404
|
-
this.localInterpreterUsers = [].concat((0, _toConsumableArray2["default"])(this.localInterpreterUsers), [getInterpreterItem()]);
|
|
437
|
+
this.localInterpreterUsers = [].concat((0, _toConsumableArray2["default"])(this.localInterpreterUsers), [(0, _utils.getInterpreterItem)()]);
|
|
405
438
|
}
|
|
406
439
|
}, {
|
|
407
440
|
key: "deleteInterpreterUsers",
|
|
@@ -440,452 +473,405 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
440
473
|
});
|
|
441
474
|
})) || [];
|
|
442
475
|
this.orgInterpreterUsers = interpreterUsers;
|
|
443
|
-
this.localInterpreterUsers = interpreterUsers.length > 0 ? interpreterUsers : [getInterpreterItem()];
|
|
476
|
+
this.localInterpreterUsers = interpreterUsers.length > 0 ? interpreterUsers : [(0, _utils.getInterpreterItem)()];
|
|
444
477
|
}
|
|
445
|
-
// 同声传译——列表------------------------------------end
|
|
446
478
|
|
|
447
|
-
//
|
|
448
|
-
}, {
|
|
449
|
-
key: "updateInterpreterRoomStatus",
|
|
450
|
-
value: function () {
|
|
451
|
-
var _updateInterpreterRoomStatus = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(executeRoomList) {
|
|
452
|
-
var _this$_languageRoomLi2;
|
|
453
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
454
|
-
while (1) switch (_context.prev = _context.next) {
|
|
455
|
-
case 0:
|
|
456
|
-
this._languageRoomList = (_this$_languageRoomLi2 = this._languageRoomList) === null || _this$_languageRoomLi2 === void 0 ? void 0 : _this$_languageRoomLi2.map(function (ele) {
|
|
457
|
-
var executeRoom = executeRoomList.find(function (item) {
|
|
458
|
-
return item.language === ele.language;
|
|
459
|
-
}) || {};
|
|
460
|
-
return _objectSpread(_objectSpread({}, ele), executeRoom);
|
|
461
|
-
});
|
|
462
|
-
case 1:
|
|
463
|
-
case "end":
|
|
464
|
-
return _context.stop();
|
|
465
|
-
}
|
|
466
|
-
}, _callee, this);
|
|
467
|
-
}));
|
|
468
|
-
function updateInterpreterRoomStatus(_x) {
|
|
469
|
-
return _updateInterpreterRoomStatus.apply(this, arguments);
|
|
470
|
-
}
|
|
471
|
-
return updateInterpreterRoomStatus;
|
|
472
|
-
}() // #region checked
|
|
473
|
-
// 控制主房间说话
|
|
479
|
+
// 切换主房间音频流
|
|
474
480
|
}, {
|
|
475
|
-
key: "
|
|
481
|
+
key: "_setMainRoomStream",
|
|
476
482
|
value: function () {
|
|
477
|
-
var
|
|
483
|
+
var _setMainRoomStream2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref4) {
|
|
478
484
|
var _this3 = this;
|
|
479
|
-
var close,
|
|
485
|
+
var close, localStreamList, micStreams, streamId, streamsConfig;
|
|
480
486
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
481
487
|
while (1) switch (_context2.prev = _context2.next) {
|
|
482
488
|
case 0:
|
|
483
|
-
close =
|
|
484
|
-
this.
|
|
485
|
-
if (!this._mainRoomControl.getStreamControl()) {
|
|
486
|
-
_context2.next = 8;
|
|
487
|
-
break;
|
|
488
|
-
}
|
|
489
|
-
localStreamList = this._mainRoomControl.getStreamControl().getStreamsByUserId(this._mainRoomControl.getUserControl().getLocalUser().userId);
|
|
489
|
+
close = _ref4.close;
|
|
490
|
+
localStreamList = this._streamControl.getStreamsByUserId(this._localUser.userId);
|
|
490
491
|
micStreams = localStreamList.filter(function (ele) {
|
|
491
492
|
return ele.audioSourceType === _type4.AgoraRteAudioSourceType.MICROPHONE;
|
|
492
493
|
});
|
|
493
|
-
|
|
494
|
+
streamId = !!micStreams.length ? micStreams[0].streamId : null;
|
|
495
|
+
if (!streamId) {
|
|
494
496
|
_context2.next = 8;
|
|
495
497
|
break;
|
|
496
498
|
}
|
|
499
|
+
streamsConfig = (0, _defineProperty2["default"])({}, streamId, {
|
|
500
|
+
audioPrivilege: close ? _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
|
|
501
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
502
|
+
});
|
|
497
503
|
_context2.next = 8;
|
|
498
|
-
return (0,
|
|
499
|
-
return _this3.
|
|
500
|
-
audioPrivilege: close ? _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
|
|
501
|
-
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
502
|
-
}));
|
|
504
|
+
return (0, _utils.retryTask)(function () {
|
|
505
|
+
return _this3._streamControl.updatePublishPrivilegeOfStreams(streamsConfig);
|
|
503
506
|
}, this._retryTask);
|
|
504
507
|
case 8:
|
|
505
|
-
|
|
508
|
+
this.logger.info("interpreterLog- ".concat(close ? 'OFF' : 'ON', " mainRoom input streamsId ").concat(streamId));
|
|
506
509
|
case 9:
|
|
507
510
|
case "end":
|
|
508
511
|
return _context2.stop();
|
|
509
512
|
}
|
|
510
513
|
}, _callee2, this);
|
|
511
514
|
}));
|
|
512
|
-
function
|
|
513
|
-
return
|
|
515
|
+
function _setMainRoomStream(_x2) {
|
|
516
|
+
return _setMainRoomStream2.apply(this, arguments);
|
|
514
517
|
}
|
|
515
|
-
return
|
|
516
|
-
}() //
|
|
518
|
+
return _setMainRoomStream;
|
|
519
|
+
}() // 切换翻译官语言房间状态(加入或离开)
|
|
517
520
|
}, {
|
|
518
|
-
key: "
|
|
521
|
+
key: "_setLanguageRoomJoinOrLeave",
|
|
519
522
|
value: function () {
|
|
520
|
-
var
|
|
521
|
-
var languageRoomList, actionType,
|
|
523
|
+
var _setLanguageRoomJoinOrLeave2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref5) {
|
|
524
|
+
var languageRoomList, actionType, executeRoomList;
|
|
522
525
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
523
526
|
while (1) switch (_context3.prev = _context3.next) {
|
|
524
527
|
case 0:
|
|
525
|
-
languageRoomList =
|
|
526
|
-
|
|
527
|
-
executeRoomList =
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
break;
|
|
531
|
-
}
|
|
532
|
-
_languageRoomList = this._languageRoomList;
|
|
533
|
-
executeRoomList = languageRoomList.map(function (languageRoom) {
|
|
534
|
-
return _languageRoomList.find(function (ele) {
|
|
535
|
-
return ele.language === languageRoom.value;
|
|
528
|
+
languageRoomList = _ref5.languageRoomList, actionType = _ref5.actionType;
|
|
529
|
+
// 将需要切换的房间 映射成 携带关联状态的房间
|
|
530
|
+
executeRoomList = this._languageRoomLisByStatus.filter(function (_languageRoom) {
|
|
531
|
+
return languageRoomList.some(function (languageRoom) {
|
|
532
|
+
return languageRoom.value === _languageRoom.language;
|
|
536
533
|
});
|
|
537
|
-
}).filter(function (languageRoom) {
|
|
538
|
-
return !!languageRoom;
|
|
539
534
|
});
|
|
540
|
-
if (!(actionType ===
|
|
541
|
-
_context3.next =
|
|
535
|
+
if (!(actionType === _type5.UpdateType.JOIN)) {
|
|
536
|
+
_context3.next = 7;
|
|
542
537
|
break;
|
|
543
538
|
}
|
|
544
|
-
_context3.next =
|
|
539
|
+
_context3.next = 5;
|
|
545
540
|
return this.joinInterpreterRoom(executeRoomList);
|
|
546
|
-
case
|
|
547
|
-
_context3.next =
|
|
541
|
+
case 5:
|
|
542
|
+
_context3.next = 9;
|
|
548
543
|
break;
|
|
549
|
-
case
|
|
550
|
-
_context3.next =
|
|
544
|
+
case 7:
|
|
545
|
+
_context3.next = 9;
|
|
551
546
|
return this.leaveInterpreterRoom(executeRoomList);
|
|
552
|
-
case
|
|
553
|
-
callback && callback(executeRoomList);
|
|
554
|
-
_context3.next = 19;
|
|
555
|
-
break;
|
|
556
|
-
case 16:
|
|
557
|
-
_context3.prev = 16;
|
|
558
|
-
_context3.t0 = _context3["catch"](1);
|
|
559
|
-
callback && callback([]);
|
|
560
|
-
case 19:
|
|
547
|
+
case 9:
|
|
561
548
|
case "end":
|
|
562
549
|
return _context3.stop();
|
|
563
550
|
}
|
|
564
|
-
}, _callee3, this
|
|
551
|
+
}, _callee3, this);
|
|
565
552
|
}));
|
|
566
|
-
function
|
|
567
|
-
return
|
|
553
|
+
function _setLanguageRoomJoinOrLeave(_x3) {
|
|
554
|
+
return _setLanguageRoomJoinOrLeave2.apply(this, arguments);
|
|
568
555
|
}
|
|
569
|
-
return
|
|
570
|
-
}() //
|
|
556
|
+
return _setLanguageRoomJoinOrLeave;
|
|
557
|
+
}() // 开启了同声传译 或者 翻译官的语音发生了变化
|
|
571
558
|
}, {
|
|
572
|
-
key: "
|
|
559
|
+
key: "_updateInterpreter",
|
|
573
560
|
value: function () {
|
|
574
|
-
var
|
|
575
|
-
var
|
|
576
|
-
var rooms, newlanguageRoomList;
|
|
561
|
+
var _updateInterpreter2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref6) {
|
|
562
|
+
var callback, leftRoomList, joinRoomList, language;
|
|
577
563
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
578
564
|
while (1) switch (_context4.prev = _context4.next) {
|
|
579
565
|
case 0:
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
});
|
|
586
|
-
}).filter(function (room) {
|
|
587
|
-
var _this4$_languageRoomL;
|
|
588
|
-
return !((_this4$_languageRoomL = _this4._languageRoomList) !== null && _this4$_languageRoomL !== void 0 && _this4$_languageRoomL.find(function (preRomm) {
|
|
589
|
-
return preRomm.roomId === room.roomId;
|
|
590
|
-
}));
|
|
591
|
-
})) || [];
|
|
592
|
-
this._languageRoomList = [].concat((0, _toConsumableArray2["default"])(this._languageRoomList || []), (0, _toConsumableArray2["default"])(newlanguageRoomList));
|
|
566
|
+
callback = _ref6.callback, leftRoomList = _ref6.leftRoomList, joinRoomList = _ref6.joinRoomList, language = _ref6.language;
|
|
567
|
+
_context4.next = 3;
|
|
568
|
+
return this._setMainRoomStream({
|
|
569
|
+
close: true
|
|
570
|
+
});
|
|
593
571
|
case 3:
|
|
572
|
+
_context4.next = 5;
|
|
573
|
+
return this._setLanguageRoomJoinOrLeave({
|
|
574
|
+
actionType: _type5.UpdateType.LEFT,
|
|
575
|
+
languageRoomList: leftRoomList
|
|
576
|
+
});
|
|
577
|
+
case 5:
|
|
578
|
+
_context4.next = 7;
|
|
579
|
+
return this._setLanguageRoomJoinOrLeave({
|
|
580
|
+
actionType: _type5.UpdateType.JOIN,
|
|
581
|
+
languageRoomList: joinRoomList
|
|
582
|
+
});
|
|
583
|
+
case 7:
|
|
584
|
+
_context4.next = 9;
|
|
585
|
+
return this._triggerLanguageRoomStream({
|
|
586
|
+
language: language
|
|
587
|
+
});
|
|
588
|
+
case 9:
|
|
589
|
+
callback && callback();
|
|
590
|
+
case 10:
|
|
594
591
|
case "end":
|
|
595
592
|
return _context4.stop();
|
|
596
593
|
}
|
|
597
594
|
}, _callee4, this);
|
|
598
595
|
}));
|
|
599
|
-
function
|
|
600
|
-
return
|
|
596
|
+
function _updateInterpreter(_x4) {
|
|
597
|
+
return _updateInterpreter2.apply(this, arguments);
|
|
598
|
+
}
|
|
599
|
+
return _updateInterpreter;
|
|
600
|
+
}() //同声传译关闭 或者 翻译官身份被取消
|
|
601
|
+
}, {
|
|
602
|
+
key: "_resetInterpreter",
|
|
603
|
+
value: function () {
|
|
604
|
+
var _resetInterpreter2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref7) {
|
|
605
|
+
var languageRoomList;
|
|
606
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
607
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
608
|
+
case 0:
|
|
609
|
+
languageRoomList = _ref7.languageRoomList;
|
|
610
|
+
_context5.next = 3;
|
|
611
|
+
return this._setMainRoomStream({
|
|
612
|
+
close: false
|
|
613
|
+
});
|
|
614
|
+
case 3:
|
|
615
|
+
_context5.next = 5;
|
|
616
|
+
return this._setLanguageRoomJoinOrLeave({
|
|
617
|
+
actionType: _type5.UpdateType.LEFT,
|
|
618
|
+
languageRoomList: languageRoomList
|
|
619
|
+
});
|
|
620
|
+
case 5:
|
|
621
|
+
case "end":
|
|
622
|
+
return _context5.stop();
|
|
623
|
+
}
|
|
624
|
+
}, _callee5, this);
|
|
625
|
+
}));
|
|
626
|
+
function _resetInterpreter(_x5) {
|
|
627
|
+
return _resetInterpreter2.apply(this, arguments);
|
|
601
628
|
}
|
|
602
|
-
return
|
|
629
|
+
return _resetInterpreter;
|
|
630
|
+
}() // 点击了 trigger-output-language-room
|
|
631
|
+
}, {
|
|
632
|
+
key: "_setInputLanguageRoom",
|
|
633
|
+
value: function () {
|
|
634
|
+
var _setInputLanguageRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(_ref8) {
|
|
635
|
+
var _this$_languageRoomLi2;
|
|
636
|
+
var language, callback, room;
|
|
637
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
638
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
639
|
+
case 0:
|
|
640
|
+
language = _ref8.language, callback = _ref8.callback;
|
|
641
|
+
this._clearRetryTaskTimer(); // 清除当前重试任务
|
|
642
|
+
room = (_this$_languageRoomLi2 = this._languageRoomLisByStatus) === null || _this$_languageRoomLi2 === void 0 ? void 0 : _this$_languageRoomLi2.find(function (languageRoom) {
|
|
643
|
+
return languageRoom.language === language;
|
|
644
|
+
}); // 如果当前语言房间为未加入的状态
|
|
645
|
+
if (!(room && (room === null || room === void 0 ? void 0 : room.status) !== _type5.UpdateType.JOIN)) {
|
|
646
|
+
_context6.next = 6;
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
_context6.next = 6;
|
|
650
|
+
return this._setLanguageRoomJoinOrLeave({
|
|
651
|
+
actionType: _type5.UpdateType.JOIN,
|
|
652
|
+
languageRoomList: [{
|
|
653
|
+
value: room.language
|
|
654
|
+
}]
|
|
655
|
+
});
|
|
656
|
+
case 6:
|
|
657
|
+
_context6.next = 8;
|
|
658
|
+
return this._triggerLanguageRoomStream({
|
|
659
|
+
language: language
|
|
660
|
+
});
|
|
661
|
+
case 8:
|
|
662
|
+
callback && callback();
|
|
663
|
+
case 9:
|
|
664
|
+
case "end":
|
|
665
|
+
return _context6.stop();
|
|
666
|
+
}
|
|
667
|
+
}, _callee6, this);
|
|
668
|
+
}));
|
|
669
|
+
function _setInputLanguageRoom(_x6) {
|
|
670
|
+
return _setInputLanguageRoom2.apply(this, arguments);
|
|
671
|
+
}
|
|
672
|
+
return _setInputLanguageRoom;
|
|
673
|
+
}() // 初始化语言房间状态
|
|
674
|
+
}, {
|
|
675
|
+
key: "_initLanguageRoomListByStatus",
|
|
676
|
+
value: function () {
|
|
677
|
+
var _initLanguageRoomListByStatus2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
678
|
+
var _this4 = this;
|
|
679
|
+
var rooms, languageRoomLisByStatus;
|
|
680
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
681
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
682
|
+
case 0:
|
|
683
|
+
rooms = this._interpreterControl.getInterpreterRoomList(); //语言房间列表
|
|
684
|
+
if (rooms) {
|
|
685
|
+
languageRoomLisByStatus = rooms.map(function (ele) {
|
|
686
|
+
return _objectSpread(_objectSpread({}, ele), {}, {
|
|
687
|
+
control: _this4._interpreterControl.createRoomControl(ele.roomId),
|
|
688
|
+
status: _type5.UpdateType.LEFT
|
|
689
|
+
});
|
|
690
|
+
});
|
|
691
|
+
this._updateLanguageRoomListByStatus(languageRoomLisByStatus);
|
|
692
|
+
}
|
|
693
|
+
case 2:
|
|
694
|
+
case "end":
|
|
695
|
+
return _context7.stop();
|
|
696
|
+
}
|
|
697
|
+
}, _callee7, this);
|
|
698
|
+
}));
|
|
699
|
+
function _initLanguageRoomListByStatus() {
|
|
700
|
+
return _initLanguageRoomListByStatus2.apply(this, arguments);
|
|
701
|
+
}
|
|
702
|
+
return _initLanguageRoomListByStatus;
|
|
703
|
+
}() // 修改语言房间状态
|
|
704
|
+
}, {
|
|
705
|
+
key: "_updateLanguageRoomListByStatus",
|
|
706
|
+
value: function () {
|
|
707
|
+
var _updateLanguageRoomListByStatus2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(executeRoomList) {
|
|
708
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
709
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
710
|
+
case 0:
|
|
711
|
+
this._languageRoomLisByStatus = (0, _utils.mergeArrays)(this._languageRoomLisByStatus, executeRoomList, 'language');
|
|
712
|
+
case 1:
|
|
713
|
+
case "end":
|
|
714
|
+
return _context8.stop();
|
|
715
|
+
}
|
|
716
|
+
}, _callee8, this);
|
|
717
|
+
}));
|
|
718
|
+
function _updateLanguageRoomListByStatus(_x7) {
|
|
719
|
+
return _updateLanguageRoomListByStatus2.apply(this, arguments);
|
|
720
|
+
}
|
|
721
|
+
return _updateLanguageRoomListByStatus;
|
|
603
722
|
}()
|
|
604
723
|
}, {
|
|
605
724
|
key: "_updateUserProperties",
|
|
606
725
|
value: function () {
|
|
607
|
-
var _updateUserProperties2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
726
|
+
var _updateUserProperties2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(language) {
|
|
608
727
|
var interpreterLangCode;
|
|
609
|
-
return _regenerator["default"].wrap(function
|
|
610
|
-
while (1) switch (
|
|
728
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
729
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
611
730
|
case 0:
|
|
612
|
-
|
|
731
|
+
_context9.prev = 0;
|
|
613
732
|
interpreterLangCode = this._userControl.getUserPropertiesByKeyPath('interpreterLangCode', this._localUser.userId);
|
|
614
733
|
if (!(!language && !interpreterLangCode)) {
|
|
615
|
-
|
|
734
|
+
_context9.next = 4;
|
|
616
735
|
break;
|
|
617
736
|
}
|
|
618
|
-
return
|
|
737
|
+
return _context9.abrupt("return");
|
|
619
738
|
case 4:
|
|
620
|
-
|
|
739
|
+
_context9.next = 6;
|
|
621
740
|
return this._userControl.updateUserProperties({
|
|
622
741
|
interpreterLangCode: language
|
|
623
742
|
}, {}, this._localUser.userId);
|
|
624
743
|
case 6:
|
|
625
744
|
this.logger.info("interpreterLog- _updateUserProperties interpreterLangCode:".concat(language, " succeed"));
|
|
626
|
-
|
|
745
|
+
_context9.next = 12;
|
|
627
746
|
break;
|
|
628
747
|
case 9:
|
|
629
|
-
|
|
630
|
-
|
|
748
|
+
_context9.prev = 9;
|
|
749
|
+
_context9.t0 = _context9["catch"](0);
|
|
631
750
|
this.logger.info("interpreterLog- _updateUserProperties interpreterLangCode:".concat(language, " fail"));
|
|
632
751
|
case 12:
|
|
633
752
|
case "end":
|
|
634
|
-
return
|
|
753
|
+
return _context9.stop();
|
|
635
754
|
}
|
|
636
|
-
},
|
|
755
|
+
}, _callee9, this, [[0, 9]]);
|
|
637
756
|
}));
|
|
638
|
-
function _updateUserProperties(
|
|
757
|
+
function _updateUserProperties(_x8) {
|
|
639
758
|
return _updateUserProperties2.apply(this, arguments);
|
|
640
759
|
}
|
|
641
760
|
return _updateUserProperties;
|
|
642
|
-
}()
|
|
761
|
+
}()
|
|
643
762
|
}, {
|
|
644
|
-
key: "
|
|
763
|
+
key: "_updateStreams",
|
|
645
764
|
value: function () {
|
|
646
|
-
var
|
|
647
|
-
var
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
765
|
+
var _updateStreams2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(language, open) {
|
|
766
|
+
var _this$_languageRoomLi3,
|
|
767
|
+
_this5 = this;
|
|
768
|
+
var roomControl;
|
|
769
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
770
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
771
|
+
case 0:
|
|
772
|
+
roomControl = ((_this$_languageRoomLi3 = this._languageRoomLisByStatus.find(function (ele) {
|
|
773
|
+
return ele.language === language;
|
|
774
|
+
})) === null || _this$_languageRoomLi3 === void 0 ? void 0 : _this$_languageRoomLi3.control) || null;
|
|
775
|
+
_context10.next = 3;
|
|
776
|
+
return (0, _utils.retryTask)(function () {
|
|
777
|
+
return _this5._deviceStreamStore.updateStreams(roomControl, open);
|
|
778
|
+
}, this._retryTask);
|
|
779
|
+
case 3:
|
|
780
|
+
case "end":
|
|
781
|
+
return _context10.stop();
|
|
782
|
+
}
|
|
783
|
+
}, _callee10, this);
|
|
784
|
+
}));
|
|
785
|
+
function _updateStreams(_x9, _x10) {
|
|
786
|
+
return _updateStreams2.apply(this, arguments);
|
|
787
|
+
}
|
|
788
|
+
return _updateStreams;
|
|
789
|
+
}() // 切换语音房间流开关
|
|
790
|
+
}, {
|
|
791
|
+
key: "_triggerLanguageRoomStream",
|
|
792
|
+
value: function () {
|
|
793
|
+
var _triggerLanguageRoomStream2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(_ref9) {
|
|
794
|
+
var language, _this$_getLocalUserBy, interpreter, targetLanguage, sourceLanguage;
|
|
795
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
796
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
651
797
|
case 0:
|
|
652
|
-
language =
|
|
653
|
-
|
|
798
|
+
language = _ref9.language;
|
|
799
|
+
// 更新远端 翻译官选中的翻译房间
|
|
654
800
|
this._updateUserProperties(language);
|
|
655
|
-
|
|
656
|
-
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(open) {
|
|
657
|
-
var _this5$getLocalUserBy, interpreter, _this5$_languageRoomL, targetLanguage, targetLanguageRoomControl;
|
|
658
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
659
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
660
|
-
case 0:
|
|
661
|
-
_this5$getLocalUserBy = _this5.getLocalUserByInterpreter(), interpreter = _this5$getLocalUserBy.interpreter;
|
|
662
|
-
if (!interpreter) {
|
|
663
|
-
_context6.next = 7;
|
|
664
|
-
break;
|
|
665
|
-
}
|
|
666
|
-
targetLanguage = interpreter.targetLanguage;
|
|
667
|
-
targetLanguageRoomControl = (_this5$_languageRoomL = _this5._languageRoomList) === null || _this5$_languageRoomL === void 0 || (_this5$_languageRoomL = _this5$_languageRoomL.find(function (ele) {
|
|
668
|
-
return ele.language === targetLanguage;
|
|
669
|
-
})) === null || _this5$_languageRoomL === void 0 ? void 0 : _this5$_languageRoomL.control;
|
|
670
|
-
if (!targetLanguageRoomControl) {
|
|
671
|
-
_context6.next = 7;
|
|
672
|
-
break;
|
|
673
|
-
}
|
|
674
|
-
_context6.next = 7;
|
|
675
|
-
return (0, _constant2.retryTask)(function () {
|
|
676
|
-
return _this5._deviceStreamStore.updateStreams(targetLanguageRoomControl, open);
|
|
677
|
-
}, _this5._retryTask);
|
|
678
|
-
case 7:
|
|
679
|
-
case "end":
|
|
680
|
-
return _context6.stop();
|
|
681
|
-
}
|
|
682
|
-
}, _callee6);
|
|
683
|
-
}));
|
|
684
|
-
return function updateTargetLanguageStreams(_x6) {
|
|
685
|
-
return _ref6.apply(this, arguments);
|
|
686
|
-
};
|
|
687
|
-
}();
|
|
688
|
-
updateSourceLanguageStreams = /*#__PURE__*/function () {
|
|
689
|
-
var _ref7 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(open) {
|
|
690
|
-
var _this5$getLocalUserBy2, interpreter, _this5$_languageRoomL2, sourceLanguage, sourceLanguageRoomControl;
|
|
691
|
-
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
692
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
693
|
-
case 0:
|
|
694
|
-
_this5$getLocalUserBy2 = _this5.getLocalUserByInterpreter(), interpreter = _this5$getLocalUserBy2.interpreter;
|
|
695
|
-
if (!interpreter) {
|
|
696
|
-
_context7.next = 7;
|
|
697
|
-
break;
|
|
698
|
-
}
|
|
699
|
-
sourceLanguage = interpreter.sourceLanguage;
|
|
700
|
-
sourceLanguageRoomControl = (_this5$_languageRoomL2 = _this5._languageRoomList) === null || _this5$_languageRoomL2 === void 0 || (_this5$_languageRoomL2 = _this5$_languageRoomL2.find(function (ele) {
|
|
701
|
-
return ele.language === sourceLanguage;
|
|
702
|
-
})) === null || _this5$_languageRoomL2 === void 0 ? void 0 : _this5$_languageRoomL2.control;
|
|
703
|
-
if (!sourceLanguageRoomControl) {
|
|
704
|
-
_context7.next = 7;
|
|
705
|
-
break;
|
|
706
|
-
}
|
|
707
|
-
_context7.next = 7;
|
|
708
|
-
return (0, _constant2.retryTask)(function () {
|
|
709
|
-
return _this5._deviceStreamStore.updateStreams(sourceLanguageRoomControl, open);
|
|
710
|
-
}, _this5._retryTask);
|
|
711
|
-
case 7:
|
|
712
|
-
case "end":
|
|
713
|
-
return _context7.stop();
|
|
714
|
-
}
|
|
715
|
-
}, _callee7);
|
|
716
|
-
}));
|
|
717
|
-
return function updateSourceLanguageStreams(_x7) {
|
|
718
|
-
return _ref7.apply(this, arguments);
|
|
719
|
-
};
|
|
720
|
-
}();
|
|
721
|
-
outputLanguageList = (0, _toConsumableArray2["default"])(options);
|
|
722
|
-
_this$getLocalUserByI = this.getLocalUserByInterpreter(), interpreter = _this$getLocalUserByI.interpreter;
|
|
801
|
+
_this$_getLocalUserBy = this._getLocalUserByInterpreter(), interpreter = _this$_getLocalUserBy.interpreter;
|
|
723
802
|
if (!interpreter) {
|
|
724
|
-
|
|
803
|
+
_context11.next = 14;
|
|
725
804
|
break;
|
|
726
805
|
}
|
|
727
806
|
targetLanguage = interpreter.targetLanguage, sourceLanguage = interpreter.sourceLanguage;
|
|
728
|
-
|
|
729
|
-
openSourceLanguage = language === sourceLanguage;
|
|
730
|
-
updateTargetLanguage = function updateTargetLanguage() {
|
|
731
|
-
outputLanguageList = (0, _constant2.updateOutputLanguageList)({
|
|
732
|
-
outputLanguageList: outputLanguageList,
|
|
733
|
-
language: targetLanguage,
|
|
734
|
-
open: openTargetLanguage
|
|
735
|
-
});
|
|
736
|
-
};
|
|
737
|
-
updateSourceLanguage = function updateSourceLanguage() {
|
|
738
|
-
outputLanguageList = (0, _constant2.updateOutputLanguageList)({
|
|
739
|
-
outputLanguageList: outputLanguageList,
|
|
740
|
-
language: sourceLanguage,
|
|
741
|
-
open: openSourceLanguage
|
|
742
|
-
});
|
|
743
|
-
};
|
|
807
|
+
this._language = language;
|
|
744
808
|
if (!this._deviceStore.microphoneEnabled) {
|
|
745
|
-
|
|
809
|
+
_context11.next = 13;
|
|
746
810
|
break;
|
|
747
811
|
}
|
|
748
|
-
|
|
749
|
-
return
|
|
750
|
-
case
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
updateSourceLanguage();
|
|
756
|
-
_context8.next = 25;
|
|
812
|
+
_context11.next = 9;
|
|
813
|
+
return this._updateStreams(sourceLanguage, language === sourceLanguage);
|
|
814
|
+
case 9:
|
|
815
|
+
_context11.next = 11;
|
|
816
|
+
return this._updateStreams(targetLanguage, language === targetLanguage);
|
|
817
|
+
case 11:
|
|
818
|
+
_context11.next = 14;
|
|
757
819
|
break;
|
|
758
|
-
case
|
|
759
|
-
updateTargetLanguage();
|
|
760
|
-
updateSourceLanguage();
|
|
820
|
+
case 13:
|
|
761
821
|
this._uiEventStore.showToast({
|
|
762
822
|
type: 'info',
|
|
763
823
|
message: (0, _i18n.transI18n)('fmt_interpretation_interpreter_toast_label_open_micro')
|
|
764
824
|
});
|
|
765
|
-
case
|
|
766
|
-
sourceLanguageRoomControl = (_this$_languageRoomLi3 = this._languageRoomList) === null || _this$_languageRoomLi3 === void 0 || (_this$_languageRoomLi3 = _this$_languageRoomLi3.find(function (ele) {
|
|
767
|
-
return ele.language === sourceLanguage;
|
|
768
|
-
})) === null || _this$_languageRoomLi3 === void 0 ? void 0 : _this$_languageRoomLi3.control;
|
|
769
|
-
targetLanguageRoomControl = (_this$_languageRoomLi4 = this._languageRoomList) === null || _this$_languageRoomLi4 === void 0 || (_this$_languageRoomLi4 = _this$_languageRoomLi4.find(function (ele) {
|
|
770
|
-
return ele.language === targetLanguage;
|
|
771
|
-
})) === null || _this$_languageRoomLi4 === void 0 ? void 0 : _this$_languageRoomLi4.control;
|
|
772
|
-
if (sourceLanguageRoomControl && targetLanguageRoomControl) {
|
|
773
|
-
this._setInterpreterRoomControlInfo({
|
|
774
|
-
targetLanguageRoomControl: targetLanguageRoomControl,
|
|
775
|
-
sourceLanguageRoomControl: sourceLanguageRoomControl,
|
|
776
|
-
interpreter: interpreter,
|
|
777
|
-
language: language
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
callback && callback(outputLanguageList);
|
|
781
|
-
case 29:
|
|
782
|
-
case "end":
|
|
783
|
-
return _context8.stop();
|
|
784
|
-
}
|
|
785
|
-
}, _callee8, this);
|
|
786
|
-
}));
|
|
787
|
-
function changeInputLanguage(_x5) {
|
|
788
|
-
return _changeInputLanguage.apply(this, arguments);
|
|
789
|
-
}
|
|
790
|
-
return changeInputLanguage;
|
|
791
|
-
}()
|
|
792
|
-
}, {
|
|
793
|
-
key: "closeAllLanguageRoomInput",
|
|
794
|
-
value: function () {
|
|
795
|
-
var _closeAllLanguageRoomInput = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(_ref8) {
|
|
796
|
-
var _this6 = this;
|
|
797
|
-
var options, callback, _loop, index;
|
|
798
|
-
return _regenerator["default"].wrap(function _callee9$(_context10) {
|
|
799
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
800
|
-
case 0:
|
|
801
|
-
options = _ref8.options, callback = _ref8.callback;
|
|
802
|
-
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
|
803
|
-
var _this6$_languageRoomL;
|
|
804
|
-
var room, roomControl;
|
|
805
|
-
return _regenerator["default"].wrap(function _loop$(_context9) {
|
|
806
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
807
|
-
case 0:
|
|
808
|
-
room = options[index];
|
|
809
|
-
roomControl = (_this6$_languageRoomL = _this6._languageRoomList) === null || _this6$_languageRoomL === void 0 || (_this6$_languageRoomL = _this6$_languageRoomL.find(function (ele) {
|
|
810
|
-
return ele.language === room.value;
|
|
811
|
-
})) === null || _this6$_languageRoomL === void 0 ? void 0 : _this6$_languageRoomL.control;
|
|
812
|
-
if (!roomControl) {
|
|
813
|
-
_context9.next = 5;
|
|
814
|
-
break;
|
|
815
|
-
}
|
|
816
|
-
_context9.next = 5;
|
|
817
|
-
return (0, _constant2.retryTask)(function () {
|
|
818
|
-
return _this6._deviceStreamStore.updateStreams(roomControl, false);
|
|
819
|
-
}, _this6._retryTask);
|
|
820
|
-
case 5:
|
|
821
|
-
case "end":
|
|
822
|
-
return _context9.stop();
|
|
823
|
-
}
|
|
824
|
-
}, _loop);
|
|
825
|
-
});
|
|
826
|
-
index = 0;
|
|
827
|
-
case 3:
|
|
828
|
-
if (!(index < options.length)) {
|
|
829
|
-
_context10.next = 8;
|
|
830
|
-
break;
|
|
831
|
-
}
|
|
832
|
-
return _context10.delegateYield(_loop(), "t0", 5);
|
|
833
|
-
case 5:
|
|
834
|
-
index++;
|
|
835
|
-
_context10.next = 3;
|
|
836
|
-
break;
|
|
837
|
-
case 8:
|
|
838
|
-
callback && callback();
|
|
839
|
-
case 9:
|
|
825
|
+
case 14:
|
|
840
826
|
case "end":
|
|
841
|
-
return
|
|
827
|
+
return _context11.stop();
|
|
842
828
|
}
|
|
843
|
-
},
|
|
829
|
+
}, _callee11, this);
|
|
844
830
|
}));
|
|
845
|
-
function
|
|
846
|
-
return
|
|
831
|
+
function _triggerLanguageRoomStream(_x11) {
|
|
832
|
+
return _triggerLanguageRoomStream2.apply(this, arguments);
|
|
847
833
|
}
|
|
848
|
-
return
|
|
834
|
+
return _triggerLanguageRoomStream;
|
|
849
835
|
}()
|
|
850
836
|
}, {
|
|
851
837
|
key: "handleOutputLanguageRoom",
|
|
852
838
|
value: function () {
|
|
853
|
-
var _handleOutputLanguageRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
854
|
-
var
|
|
855
|
-
return _regenerator["default"].wrap(function
|
|
856
|
-
while (1) switch (
|
|
839
|
+
var _handleOutputLanguageRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(_ref10) {
|
|
840
|
+
var _languageRoomLisByStatus, language, interpreterRoomList, event, isInterpreterLanguageByOrgLanguage, languageRoom;
|
|
841
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
842
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
857
843
|
case 0:
|
|
858
|
-
|
|
844
|
+
_languageRoomLisByStatus = _ref10._languageRoomLisByStatus, language = _ref10.language, interpreterRoomList = _ref10.interpreterRoomList, event = _ref10.event;
|
|
859
845
|
isInterpreterLanguageByOrgLanguage = interpreterRoomList.includes(language);
|
|
860
|
-
languageRoom =
|
|
846
|
+
languageRoom = _languageRoomLisByStatus.find(function (ele) {
|
|
861
847
|
return ele.language === language;
|
|
862
848
|
});
|
|
863
849
|
if (!languageRoom) {
|
|
864
|
-
|
|
850
|
+
_context12.next = 16;
|
|
865
851
|
break;
|
|
866
852
|
}
|
|
867
853
|
if (!isInterpreterLanguageByOrgLanguage) {
|
|
868
|
-
|
|
854
|
+
_context12.next = 8;
|
|
869
855
|
break;
|
|
870
856
|
}
|
|
871
857
|
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
872
858
|
roomControl: languageRoom.control,
|
|
873
859
|
event: event
|
|
874
860
|
});
|
|
875
|
-
|
|
861
|
+
_context12.next = 15;
|
|
876
862
|
break;
|
|
877
863
|
case 8:
|
|
878
864
|
if (!(event === _store.EventType.STOP)) {
|
|
879
|
-
|
|
865
|
+
_context12.next = 13;
|
|
880
866
|
break;
|
|
881
867
|
}
|
|
882
|
-
|
|
868
|
+
_context12.next = 11;
|
|
883
869
|
return this.leaveInterpreterRoom([languageRoom], true);
|
|
884
870
|
case 11:
|
|
885
|
-
|
|
871
|
+
_context12.next = 15;
|
|
886
872
|
break;
|
|
887
873
|
case 13:
|
|
888
|
-
|
|
874
|
+
_context12.next = 15;
|
|
889
875
|
return this.joinInterpreterRoom([languageRoom], true);
|
|
890
876
|
case 15:
|
|
891
877
|
if (event === _store.EventType.STOP) {
|
|
@@ -899,212 +885,198 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
899
885
|
}
|
|
900
886
|
case 16:
|
|
901
887
|
case "end":
|
|
902
|
-
return
|
|
888
|
+
return _context12.stop();
|
|
903
889
|
}
|
|
904
|
-
},
|
|
890
|
+
}, _callee12, this);
|
|
905
891
|
}));
|
|
906
|
-
function handleOutputLanguageRoom(
|
|
892
|
+
function handleOutputLanguageRoom(_x12) {
|
|
907
893
|
return _handleOutputLanguageRoom.apply(this, arguments);
|
|
908
894
|
}
|
|
909
895
|
return handleOutputLanguageRoom;
|
|
910
|
-
}()
|
|
896
|
+
}()
|
|
911
897
|
}, {
|
|
912
|
-
key: "
|
|
898
|
+
key: "_setOutputLanguage",
|
|
913
899
|
value: function () {
|
|
914
|
-
var
|
|
915
|
-
var language, orgLanguage,
|
|
916
|
-
return _regenerator["default"].wrap(function
|
|
917
|
-
while (1) switch (
|
|
900
|
+
var _setOutputLanguage2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13(_ref11) {
|
|
901
|
+
var language, orgLanguage, _this$_getLocalUserBy2, interpreter, interpreterRoomList, targetLanguage, sourceLanguage;
|
|
902
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
903
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
918
904
|
case 0:
|
|
919
|
-
language =
|
|
920
|
-
this.
|
|
921
|
-
_context12.prev = 2;
|
|
922
|
-
if (!this._languageRoomList) {
|
|
923
|
-
_context12.next = 23;
|
|
924
|
-
break;
|
|
925
|
-
}
|
|
926
|
-
_this$getLocalUserByI2 = this.getLocalUserByInterpreter(), interpreter = _this$getLocalUserByI2.interpreter;
|
|
905
|
+
language = _ref11.language, orgLanguage = _ref11.orgLanguage;
|
|
906
|
+
_this$_getLocalUserBy2 = this._getLocalUserByInterpreter(), interpreter = _this$_getLocalUserBy2.interpreter;
|
|
927
907
|
interpreterRoomList = [];
|
|
928
908
|
if (interpreter) {
|
|
929
|
-
|
|
930
|
-
interpreterRoomList = [
|
|
909
|
+
targetLanguage = interpreter.targetLanguage, sourceLanguage = interpreter.sourceLanguage;
|
|
910
|
+
interpreterRoomList = [targetLanguage, sourceLanguage];
|
|
931
911
|
}
|
|
932
|
-
if (!(language ===
|
|
933
|
-
|
|
912
|
+
if (!(language === _constant2.CLOSE_ALL_LANGUAGE_ROOM && orgLanguage !== _constant2.CLOSE_ALL_LANGUAGE_ROOM)) {
|
|
913
|
+
_context13.next = 8;
|
|
934
914
|
break;
|
|
935
915
|
}
|
|
936
|
-
|
|
916
|
+
_context13.next = 7;
|
|
937
917
|
return this.handleOutputLanguageRoom({
|
|
938
|
-
|
|
918
|
+
_languageRoomLisByStatus: this._languageRoomLisByStatus,
|
|
939
919
|
interpreterRoomList: interpreterRoomList,
|
|
940
920
|
language: orgLanguage,
|
|
941
921
|
event: _store.EventType.STOP
|
|
942
922
|
});
|
|
943
|
-
case
|
|
923
|
+
case 7:
|
|
944
924
|
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_MAINROOM_REMOTE_AUDIO, {
|
|
945
925
|
event: _store.EventType.START
|
|
946
926
|
});
|
|
947
|
-
case
|
|
948
|
-
if (!(language !==
|
|
949
|
-
|
|
927
|
+
case 8:
|
|
928
|
+
if (!(language !== _constant2.CLOSE_ALL_LANGUAGE_ROOM && orgLanguage === _constant2.CLOSE_ALL_LANGUAGE_ROOM)) {
|
|
929
|
+
_context13.next = 12;
|
|
950
930
|
break;
|
|
951
931
|
}
|
|
952
|
-
|
|
932
|
+
_context13.next = 11;
|
|
953
933
|
return this.handleOutputLanguageRoom({
|
|
954
|
-
|
|
934
|
+
_languageRoomLisByStatus: this._languageRoomLisByStatus,
|
|
955
935
|
language: language,
|
|
956
936
|
interpreterRoomList: interpreterRoomList,
|
|
957
937
|
event: _store.EventType.START
|
|
958
938
|
});
|
|
959
|
-
case
|
|
939
|
+
case 11:
|
|
960
940
|
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_MAINROOM_REMOTE_AUDIO, {
|
|
961
941
|
event: _store.EventType.STOP
|
|
962
942
|
});
|
|
963
|
-
case
|
|
964
|
-
if (!(language !==
|
|
965
|
-
|
|
943
|
+
case 12:
|
|
944
|
+
if (!(language !== _constant2.CLOSE_ALL_LANGUAGE_ROOM && orgLanguage !== _constant2.CLOSE_ALL_LANGUAGE_ROOM)) {
|
|
945
|
+
_context13.next = 17;
|
|
966
946
|
break;
|
|
967
947
|
}
|
|
968
|
-
|
|
948
|
+
_context13.next = 15;
|
|
969
949
|
return this.handleOutputLanguageRoom({
|
|
970
|
-
|
|
950
|
+
_languageRoomLisByStatus: this._languageRoomLisByStatus,
|
|
971
951
|
language: language,
|
|
972
952
|
interpreterRoomList: interpreterRoomList,
|
|
973
953
|
event: _store.EventType.START
|
|
974
954
|
});
|
|
975
|
-
case
|
|
976
|
-
|
|
955
|
+
case 15:
|
|
956
|
+
_context13.next = 17;
|
|
977
957
|
return this.handleOutputLanguageRoom({
|
|
978
|
-
|
|
958
|
+
_languageRoomLisByStatus: this._languageRoomLisByStatus,
|
|
979
959
|
interpreterRoomList: interpreterRoomList,
|
|
980
960
|
language: orgLanguage,
|
|
981
961
|
event: _store.EventType.STOP
|
|
982
962
|
});
|
|
983
|
-
case
|
|
984
|
-
callback && callback(true);
|
|
985
|
-
_context12.next = 24;
|
|
986
|
-
break;
|
|
987
|
-
case 23:
|
|
988
|
-
callback && callback(false);
|
|
989
|
-
case 24:
|
|
990
|
-
_context12.next = 29;
|
|
991
|
-
break;
|
|
992
|
-
case 26:
|
|
993
|
-
_context12.prev = 26;
|
|
994
|
-
_context12.t0 = _context12["catch"](2);
|
|
995
|
-
callback && callback(false);
|
|
996
|
-
case 29:
|
|
963
|
+
case 17:
|
|
997
964
|
case "end":
|
|
998
|
-
return
|
|
965
|
+
return _context13.stop();
|
|
999
966
|
}
|
|
1000
|
-
},
|
|
967
|
+
}, _callee13, this);
|
|
1001
968
|
}));
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
969
|
+
function _setOutputLanguage(_x13) {
|
|
970
|
+
return _setOutputLanguage2.apply(this, arguments);
|
|
1004
971
|
}
|
|
1005
|
-
return
|
|
1006
|
-
}()
|
|
972
|
+
return _setOutputLanguage;
|
|
973
|
+
}() // 点击 trigger-output-language-room
|
|
1007
974
|
}, {
|
|
1008
|
-
key: "
|
|
1009
|
-
value: function
|
|
1010
|
-
var
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
975
|
+
key: "triggerOutputLanguage",
|
|
976
|
+
value: function () {
|
|
977
|
+
var _triggerOutputLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14(_ref12) {
|
|
978
|
+
var language, orgLanguage, callback, isChangeOutputByMainRoom;
|
|
979
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
|
980
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
981
|
+
case 0:
|
|
982
|
+
language = _ref12.language, orgLanguage = _ref12.orgLanguage, callback = _ref12.callback, isChangeOutputByMainRoom = _ref12.isChangeOutputByMainRoom;
|
|
983
|
+
this._clearRetryTaskTimer(); // 清除当前重试任务
|
|
984
|
+
_context14.next = 4;
|
|
985
|
+
return this._setOutputLanguage({
|
|
986
|
+
language: language,
|
|
987
|
+
orgLanguage: orgLanguage
|
|
988
|
+
});
|
|
989
|
+
case 4:
|
|
990
|
+
if (isChangeOutputByMainRoom) {
|
|
991
|
+
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_MAINROOM_REMOTE_AUDIO, {
|
|
992
|
+
event: _store.EventType.START
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
callback && callback();
|
|
996
|
+
case 6:
|
|
997
|
+
case "end":
|
|
998
|
+
return _context14.stop();
|
|
999
|
+
}
|
|
1000
|
+
}, _callee14, this);
|
|
1001
|
+
}));
|
|
1002
|
+
function triggerOutputLanguage(_x14) {
|
|
1003
|
+
return _triggerOutputLanguage.apply(this, arguments);
|
|
1024
1004
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
// 加入语言房间
|
|
1005
|
+
return triggerOutputLanguage;
|
|
1006
|
+
}() // 加入语言房间
|
|
1028
1007
|
}, {
|
|
1029
1008
|
key: "joinInterpreterRoom",
|
|
1030
1009
|
value: function () {
|
|
1031
|
-
var _joinInterpreterRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1032
|
-
var
|
|
1033
|
-
var _this$
|
|
1034
|
-
return _regenerator["default"].wrap(function
|
|
1035
|
-
while (1) switch (
|
|
1010
|
+
var _joinInterpreterRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15(executeRoomList, isToggleInterperterRemoteAudio) {
|
|
1011
|
+
var _this6 = this;
|
|
1012
|
+
var _this$_getLocalUserBy3, localUser, _loop, index;
|
|
1013
|
+
return _regenerator["default"].wrap(function _callee15$(_context16) {
|
|
1014
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1036
1015
|
case 0:
|
|
1037
|
-
_this$
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
while (1) switch (_context13.prev = _context13.next) {
|
|
1016
|
+
_this$_getLocalUserBy3 = this._getLocalUserByInterpreter(), localUser = _this$_getLocalUserBy3.localUser;
|
|
1017
|
+
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
|
1018
|
+
var room, params;
|
|
1019
|
+
return _regenerator["default"].wrap(function _loop$(_context15) {
|
|
1020
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1043
1021
|
case 0:
|
|
1044
1022
|
room = executeRoomList[index];
|
|
1045
|
-
|
|
1046
|
-
|
|
1023
|
+
params = {
|
|
1024
|
+
control: room.control,
|
|
1025
|
+
roomJoinOptions: {
|
|
1026
|
+
roomToken: '',
|
|
1027
|
+
streamLatency: _fcrCore.FcrStreamLatencyLevel.ULTRA_LOW,
|
|
1028
|
+
createStreamConfigs: [{
|
|
1029
|
+
videoSourceState: _type3.AgoraRtcMediaSourceState.CLOSE,
|
|
1030
|
+
audioSourceState: _type3.AgoraRtcMediaSourceState.CLOSE,
|
|
1031
|
+
videoSourceId: '',
|
|
1032
|
+
audioSourceId: '',
|
|
1033
|
+
streamName: 'default',
|
|
1034
|
+
streamType: _type2.AgoraRteMediaStreamType.NONE,
|
|
1035
|
+
videoSourceType: _type4.AgoraRteVideoSourceType.CAMERA,
|
|
1036
|
+
audioSourceType: _type4.AgoraRteAudioSourceType.MICROPHONE
|
|
1037
|
+
}],
|
|
1038
|
+
userName: localUser.userName,
|
|
1039
|
+
userRole: _type.FcrUserRole.PARTICIPANT
|
|
1040
|
+
},
|
|
1041
|
+
language: room.language,
|
|
1042
|
+
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio
|
|
1043
|
+
};
|
|
1044
|
+
if (!(room.status === _type5.UpdateType.LEFT)) {
|
|
1045
|
+
_context15.next = 8;
|
|
1047
1046
|
break;
|
|
1048
1047
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
control: room.control,
|
|
1054
|
-
roomJoinOptions: {
|
|
1055
|
-
roomToken: '',
|
|
1056
|
-
streamLatency: _fcrCore.FcrStreamLatencyLevel.ULTRA_LOW,
|
|
1057
|
-
createStreamConfigs: [{
|
|
1058
|
-
videoSourceState: _type3.AgoraRtcMediaSourceState.CLOSE,
|
|
1059
|
-
audioSourceState: _type3.AgoraRtcMediaSourceState.CLOSE,
|
|
1060
|
-
videoSourceId: '',
|
|
1061
|
-
audioSourceId: '',
|
|
1062
|
-
streamName: 'default',
|
|
1063
|
-
streamType: _type2.AgoraRteMediaStreamType.NONE,
|
|
1064
|
-
videoSourceType: _type4.AgoraRteVideoSourceType.CAMERA,
|
|
1065
|
-
audioSourceType: _type4.AgoraRteAudioSourceType.MICROPHONE
|
|
1066
|
-
}],
|
|
1067
|
-
userName: localUser.userName,
|
|
1068
|
-
// userRole: !!interpreter ? FcrUserRole.COHOST : FcrUserRole.PARTICIPANT,
|
|
1069
|
-
userRole: _type.FcrUserRole.PARTICIPANT
|
|
1070
|
-
},
|
|
1071
|
-
language: room.language,
|
|
1072
|
-
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio
|
|
1073
|
-
});
|
|
1074
|
-
}, _this7._retryTask);
|
|
1048
|
+
_context15.next = 5;
|
|
1049
|
+
return (0, _utils.retryTask)(function () {
|
|
1050
|
+
return _this6._roomStore.joinInterpreterRoom(params);
|
|
1051
|
+
}, _this6._retryTask);
|
|
1075
1052
|
case 5:
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
case 9:
|
|
1081
|
-
_this7.logger.info('非离开状态 无法加入房间', room);
|
|
1082
|
-
case 10:
|
|
1053
|
+
room.status = _type5.UpdateType.JOIN;
|
|
1054
|
+
_this6.bindLocalMicrophoneId(room);
|
|
1055
|
+
_this6._updateLanguageRoomListByStatus([room]);
|
|
1056
|
+
case 8:
|
|
1083
1057
|
case "end":
|
|
1084
|
-
return
|
|
1058
|
+
return _context15.stop();
|
|
1085
1059
|
}
|
|
1086
|
-
},
|
|
1060
|
+
}, _loop);
|
|
1087
1061
|
});
|
|
1088
1062
|
index = 0;
|
|
1089
|
-
case
|
|
1063
|
+
case 3:
|
|
1090
1064
|
if (!(index < executeRoomList.length)) {
|
|
1091
|
-
|
|
1065
|
+
_context16.next = 8;
|
|
1092
1066
|
break;
|
|
1093
1067
|
}
|
|
1094
|
-
return
|
|
1095
|
-
case
|
|
1068
|
+
return _context16.delegateYield(_loop(), "t0", 5);
|
|
1069
|
+
case 5:
|
|
1096
1070
|
index++;
|
|
1097
|
-
|
|
1071
|
+
_context16.next = 3;
|
|
1098
1072
|
break;
|
|
1099
|
-
case
|
|
1100
|
-
this.updateInterpreterRoomStatus(executeRoomList);
|
|
1101
|
-
case 10:
|
|
1073
|
+
case 8:
|
|
1102
1074
|
case "end":
|
|
1103
|
-
return
|
|
1075
|
+
return _context16.stop();
|
|
1104
1076
|
}
|
|
1105
|
-
},
|
|
1077
|
+
}, _callee15, this);
|
|
1106
1078
|
}));
|
|
1107
|
-
function joinInterpreterRoom(
|
|
1079
|
+
function joinInterpreterRoom(_x15, _x16) {
|
|
1108
1080
|
return _joinInterpreterRoom.apply(this, arguments);
|
|
1109
1081
|
}
|
|
1110
1082
|
return joinInterpreterRoom;
|
|
@@ -1112,77 +1084,86 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1112
1084
|
}, {
|
|
1113
1085
|
key: "leaveInterpreterRoom",
|
|
1114
1086
|
value: function () {
|
|
1115
|
-
var _leaveInterpreterRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1116
|
-
var
|
|
1117
|
-
var
|
|
1118
|
-
return _regenerator["default"].wrap(function
|
|
1119
|
-
while (1) switch (
|
|
1087
|
+
var _leaveInterpreterRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16(executeRoomList, isToggleInterperterRemoteAudio) {
|
|
1088
|
+
var _this7 = this;
|
|
1089
|
+
var _loop2, index;
|
|
1090
|
+
return _regenerator["default"].wrap(function _callee16$(_context18) {
|
|
1091
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1120
1092
|
case 0:
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
1093
|
+
_loop2 = /*#__PURE__*/_regenerator["default"].mark(function _loop2() {
|
|
1094
|
+
var room, params;
|
|
1095
|
+
return _regenerator["default"].wrap(function _loop2$(_context17) {
|
|
1096
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1126
1097
|
case 0:
|
|
1127
1098
|
room = executeRoomList[index];
|
|
1128
|
-
|
|
1129
|
-
|
|
1099
|
+
params = {
|
|
1100
|
+
control: room.control,
|
|
1101
|
+
language: room.language,
|
|
1102
|
+
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio
|
|
1103
|
+
};
|
|
1104
|
+
if (!(room.status === _type5.UpdateType.JOIN)) {
|
|
1105
|
+
_context17.next = 7;
|
|
1130
1106
|
break;
|
|
1131
1107
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
control: room.control,
|
|
1137
|
-
language: room.language,
|
|
1138
|
-
isToggleInterperterRemoteAudio: isToggleInterperterRemoteAudio
|
|
1139
|
-
});
|
|
1140
|
-
}, _this8._retryTask);
|
|
1108
|
+
_context17.next = 5;
|
|
1109
|
+
return (0, _utils.retryTask)(function () {
|
|
1110
|
+
return _this7._roomStore.leaveInterpreterRoom(params);
|
|
1111
|
+
}, _this7._retryTask);
|
|
1141
1112
|
case 5:
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
case 8:
|
|
1146
|
-
_this8.logger.info('非加入状态 无法离开房间', room);
|
|
1147
|
-
case 9:
|
|
1113
|
+
room.status = _type5.UpdateType.LEFT;
|
|
1114
|
+
_this7._updateLanguageRoomListByStatus([room]);
|
|
1115
|
+
case 7:
|
|
1148
1116
|
case "end":
|
|
1149
|
-
return
|
|
1117
|
+
return _context17.stop();
|
|
1150
1118
|
}
|
|
1151
|
-
},
|
|
1119
|
+
}, _loop2);
|
|
1152
1120
|
});
|
|
1153
1121
|
index = 0;
|
|
1154
|
-
case
|
|
1122
|
+
case 2:
|
|
1155
1123
|
if (!(index < executeRoomList.length)) {
|
|
1156
|
-
|
|
1124
|
+
_context18.next = 7;
|
|
1157
1125
|
break;
|
|
1158
1126
|
}
|
|
1159
|
-
return
|
|
1160
|
-
case
|
|
1127
|
+
return _context18.delegateYield(_loop2(), "t0", 4);
|
|
1128
|
+
case 4:
|
|
1161
1129
|
index++;
|
|
1162
|
-
|
|
1130
|
+
_context18.next = 2;
|
|
1163
1131
|
break;
|
|
1164
|
-
case
|
|
1165
|
-
this.updateInterpreterRoomStatus(executeRoomList);
|
|
1166
|
-
case 9:
|
|
1132
|
+
case 7:
|
|
1167
1133
|
case "end":
|
|
1168
|
-
return
|
|
1134
|
+
return _context18.stop();
|
|
1169
1135
|
}
|
|
1170
|
-
},
|
|
1136
|
+
}, _callee16);
|
|
1171
1137
|
}));
|
|
1172
|
-
function leaveInterpreterRoom(
|
|
1138
|
+
function leaveInterpreterRoom(_x17, _x18) {
|
|
1173
1139
|
return _leaveInterpreterRoom.apply(this, arguments);
|
|
1174
1140
|
}
|
|
1175
1141
|
return leaveInterpreterRoom;
|
|
1176
1142
|
}()
|
|
1143
|
+
}, {
|
|
1144
|
+
key: "bindLocalMicrophoneId",
|
|
1145
|
+
value: function bindLocalMicrophoneId(room, _microphoneId) {
|
|
1146
|
+
var microphoneId = _microphoneId || this._deviceStore.currentDeviceId.microphoneDeviceId;
|
|
1147
|
+
if (microphoneId) {
|
|
1148
|
+
var streamList = room.control.getStreamControl().getStreamsByUserId(room.control.getUserControl().getLocalUser().userId);
|
|
1149
|
+
var micStream = streamList.find(function (stream) {
|
|
1150
|
+
return stream.audioSourceType === _fcrCore.FcrAudioSourceType.MICROPHONE;
|
|
1151
|
+
});
|
|
1152
|
+
if (micStream && micStream.audioSourceId !== microphoneId) {
|
|
1153
|
+
var _room$control$getRoom;
|
|
1154
|
+
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));
|
|
1155
|
+
room.control.getStreamControl().bindLocalStreams([{
|
|
1156
|
+
streamId: micStream.streamId,
|
|
1157
|
+
audioSourceId: microphoneId
|
|
1158
|
+
}]);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1177
1162
|
}, {
|
|
1178
1163
|
key: "getInterpreterState",
|
|
1179
1164
|
value: function getInterpreterState() {
|
|
1180
1165
|
return this._interpreterControl.getState().enable;
|
|
1181
1166
|
}
|
|
1182
|
-
|
|
1183
|
-
// #endregion
|
|
1184
|
-
|
|
1185
|
-
// #region 工具方法
|
|
1186
1167
|
}, {
|
|
1187
1168
|
key: "openInterpreterDialog",
|
|
1188
1169
|
value: function
|
|
@@ -1204,10 +1185,10 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1204
1185
|
}
|
|
1205
1186
|
}
|
|
1206
1187
|
}, {
|
|
1207
|
-
key: "
|
|
1188
|
+
key: "_getLocalUserByInterpreter",
|
|
1208
1189
|
value: function
|
|
1209
1190
|
// 获取本地用户关联的翻译官信息
|
|
1210
|
-
|
|
1191
|
+
_getLocalUserByInterpreter() {
|
|
1211
1192
|
var localUser = this._localUser; // 本地用户信息
|
|
1212
1193
|
var interpreterUsers = this._interpreterControl.getInterpreterUserList(); //翻译官列表
|
|
1213
1194
|
var interpreter = interpreterUsers === null || interpreterUsers === void 0 ? void 0 : interpreterUsers.find(function (ele) {
|
|
@@ -1227,22 +1208,18 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1227
1208
|
var isSelfOperation = operatorUser.userId === userInfo.userId;
|
|
1228
1209
|
return isSelfOperation;
|
|
1229
1210
|
}
|
|
1230
|
-
|
|
1231
|
-
// #endregion
|
|
1232
|
-
|
|
1233
|
-
// #region 提示
|
|
1234
1211
|
}, {
|
|
1235
1212
|
key: "interpreterUsersUpdatedToast",
|
|
1236
1213
|
value: function () {
|
|
1237
|
-
var _interpreterUsersUpdatedToast = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1238
|
-
var _this$
|
|
1239
|
-
return _regenerator["default"].wrap(function
|
|
1240
|
-
while (1) switch (
|
|
1214
|
+
var _interpreterUsersUpdatedToast = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17(roomId, users, operatorUser) {
|
|
1215
|
+
var _this$_getLocalUserBy4, interpreter, localUser, preInterpreter, isUpdate;
|
|
1216
|
+
return _regenerator["default"].wrap(function _callee17$(_context19) {
|
|
1217
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1241
1218
|
case 0:
|
|
1242
1219
|
if (operatorUser) {
|
|
1243
1220
|
this.updateInterpreterUsersToast(roomId, users, operatorUser); // 列表更新提醒
|
|
1244
1221
|
}
|
|
1245
|
-
_this$
|
|
1222
|
+
_this$_getLocalUserBy4 = this._getLocalUserByInterpreter(), interpreter = _this$_getLocalUserBy4.interpreter, localUser = _this$_getLocalUserBy4.localUser;
|
|
1246
1223
|
preInterpreter = this.orgInterpreterUsers.find(function (ele) {
|
|
1247
1224
|
return ele.userId === localUser.userId;
|
|
1248
1225
|
});
|
|
@@ -1265,18 +1242,17 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1265
1242
|
if (preInterpreter) {
|
|
1266
1243
|
// 之前是翻译官
|
|
1267
1244
|
this.openCancelInterpreterStatusToast(); // 触发翻译官-取消提醒
|
|
1268
|
-
this._setInterpreterRoomControlInfo(null);
|
|
1269
1245
|
}
|
|
1270
1246
|
this._updateUserProperties('');
|
|
1271
1247
|
}
|
|
1272
1248
|
}
|
|
1273
1249
|
case 4:
|
|
1274
1250
|
case "end":
|
|
1275
|
-
return
|
|
1251
|
+
return _context19.stop();
|
|
1276
1252
|
}
|
|
1277
|
-
},
|
|
1253
|
+
}, _callee17, this);
|
|
1278
1254
|
}));
|
|
1279
|
-
function interpreterUsersUpdatedToast(
|
|
1255
|
+
function interpreterUsersUpdatedToast(_x19, _x20, _x21) {
|
|
1280
1256
|
return _interpreterUsersUpdatedToast.apply(this, arguments);
|
|
1281
1257
|
}
|
|
1282
1258
|
return interpreterUsersUpdatedToast;
|
|
@@ -1291,8 +1267,8 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1291
1267
|
}
|
|
1292
1268
|
}
|
|
1293
1269
|
if (state.enable) {
|
|
1294
|
-
var _this$
|
|
1295
|
-
interpreter = _this$
|
|
1270
|
+
var _this$_getLocalUserBy5 = this._getLocalUserByInterpreter(),
|
|
1271
|
+
interpreter = _this$_getLocalUserBy5.interpreter;
|
|
1296
1272
|
if (interpreter) {
|
|
1297
1273
|
this.openCreateInterpreterStatusToast(interpreter); // 触发翻译官-创建提醒
|
|
1298
1274
|
}
|
|
@@ -1306,13 +1282,13 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1306
1282
|
}, {
|
|
1307
1283
|
key: "openUpdateInterpreterStateToast",
|
|
1308
1284
|
value: function openUpdateInterpreterStateToast(roomId, state, operatorUser) {
|
|
1309
|
-
var
|
|
1285
|
+
var _this8 = this;
|
|
1310
1286
|
if (state.enable) {
|
|
1311
1287
|
this._uiEventStore.showNotification({
|
|
1312
1288
|
type: _eventStore.NotificationContentType.INTERPRETER_STATUS,
|
|
1313
1289
|
placement: 'topLeft',
|
|
1314
1290
|
onClose: function onClose() {
|
|
1315
|
-
|
|
1291
|
+
_this8._uiEventStore.sendEvent(_constant.UIAction.COLSE_NOTIFICATION, _eventStore.NotificationContentType.INTERPRETER_STATUS);
|
|
1316
1292
|
},
|
|
1317
1293
|
data: {
|
|
1318
1294
|
operatorUser: operatorUser,
|
|
@@ -1328,7 +1304,6 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1328
1304
|
reason1: operatorUser.userName
|
|
1329
1305
|
})
|
|
1330
1306
|
});
|
|
1331
|
-
this._setInterpreterRoomControlInfo(null);
|
|
1332
1307
|
}
|
|
1333
1308
|
}
|
|
1334
1309
|
// 同声传译-列表更新-Toast
|
|
@@ -1348,8 +1323,8 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1348
1323
|
}, {
|
|
1349
1324
|
key: "interpreterUsersJoinToast",
|
|
1350
1325
|
value: function interpreterUsersJoinToast() {
|
|
1351
|
-
var _this$
|
|
1352
|
-
interpreter = _this$
|
|
1326
|
+
var _this$_getLocalUserBy6 = this._getLocalUserByInterpreter(),
|
|
1327
|
+
interpreter = _this$_getLocalUserBy6.interpreter;
|
|
1353
1328
|
if (this.interpreterState && interpreter) {
|
|
1354
1329
|
var _this$_interpreterCon2;
|
|
1355
1330
|
var language = (_this$_interpreterCon2 = this._interpreterControl.getInterpreterRoomList()) === null || _this$_interpreterCon2 === void 0 ? void 0 : _this$_interpreterCon2[1].language;
|
|
@@ -1366,10 +1341,10 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1366
1341
|
}, {
|
|
1367
1342
|
key: "_closeConfirmDialog",
|
|
1368
1343
|
value: function _closeConfirmDialog() {
|
|
1369
|
-
var
|
|
1344
|
+
var _this9 = this;
|
|
1370
1345
|
this._confirmDialogs.forEach(function (dialogId) {
|
|
1371
|
-
dialogId &&
|
|
1372
|
-
|
|
1346
|
+
dialogId && _this9._uiEventStore.closeConfirm(dialogId);
|
|
1347
|
+
_this9._confirmDialogs["delete"](dialogId);
|
|
1373
1348
|
});
|
|
1374
1349
|
}
|
|
1375
1350
|
|
|
@@ -1377,7 +1352,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1377
1352
|
}, {
|
|
1378
1353
|
key: "openUpdateLanguageDialog",
|
|
1379
1354
|
value: function openUpdateLanguageDialog(interpreter) {
|
|
1380
|
-
var
|
|
1355
|
+
var _this10 = this;
|
|
1381
1356
|
this._closeConfirmDialog();
|
|
1382
1357
|
var dialogId = this._uiEventStore.openConfirmDialog({
|
|
1383
1358
|
title: (0, _i18n.transI18n)('fmt_interpretation_interpreter_popup_label_language_change_attention'),
|
|
@@ -1387,8 +1362,8 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1387
1362
|
}),
|
|
1388
1363
|
alignCenter: true,
|
|
1389
1364
|
onOk: function onOk() {
|
|
1390
|
-
|
|
1391
|
-
|
|
1365
|
+
_this10._uiEventStore.closeConfirm(dialogId);
|
|
1366
|
+
_this10._confirmDialogs["delete"](dialogId);
|
|
1392
1367
|
},
|
|
1393
1368
|
closable: false,
|
|
1394
1369
|
showCancel: false,
|
|
@@ -1403,7 +1378,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1403
1378
|
}, {
|
|
1404
1379
|
key: "openCreateInterpreterStatusToast",
|
|
1405
1380
|
value: function openCreateInterpreterStatusToast(interpreter) {
|
|
1406
|
-
var
|
|
1381
|
+
var _this11 = this;
|
|
1407
1382
|
this._closeConfirmDialog();
|
|
1408
1383
|
var dialogId = this._uiEventStore.openConfirmDialog({
|
|
1409
1384
|
title: (0, _i18n.transI18n)('fmt_interpretation_mobile_interpreter_popup_label_as_interpreter'),
|
|
@@ -1413,8 +1388,8 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1413
1388
|
}),
|
|
1414
1389
|
alignCenter: true,
|
|
1415
1390
|
onOk: function onOk() {
|
|
1416
|
-
|
|
1417
|
-
|
|
1391
|
+
_this11._uiEventStore.closeConfirm(dialogId);
|
|
1392
|
+
_this11._confirmDialogs["delete"](dialogId);
|
|
1418
1393
|
},
|
|
1419
1394
|
closable: false,
|
|
1420
1395
|
showCancel: false,
|
|
@@ -1429,7 +1404,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1429
1404
|
}, {
|
|
1430
1405
|
key: "openCancelInterpreterStatusToast",
|
|
1431
1406
|
value: function openCancelInterpreterStatusToast() {
|
|
1432
|
-
var
|
|
1407
|
+
var _this12 = this;
|
|
1433
1408
|
this._closeConfirmDialog();
|
|
1434
1409
|
var dialogId = this._uiEventStore.openConfirmDialog({
|
|
1435
1410
|
title: (0, _i18n.transI18n)('fmt_interpretation_mobile_interpreter_popup_label_permission_revoke'),
|
|
@@ -1439,8 +1414,8 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1439
1414
|
}),
|
|
1440
1415
|
alignCenter: true,
|
|
1441
1416
|
onOk: function onOk() {
|
|
1442
|
-
|
|
1443
|
-
|
|
1417
|
+
_this12._uiEventStore.closeConfirm(dialogId);
|
|
1418
|
+
_this12._confirmDialogs["delete"](dialogId);
|
|
1444
1419
|
},
|
|
1445
1420
|
closable: false,
|
|
1446
1421
|
showCancel: false,
|
|
@@ -1474,9 +1449,9 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1474
1449
|
}
|
|
1475
1450
|
}, {
|
|
1476
1451
|
key: "_updateUsers",
|
|
1477
|
-
value: function _updateUsers(
|
|
1478
|
-
var roomId =
|
|
1479
|
-
events =
|
|
1452
|
+
value: function _updateUsers(_ref13, type) {
|
|
1453
|
+
var roomId = _ref13.roomId,
|
|
1454
|
+
events = _ref13.events;
|
|
1480
1455
|
var initUsersCopy = (0, _toConsumableArray2["default"])(this.initUsers);
|
|
1481
1456
|
events.forEach(function (joinedEvent) {
|
|
1482
1457
|
var modifiedUser = joinedEvent.modifiedUser;
|
|
@@ -1487,7 +1462,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1487
1462
|
if (initUsersCopy[index]) {
|
|
1488
1463
|
if (type) {
|
|
1489
1464
|
initUsersCopy[index] = _objectSpread(_objectSpread(_objectSpread({}, initUsersCopy[index]), modifiedUser), {}, {
|
|
1490
|
-
isOffLine:
|
|
1465
|
+
isOffLine: _type5.UpdateType.LEFT === type
|
|
1491
1466
|
});
|
|
1492
1467
|
} else {
|
|
1493
1468
|
initUsersCopy[index] = _objectSpread(_objectSpread({}, initUsersCopy[index]), modifiedUser);
|
|
@@ -1495,7 +1470,7 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1495
1470
|
}
|
|
1496
1471
|
} else if (modifiedUser.connectorType === _type2.AgoraRteRoomConnectorType.NONE) {
|
|
1497
1472
|
initUsersCopy.push(_objectSpread(_objectSpread({}, modifiedUser), {}, {
|
|
1498
|
-
isOffLine:
|
|
1473
|
+
isOffLine: _type5.UpdateType.LEFT === type
|
|
1499
1474
|
}));
|
|
1500
1475
|
}
|
|
1501
1476
|
});
|
|
@@ -1533,16 +1508,16 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1533
1508
|
}, {
|
|
1534
1509
|
key: "_setMainRoomVolume",
|
|
1535
1510
|
value: function _setMainRoomVolume(volume) {
|
|
1536
|
-
var
|
|
1511
|
+
var _this13 = this;
|
|
1537
1512
|
this._streamControl.getStreamList().forEach(function (stream) {
|
|
1538
1513
|
var needSetVolume = [_type2.AgoraRteMediaStreamType.AUDIO, _type2.AgoraRteMediaStreamType.BOTH].includes(stream.streamType);
|
|
1539
|
-
if (needSetVolume)
|
|
1514
|
+
if (needSetVolume) _this13._streamControl.adjustRemoteAudioStreamVolume(stream.streamId, volume);
|
|
1540
1515
|
});
|
|
1541
1516
|
}
|
|
1542
1517
|
}, {
|
|
1543
1518
|
key: "_restoreVolumeByMainRoom",
|
|
1544
1519
|
value: function _restoreVolumeByMainRoom() {
|
|
1545
|
-
var
|
|
1520
|
+
var _this14 = this;
|
|
1546
1521
|
if (this._volumeTimerId) return;
|
|
1547
1522
|
var startValue = 25; // 主房间初始音量
|
|
1548
1523
|
var endValue = 100; // 最大音量
|
|
@@ -1555,15 +1530,15 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1555
1530
|
volume += steps;
|
|
1556
1531
|
if (volume >= endValue) {
|
|
1557
1532
|
volume = endValue;
|
|
1558
|
-
|
|
1533
|
+
_this14._clearTimer();
|
|
1559
1534
|
}
|
|
1560
|
-
|
|
1535
|
+
_this14._setMainRoomVolume(volume);
|
|
1561
1536
|
}, interval);
|
|
1562
1537
|
}
|
|
1563
1538
|
}, {
|
|
1564
1539
|
key: "_adjustMainRoomVolume",
|
|
1565
1540
|
value: function _adjustMainRoomVolume(speaking) {
|
|
1566
|
-
var
|
|
1541
|
+
var _this15 = this;
|
|
1567
1542
|
if (speaking) {
|
|
1568
1543
|
// HLD: 主房输出音量设置为25,语言房间设置输出音频为100
|
|
1569
1544
|
this._setMainRoomVolume(25);
|
|
@@ -1571,15 +1546,10 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1571
1546
|
} else {
|
|
1572
1547
|
// PRD: 参会人听到的是译员的声音及轻微的原始音频声音。当语言频道内 6 秒内没有译员发言,原始音频的音量将在接下来的 2 秒内逐渐放大到正常音量。
|
|
1573
1548
|
this._indicateTimerId = setTimeout(function () {
|
|
1574
|
-
|
|
1549
|
+
_this15._restoreVolumeByMainRoom();
|
|
1575
1550
|
}, 6000);
|
|
1576
1551
|
}
|
|
1577
1552
|
}
|
|
1578
|
-
}, {
|
|
1579
|
-
key: "_setInterpreterRoomControlInfo",
|
|
1580
|
-
value: function _setInterpreterRoomControlInfo(value) {
|
|
1581
|
-
this._deviceStreamStore.setInterpreterRoomControlInfo(value);
|
|
1582
|
-
}
|
|
1583
1553
|
}, {
|
|
1584
1554
|
key: "_onStreamVolumeIndicationUpdated",
|
|
1585
1555
|
value: function _onStreamVolumeIndicationUpdated(roomId, streamId, volume) {
|
|
@@ -1587,13 +1557,10 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1587
1557
|
this._isSpeaking = Math.floor(volume / 255 * 100) > 10;
|
|
1588
1558
|
}
|
|
1589
1559
|
}, {
|
|
1590
|
-
key: "
|
|
1591
|
-
value: function
|
|
1592
|
-
if (action === _constant.UIAction.
|
|
1593
|
-
this.
|
|
1594
|
-
}
|
|
1595
|
-
if (action === _constant.UIAction.CHANGE_INTERPRETER_OUTPUT_LANGUE) {
|
|
1596
|
-
this.changeOutputLanguage(payload);
|
|
1560
|
+
key: "_handleUiEvents",
|
|
1561
|
+
value: function _handleUiEvents(action, payload) {
|
|
1562
|
+
if (action === _constant.UIAction.TOGGLE_INTERPRETER_OUTPUT_LANGUE) {
|
|
1563
|
+
this.triggerOutputLanguage(payload);
|
|
1597
1564
|
}
|
|
1598
1565
|
if (action === _constant.UIAction.OPEN_INTERPRETER_DIALOG) {
|
|
1599
1566
|
this.openInterpreterDialog();
|
|
@@ -1601,14 +1568,14 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1601
1568
|
if (action === _constant.UIAction.CLOSE_INTERPRETER_DIALOG) {
|
|
1602
1569
|
this.closeInterpreterDialog();
|
|
1603
1570
|
}
|
|
1604
|
-
if (action === _constant.UIAction.
|
|
1605
|
-
this.
|
|
1571
|
+
if (action === _constant.UIAction.UPDATE_INTERPRETER) {
|
|
1572
|
+
this._updateInterpreter(payload);
|
|
1606
1573
|
}
|
|
1607
|
-
if (action === _constant.UIAction.
|
|
1608
|
-
this.
|
|
1574
|
+
if (action === _constant.UIAction.RESET_INTERPRETER) {
|
|
1575
|
+
this._resetInterpreter(payload);
|
|
1609
1576
|
}
|
|
1610
|
-
if (action === _constant.UIAction.
|
|
1611
|
-
this.
|
|
1577
|
+
if (action === _constant.UIAction.SET_INPUT_LANGUAGE_ROOM) {
|
|
1578
|
+
this._setInputLanguageRoom(payload);
|
|
1612
1579
|
}
|
|
1613
1580
|
if (action === _constant.UIAction.TOGGLE_MAINROOM_REMOTE_AUDIO) {
|
|
1614
1581
|
if ((payload === null || payload === void 0 ? void 0 : payload.action) === 'changeOutputByMainRoom') {
|
|
@@ -1619,14 +1586,16 @@ var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
|
1619
1586
|
}]);
|
|
1620
1587
|
}(); // #endregion
|
|
1621
1588
|
_InterpreterStore = InterpreterStore;
|
|
1622
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_InterpreterStore, [[_mobx.observable, 1, "_isSpeaking"], [_mobx.observable, 1, "
|
|
1589
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_InterpreterStore, [[_mobx.observable, 1, "_isSpeaking"], [_mobx.observable, 1, "_languageRoomLisByStatus"], [_mobx.observable, 1, "localInterpreterUsers"], [_mobx.observable, 1, "orgInterpreterUsers"], [_mobx.observable, 1, "interpreterUsersEditState"], [_mobx.observable, 1, "initUsers"], [_mobx.observable, 1, "interpreterState"], [_mobx.observable, 1, "currentDialogId"], [_mobx.observable, 1, "retryTaskTimeoutId"], [_mobx.observable, 1, "_language"], [_mobx.computed, 3, "hasEnableInterpreterPermission"], [_mobx.computed, 3, "interpreterUsersCheckPass"], [_mobx.computed, 3, "interpreterUsersAllOffLine"], [_mobx.computed, 3, "languageList"], [_openInterpreterStateDecs, 18, "openInterpreterState"], [_closeInterpreterStateDecs, 18, "closeInterpreterState"], [_setInterpreterListEditStateDecs, 18, "setInterpreterListEditState"], [_addInterpreterUsersDecs, 18, "addInterpreterUsers"], [_deleteInterpreterUsersDecs, 18, "deleteInterpreterUsers"], [_updateInterpreterUsersDecs, 18, "updateInterpreterUsers"], [_queryInterpreterUsersDecs, 18, "queryInterpreterUsers"], [_setMainRoomStreamDecs, 18, "_setMainRoomStream"], [_setLanguageRoomJoinOrLeaveDecs, 18, "_setLanguageRoomJoinOrLeave"], [_updateInterpreterDecs, 18, "_updateInterpreter"], [_resetInterpreterDecs, 18, "_resetInterpreter"], [_setInputLanguageRoomDecs, 18, "_setInputLanguageRoom"], [_initLanguageRoomListByStatusDecs, 18, "_initLanguageRoomListByStatus"], [_updateLanguageRoomListByStatusDecs, 18, "_updateLanguageRoomListByStatus"], [_updateUserPropertiesDecs, 18, "_updateUserProperties"], [_updateStreamsDecs, 18, "_updateStreams"], [_triggerLanguageRoomStreamDecs, 18, "_triggerLanguageRoomStream"], [_handleOutputLanguageRoomDecs, 18, "handleOutputLanguageRoom"], [_triggerOutputLanguageDecs, 18, "triggerOutputLanguage"], [_joinInterpreterRoomDecs, 18, "joinInterpreterRoom"], [_leaveInterpreterRoomDecs, 18, "leaveInterpreterRoom"], [_bindLocalMicrophoneIdDecs, 18, "bindLocalMicrophoneId"], [_getInterpreterStateDecs, 18, "getInterpreterState"], [_openInterpreterDialogDecs, 18, "openInterpreterDialog"], [_closeInterpreterDialogDecs, 18, "closeInterpreterDialog"], [_getLocalUserByInterpreterDecs, 18, "_getLocalUserByInterpreter"], [_checkIsSelfOperationDecs, 18, "checkIsSelfOperation"], [_interpreterUsersUpdatedToastDecs, 18, "interpreterUsersUpdatedToast"], [_interpreterStateUpdatedToastDecs, 18, "interpreterStateUpdatedToast"], [_openUpdateInterpreterStateToastDecs, 18, "openUpdateInterpreterStateToast"], [_updateInterpreterUsersToastDecs, 18, "updateInterpreterUsersToast"], [_interpreterUsersJoinToastDecs, 18, "interpreterUsersJoinToast"], [_closeConfirmDialogDecs, 18, "_closeConfirmDialog"], [_openUpdateLanguageDialogDecs, 18, "openUpdateLanguageDialog"], [_openCreateInterpreterStatusToastDecs, 18, "openCreateInterpreterStatusToast"], [_openCancelInterpreterStatusToastDecs, 18, "openCancelInterpreterStatusToast"], [_getInitUsersDecs, 18, "_getInitUsers"], [_updateUsersDecs, 18, "_updateUsers"], [_clearTimerDecs, 18, "_clearTimer"], [_clearRetryTaskTimerDecs, 18, "_clearRetryTaskTimer"], [_restoreVolumeByMainRoomDecs, 18, "_restoreVolumeByMainRoom"], [_adjustMainRoomVolumeDecs, 18, "_adjustMainRoomVolume"], [_onStreamVolumeIndicationUpdatedDecs, 18, "_onStreamVolumeIndicationUpdated"]], []).e, 11);
|
|
1623
1590
|
_init__isSpeaking = _applyDecs$e[0];
|
|
1624
|
-
|
|
1591
|
+
_init__languageRoomLisByStatus = _applyDecs$e[1];
|
|
1625
1592
|
_init_localInterpreterUsers = _applyDecs$e[2];
|
|
1626
1593
|
_init_orgInterpreterUsers = _applyDecs$e[3];
|
|
1627
1594
|
_init_interpreterUsersEditState = _applyDecs$e[4];
|
|
1628
1595
|
_init_initUsers = _applyDecs$e[5];
|
|
1629
1596
|
_init_interpreterState = _applyDecs$e[6];
|
|
1630
1597
|
_init_currentDialogId = _applyDecs$e[7];
|
|
1631
|
-
|
|
1598
|
+
_init_retryTaskTimeoutId = _applyDecs$e[8];
|
|
1599
|
+
_init__language = _applyDecs$e[9];
|
|
1600
|
+
_initProto = _applyDecs$e[10];
|
|
1632
1601
|
var StoreContext = exports.StoreContext = /*#__PURE__*/(0, _react.createContext)(null);
|