fcr-ui-scene 3.3.0 → 3.3.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/dist/electron/app.js +148 -0
- package/dist/electron/bootstrap-dev.js +51 -0
- package/dist/electron/bootstrap-sdk.js +56 -0
- package/dist/electron/default-options.js +25 -0
- package/dist/electron/env.js +13 -0
- package/dist/electron/index.js +20 -0
- package/dist/electron/injections.js +702 -0
- package/dist/electron/logger.js +66 -0
- package/dist/electron/main.js +67 -0
- package/dist/electron/plugins/meeting-state.js +39 -0
- package/dist/electron/plugins/screenshot.js +49 -0
- package/dist/electron/preload.js +36 -0
- package/dist/electron/tools.js +66 -0
- package/dist/electron/window.js +124 -0
- package/lib/common/room-store.d.ts +55 -0
- package/lib/common/room-store.js +395 -0
- package/lib/creator.js +2 -0
- package/lib/electron/app.js +8 -0
- package/lib/electron/bootstrap-sdk.js +1 -0
- package/lib/electron/injections.d.ts +1 -0
- package/lib/electron/injections.js +4 -1
- package/lib/electron/preload.js +2 -1
- package/lib/modules/Interpreter/add-button/index.css +4 -0
- package/lib/modules/Interpreter/add-button/index.d.ts +11 -0
- package/lib/modules/Interpreter/add-button/index.js +41 -0
- package/lib/modules/Interpreter/config.d.ts +16 -0
- package/lib/modules/Interpreter/config.js +17 -0
- package/lib/modules/Interpreter/constant.d.ts +44 -0
- package/lib/modules/Interpreter/constant.js +60 -0
- package/lib/modules/Interpreter/context.d.ts +2 -0
- package/lib/modules/Interpreter/context.js +9 -0
- package/lib/modules/Interpreter/dialog-content/index.css +33 -0
- package/lib/modules/Interpreter/dialog-content/index.d.ts +8 -0
- package/lib/modules/Interpreter/dialog-content/index.js +34 -0
- package/lib/modules/Interpreter/footer/components/interpreter-btn/index.d.ts +5 -0
- package/lib/modules/Interpreter/footer/components/interpreter-btn/index.js +56 -0
- package/lib/modules/Interpreter/footer/components/set-btn/index.d.ts +5 -0
- package/lib/modules/Interpreter/footer/components/set-btn/index.js +46 -0
- package/lib/modules/Interpreter/footer/components/tooltip-wrapper/index.d.ts +6 -0
- package/lib/modules/Interpreter/footer/components/tooltip-wrapper/index.js +28 -0
- package/lib/modules/Interpreter/footer/index.css +10 -0
- package/lib/modules/Interpreter/footer/index.d.ts +3 -0
- package/lib/modules/Interpreter/footer/index.js +35 -0
- package/lib/modules/Interpreter/index.css +8 -0
- package/lib/modules/Interpreter/index.d.ts +21 -0
- package/lib/modules/Interpreter/index.js +110 -0
- package/lib/modules/Interpreter/interpreter-list/index.css +21 -0
- package/lib/modules/Interpreter/interpreter-list/index.d.ts +3 -0
- package/lib/modules/Interpreter/interpreter-list/index.js +65 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.css +31 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.d.ts +11 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.js +141 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_ar.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_cn.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_de.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_en.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_es.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_fr.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_hi.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_id.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_it.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_jp.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_ko.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_ms.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_pt.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_ru.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_th.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_tr.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/images/fcr_vi.png +0 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/index.d.ts +11 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/useLanguageConfig/index.js +119 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.css +41 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.d.ts +12 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +118 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.css +34 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.d.ts +8 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.js +65 -0
- package/lib/modules/Interpreter/loading-wrapper/index.css +53 -0
- package/lib/modules/Interpreter/loading-wrapper/index.d.ts +6 -0
- package/lib/modules/Interpreter/loading-wrapper/index.js +28 -0
- package/lib/modules/Interpreter/store.d.ts +82 -0
- package/lib/modules/Interpreter/store.js +1382 -0
- package/lib/modules/Interpreter/view.d.ts +3 -0
- package/lib/modules/Interpreter/view.js +32 -0
- package/lib/modules/action-bar/Interpreter/index.d.ts +6 -0
- package/lib/modules/action-bar/Interpreter/index.js +44 -0
- package/lib/modules/action-bar/apps/appitems.d.ts +2 -0
- package/lib/modules/action-bar/apps/appitems.js +40 -0
- package/lib/modules/action-bar/apps/index.css +6 -0
- package/lib/modules/action-bar/apps/index.d.ts +4 -0
- package/lib/modules/action-bar/apps/index.js +58 -0
- package/lib/modules/action-bar/switch-input-language-room/fcr_translateswitch.png +0 -0
- package/lib/modules/action-bar/switch-input-language-room/index.css +86 -0
- package/lib/modules/action-bar/switch-input-language-room/index.d.ts +17 -0
- package/lib/modules/action-bar/switch-input-language-room/index.js +145 -0
- package/lib/modules/action-bar/switch-output-language-room/drop-menu.d.ts +1 -0
- package/lib/modules/action-bar/switch-output-language-room/drop-menu.js +197 -0
- package/lib/modules/action-bar/switch-output-language-room/guide-tooltip/index.css +18 -0
- package/lib/modules/action-bar/switch-output-language-room/guide-tooltip/index.d.ts +8 -0
- package/lib/modules/action-bar/switch-output-language-room/guide-tooltip/index.js +59 -0
- package/lib/modules/action-bar/switch-output-language-room/index.d.ts +12 -0
- package/lib/modules/action-bar/switch-output-language-room/index.js +238 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/components/interpreter/index.css +54 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/components/interpreter/index.d.ts +8 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/components/interpreter/index.js +94 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/components/virtual-image/index.css +8 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/components/virtual-image/index.d.ts +4 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/components/virtual-image/index.js +31 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/dome.png +0 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/fcr_translateswitch.png +0 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/index.css +71 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/index.d.ts +2 -0
- package/lib/modules/action-bar/switch-output-language-room/notification-bar/index.js +82 -0
- package/lib/modules/dialog/components/Interpreter/electron.d.ts +2 -0
- package/lib/modules/dialog/components/Interpreter/electron.js +72 -0
- package/lib/modules/dialog/components/Interpreter/index.css +30 -0
- package/lib/modules/dialog/components/Interpreter/index.d.ts +4 -0
- package/lib/modules/dialog/components/Interpreter/index.js +61 -0
- package/lib/modules/dialog/components/Interpreter/user-queue/index.css +36 -0
- package/lib/modules/dialog/components/Interpreter/user-queue/index.d.ts +3 -0
- package/lib/modules/dialog/components/Interpreter/user-queue/index.js +47 -0
- package/lib/modules/dialog/components/switch-language-channels/electron.d.ts +2 -0
- package/lib/modules/dialog/components/switch-language-channels/electron.js +72 -0
- package/lib/modules/dialog/components/switch-language-channels/index.css +30 -0
- package/lib/modules/dialog/components/switch-language-channels/index.d.ts +4 -0
- package/lib/modules/dialog/components/switch-language-channels/index.js +63 -0
- package/lib/modules/dialog/components/switch-language-channels/user-queue/index.css +36 -0
- package/lib/modules/dialog/components/switch-language-channels/user-queue/index.d.ts +3 -0
- package/lib/modules/dialog/components/switch-language-channels/user-queue/index.js +47 -0
- package/lib/modules/notification/context.d.ts +2 -0
- package/lib/modules/notification/context.js +9 -0
- package/lib/modules/notification/index.css +58 -0
- package/lib/modules/notification/index.d.ts +15 -0
- package/lib/modules/notification/index.js +51 -0
- package/lib/modules/notification/interpreter-status/index.css +72 -0
- package/lib/modules/notification/interpreter-status/index.d.ts +3 -0
- package/lib/modules/notification/interpreter-status/index.js +59 -0
- package/lib/modules/notification/store.d.ts +16 -0
- package/lib/modules/notification/store.js +127 -0
- package/lib/modules/notification/view.d.ts +10 -0
- package/lib/modules/notification/view.js +116 -0
- package/lib/modules/state-bar/meeting-details.js +4 -3
- package/lib/modules/state-bar/store.d.ts +1 -0
- package/lib/modules/state-bar/store.js +15 -3
- package/lib/modules/state-bar/view.js +6 -4
- package/lib/plugins/browser-runtime-plugin.js +4 -1
- package/lib/runtime.d.ts +1 -0
- package/package.json +5 -5
- package/public/index.html +7 -2
|
@@ -0,0 +1,1382 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
6
|
+
require("core-js/modules/es.error.cause.js");
|
|
7
|
+
require("core-js/modules/es.error.to-string.js");
|
|
8
|
+
require("core-js/modules/es.array.is-array.js");
|
|
9
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
10
|
+
require("core-js/modules/es.function.name.js");
|
|
11
|
+
require("core-js/modules/es.map.js");
|
|
12
|
+
require("core-js/modules/es.number.constructor.js");
|
|
13
|
+
require("core-js/modules/es.object.create.js");
|
|
14
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
15
|
+
require("core-js/modules/es.object.define-property.js");
|
|
16
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
17
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
18
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
19
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
20
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
21
|
+
require("core-js/modules/esnext.map.every.js");
|
|
22
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
23
|
+
require("core-js/modules/esnext.map.find.js");
|
|
24
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
25
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
26
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
27
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
28
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
29
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
30
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
31
|
+
require("core-js/modules/esnext.map.some.js");
|
|
32
|
+
require("core-js/modules/esnext.map.update.js");
|
|
33
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
34
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
35
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
36
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37
|
+
value: true
|
|
38
|
+
});
|
|
39
|
+
exports["default"] = void 0;
|
|
40
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
41
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
42
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
43
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
44
|
+
require("core-js/modules/es.array.concat.js");
|
|
45
|
+
require("core-js/modules/es.array.every.js");
|
|
46
|
+
require("core-js/modules/es.array.filter.js");
|
|
47
|
+
require("core-js/modules/es.array.find.js");
|
|
48
|
+
require("core-js/modules/es.array.find-index.js");
|
|
49
|
+
require("core-js/modules/es.array.for-each.js");
|
|
50
|
+
require("core-js/modules/es.array.includes.js");
|
|
51
|
+
require("core-js/modules/es.array.iterator.js");
|
|
52
|
+
require("core-js/modules/es.array.map.js");
|
|
53
|
+
require("core-js/modules/es.array.push.js");
|
|
54
|
+
require("core-js/modules/es.function.bind.js");
|
|
55
|
+
require("core-js/modules/es.object.keys.js");
|
|
56
|
+
require("core-js/modules/es.object.to-string.js");
|
|
57
|
+
require("core-js/modules/es.string.includes.js");
|
|
58
|
+
require("core-js/modules/es.string.iterator.js");
|
|
59
|
+
require("core-js/modules/es.weak-map.js");
|
|
60
|
+
require("core-js/modules/esnext.async-iterator.every.js");
|
|
61
|
+
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
62
|
+
require("core-js/modules/esnext.async-iterator.find.js");
|
|
63
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
64
|
+
require("core-js/modules/esnext.async-iterator.map.js");
|
|
65
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
66
|
+
require("core-js/modules/esnext.iterator.every.js");
|
|
67
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
68
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
69
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
70
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
71
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
72
|
+
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
73
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
74
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
75
|
+
require("core-js/modules/web.timers.js");
|
|
76
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
77
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
78
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
79
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
80
|
+
var _mobx = require("mobx");
|
|
81
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
82
|
+
var _type = require("fcr-core/lib/type");
|
|
83
|
+
var _uuid = require("uuid");
|
|
84
|
+
var _eventStore = require("../../common/event-store");
|
|
85
|
+
var _toast = require("agora-ui-foundation/lib/components/toast");
|
|
86
|
+
var _dialogContent = require("../Interpreter/dialog-content");
|
|
87
|
+
var _fcrCore = require("fcr-core");
|
|
88
|
+
var _constant = require("../../utilities/constant");
|
|
89
|
+
var _type2 = require("agora-rte-sdk/lib/core/scene/type");
|
|
90
|
+
var _type3 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
91
|
+
var _type4 = require("agora-rte-sdk/lib/type");
|
|
92
|
+
var _constant2 = require("./constant");
|
|
93
|
+
var _switchOutputLanguageRoom = require("../action-bar/switch-output-language-room");
|
|
94
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
95
|
+
var _store = require("../action-bar/store");
|
|
96
|
+
var _excluded = ["randomKey"];
|
|
97
|
+
var _InterpreterStore;
|
|
98
|
+
var _initProto, _init_isScroll, _init__languageRoomList, _init_localInterpreterUsers, _init_storeLocalUser, _init_interpreterUsersEditState, _init_initUsers, _getInitUsersDecs, _updateUsersDecs, _openInterpreterStateDecs, _closeInterpreterStateDecs, _setInterpreterListEditStateDecs, _addInterpreterUsersDecs, _deleteInterpreterUsersDecs, _updateInterpreterUsersDecs, _queryInterpreterUsersDecs, _updateInterpreterRoomStatusDecs, _restoreVolumeByMainRoomDecs, _updateCancelRoomLstStatusDecs, _changeMainRoomStreamDecs, _clonseInterpreterRoomInputDecs, _updatedInterpreterRoomStatusDecs, _updateLanguageRoomListDecs, _onStreamVolumeIndicationUpdatedDecs, _changeInputLanguageDecs, _changeOutputLanguageDecs, _bindLocalMicrophoneIdDecs, _joinInterpreterRoomDecs, _leaveInterpreterRoomDecs, _openInterpreterDialogDecs, _closeInterpreterDialogDecs, _setIsScrollDecs, _getLocalUserByInterpreterDecs, _checkIsSelfOperationDecs, _closeDialogDecs, _interpreterUsersUpdatedToastDecs, _interpreterStateUpdatedToastDecs, _openUpdateInterpreterStateToastDecs, _updateInterpreterUsersToastDecs, _openUpdateLanguageDialogDecs, _openCreateInterpreterStatusToastDecs, _openCancelInterpreterStatusToastDecs, _ref;
|
|
99
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
100
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
101
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
102
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
103
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
104
|
+
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
105
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
106
|
+
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); }
|
|
107
|
+
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; }
|
|
108
|
+
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; }
|
|
109
|
+
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; }
|
|
110
|
+
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; }
|
|
111
|
+
// 生成本地翻译员初始值
|
|
112
|
+
var getInterpreterItem = function getInterpreterItem() {
|
|
113
|
+
return _objectSpread(_objectSpread({}, _constant2.initInterpreterItemModel), {}, (0, _defineProperty2["default"])({}, _constant2.InterpreterItemType.KEY, (0, _uuid.v4)()));
|
|
114
|
+
};
|
|
115
|
+
var _A = /*#__PURE__*/new WeakMap();
|
|
116
|
+
var _B = /*#__PURE__*/new WeakMap();
|
|
117
|
+
var _C = /*#__PURE__*/new WeakMap();
|
|
118
|
+
var _D = /*#__PURE__*/new WeakMap();
|
|
119
|
+
var _E = /*#__PURE__*/new WeakMap();
|
|
120
|
+
var _F = /*#__PURE__*/new WeakMap();
|
|
121
|
+
_ref = (_getInitUsersDecs = [_mobx.action, _mobx.action.bound], _updateUsersDecs = [_mobx.action, _mobx.action.bound], _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], _updateInterpreterRoomStatusDecs = [_mobx.action, _mobx.action.bound], _restoreVolumeByMainRoomDecs = [_mobx.action, _mobx.action.bound], _updateCancelRoomLstStatusDecs = [_mobx.action, _mobx.action.bound], _changeMainRoomStreamDecs = [_mobx.action, _mobx.action.bound], _clonseInterpreterRoomInputDecs = [_mobx.action, _mobx.action.bound], _updatedInterpreterRoomStatusDecs = [_mobx.action, _mobx.action.bound], _updateLanguageRoomListDecs = [_mobx.action, _mobx.action.bound], _onStreamVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _changeInputLanguageDecs = [_mobx.action, _mobx.action.bound], _changeOutputLanguageDecs = [_mobx.action, _mobx.action.bound], _bindLocalMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _joinInterpreterRoomDecs = [_mobx.action, _mobx.action.bound], _leaveInterpreterRoomDecs = [_mobx.action, _mobx.action.bound], _openInterpreterDialogDecs = [_mobx.action, _mobx.action.bound], _closeInterpreterDialogDecs = [_mobx.action, _mobx.action.bound], _setIsScrollDecs = [_mobx.action, _mobx.action.bound], _getLocalUserByInterpreterDecs = [_mobx.action, _mobx.action.bound], _checkIsSelfOperationDecs = [_mobx.action, _mobx.action.bound], _closeDialogDecs = [_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], _openUpdateLanguageDialogDecs = [_mobx.action, _mobx.action.bound], _openCreateInterpreterStatusToastDecs = [_mobx.action, _mobx.action.bound], _openCancelInterpreterStatusToastDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
122
|
+
var InterpreterStore = exports["default"] = /*#__PURE__*/function () {
|
|
123
|
+
function InterpreterStore(_ref2) {
|
|
124
|
+
var _this = this;
|
|
125
|
+
var roomControl = _ref2.roomControl,
|
|
126
|
+
interpreterControl = _ref2.interpreterControl,
|
|
127
|
+
uiEventStore = _ref2.uiEventStore,
|
|
128
|
+
deviceStore = _ref2.deviceStore,
|
|
129
|
+
roomStore = _ref2.roomStore,
|
|
130
|
+
deviceStreamStore = _ref2.deviceStreamStore;
|
|
131
|
+
(0, _classCallCheck2["default"])(this, InterpreterStore);
|
|
132
|
+
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.getLogger)()));
|
|
133
|
+
(0, _defineProperty2["default"])(this, "_currentDialogId", '');
|
|
134
|
+
_classPrivateFieldInitSpec(this, _A, _init_isScroll(this, false));
|
|
135
|
+
// 同声传译列表是否滚动
|
|
136
|
+
_classPrivateFieldInitSpec(this, _B, _init__languageRoomList(this));
|
|
137
|
+
// 语言房间列表
|
|
138
|
+
_classPrivateFieldInitSpec(this, _C, _init_localInterpreterUsers(this, []));
|
|
139
|
+
// 本地翻同声传译列表
|
|
140
|
+
_classPrivateFieldInitSpec(this, _D, _init_storeLocalUser(this));
|
|
141
|
+
// 本地用户信息
|
|
142
|
+
_classPrivateFieldInitSpec(this, _E, _init_interpreterUsersEditState(this, false));
|
|
143
|
+
// 同声传译列表-编辑状态
|
|
144
|
+
_classPrivateFieldInitSpec(this, _F, _init_initUsers(this, []));
|
|
145
|
+
this._mainRoomControl = roomControl;
|
|
146
|
+
this._interpreterControl = interpreterControl;
|
|
147
|
+
this._uiEventStore = uiEventStore;
|
|
148
|
+
this._deviceStore = deviceStore;
|
|
149
|
+
this._roomStore = roomStore;
|
|
150
|
+
this._deviceStreamStore = deviceStreamStore;
|
|
151
|
+
var _this$getLocalUserByI = this.getLocalUserByInterpreter(),
|
|
152
|
+
localUser = _this$getLocalUserByI.localUser;
|
|
153
|
+
this.storeLocalUser = localUser;
|
|
154
|
+
this.getInitUsers(); // 初始化历史参会者列表
|
|
155
|
+
|
|
156
|
+
this.queryInterpreterUsers(); // 查询同声传译列表
|
|
157
|
+
|
|
158
|
+
this.updateLanguageRoomList(); // 初始化语言房间
|
|
159
|
+
|
|
160
|
+
this.updatedInterpreterRoomStatus(); // 更新房间的状态
|
|
161
|
+
|
|
162
|
+
var _this$getLocalUserByI2 = this.getLocalUserByInterpreter(),
|
|
163
|
+
interpreter = _this$getLocalUserByI2.interpreter;
|
|
164
|
+
if (this.interpreterState && interpreter) {
|
|
165
|
+
this.changeMainRoomStream(this.interpreterState);
|
|
166
|
+
}
|
|
167
|
+
this._interpreterControl.addObserver({
|
|
168
|
+
// 监听同声传译开启状态
|
|
169
|
+
onInterpreterStateUpdated: function onInterpreterStateUpdated(roomId, state, operatorUser) {
|
|
170
|
+
_this.interpreterStateUpdatedToast(roomId, state, operatorUser);
|
|
171
|
+
_this.updatedInterpreterRoomStatus(); // 更新语言房间的状态 //关闭 语言房间音频流
|
|
172
|
+
//关闭 主要房间输出音频流
|
|
173
|
+
var _this$getLocalUserByI3 = _this.getLocalUserByInterpreter(),
|
|
174
|
+
interpreter = _this$getLocalUserByI3.interpreter;
|
|
175
|
+
if (state.enable && interpreter) {
|
|
176
|
+
_this.changeMainRoomStream(state.enable);
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
// 监听同声传译列表更新
|
|
180
|
+
onInterpreterUsersUpdated: function onInterpreterUsersUpdated(roomId, users, operatorUser) {
|
|
181
|
+
_this.interpreterUsersUpdatedToast(roomId, users, operatorUser);
|
|
182
|
+
_this.queryInterpreterUsers(); // 查询同声传译列表
|
|
183
|
+
},
|
|
184
|
+
onInterpreterRoomListUpdated: function onInterpreterRoomListUpdated(roomId, rooms, operatorUser) {
|
|
185
|
+
_this.updateCancelRoomLstStatus(); //
|
|
186
|
+
_this.updateLanguageRoomList(); // 初始化语言房间
|
|
187
|
+
_this.updatedInterpreterRoomStatus(); // 更新语言房间的状态
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// 监听参会者人员变化
|
|
192
|
+
this._mainRoomControl.getUserControl().addObserver({
|
|
193
|
+
//成员加入
|
|
194
|
+
onRemoteUsersJoined: function onRemoteUsersJoined(roomId, events) {
|
|
195
|
+
_this.updateUsers({
|
|
196
|
+
roomId: roomId,
|
|
197
|
+
events: events
|
|
198
|
+
}, _constant2.UpdateType.JOIN);
|
|
199
|
+
},
|
|
200
|
+
//成员离开
|
|
201
|
+
onRemoteUsersLeft: function onRemoteUsersLeft(roomId, events) {
|
|
202
|
+
_this.updateUsers({
|
|
203
|
+
roomId: roomId,
|
|
204
|
+
events: events
|
|
205
|
+
}, _constant2.UpdateType.LEFT);
|
|
206
|
+
},
|
|
207
|
+
onUserInfoUpdated: function onUserInfoUpdated(roomId, event) {
|
|
208
|
+
//被取消支持人 取消
|
|
209
|
+
var _this$getLocalUserByI4 = _this.getLocalUserByInterpreter(),
|
|
210
|
+
localUser = _this$getLocalUserByI4.localUser;
|
|
211
|
+
if (event.modifiedUser.userId === localUser.userId) {
|
|
212
|
+
if (_this.storeLocalUser.userRole === _type.FcrUserRole.HOST && event.modifiedUser.userRole !== _type.FcrUserRole.HOST) {
|
|
213
|
+
_this.changeOutputLanguage({
|
|
214
|
+
language: _switchOutputLanguageRoom.CLOSE_ALL_LANGUAGE_ROOM
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
_this.storeLocalUser = localUser;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
this._uiEventStore.addObserver({
|
|
222
|
+
onEvent: this._uiEvents.bind(this)
|
|
223
|
+
});
|
|
224
|
+
this._deviceStore.addObserver({
|
|
225
|
+
onMicrophoneChanged: function onMicrophoneChanged() {
|
|
226
|
+
var _this$_languageRoomLi;
|
|
227
|
+
(_this$_languageRoomLi = _this._languageRoomList) === null || _this$_languageRoomLi === void 0 || _this$_languageRoomLi.forEach(function (room) {
|
|
228
|
+
if (room.status === _constant2.UpdateType.JOIN) {
|
|
229
|
+
_this.bindLocalMicrophoneId(room);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// 历史参会者列表------------------------------------
|
|
237
|
+
return (0, _createClass2["default"])(InterpreterStore, [{
|
|
238
|
+
key: "_uiEvents",
|
|
239
|
+
value: function _uiEvents(action, payload) {
|
|
240
|
+
if (action === _constant.UIAction.CHANGE_INTERPRETER_INPUT_LANGUE) {
|
|
241
|
+
this.changeInputLanguage(payload);
|
|
242
|
+
}
|
|
243
|
+
if (action === _constant.UIAction.CHANGE_INTERPRETER_OUTPUT_LANGUE) {
|
|
244
|
+
this.changeOutputLanguage(payload);
|
|
245
|
+
}
|
|
246
|
+
if (action === _constant.UIAction.OPEN_INTERPRETER_DIALOG) {
|
|
247
|
+
this.openInterpreterDialog();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}, {
|
|
251
|
+
key: "isScroll",
|
|
252
|
+
get: function get() {
|
|
253
|
+
return _classPrivateFieldGet(_A, this);
|
|
254
|
+
},
|
|
255
|
+
set: function set(v) {
|
|
256
|
+
_classPrivateFieldSet(_A, this, v);
|
|
257
|
+
}
|
|
258
|
+
}, {
|
|
259
|
+
key: "_languageRoomList",
|
|
260
|
+
get: function get() {
|
|
261
|
+
return _classPrivateFieldGet(_B, this);
|
|
262
|
+
},
|
|
263
|
+
set: function set(v) {
|
|
264
|
+
_classPrivateFieldSet(_B, this, v);
|
|
265
|
+
}
|
|
266
|
+
}, {
|
|
267
|
+
key: "localInterpreterUsers",
|
|
268
|
+
get: function get() {
|
|
269
|
+
return _classPrivateFieldGet(_C, this);
|
|
270
|
+
},
|
|
271
|
+
set: function set(v) {
|
|
272
|
+
_classPrivateFieldSet(_C, this, v);
|
|
273
|
+
}
|
|
274
|
+
}, {
|
|
275
|
+
key: "storeLocalUser",
|
|
276
|
+
get: function get() {
|
|
277
|
+
return _classPrivateFieldGet(_D, this);
|
|
278
|
+
},
|
|
279
|
+
set: function set(v) {
|
|
280
|
+
_classPrivateFieldSet(_D, this, v);
|
|
281
|
+
}
|
|
282
|
+
}, {
|
|
283
|
+
key: "interpreterUsersEditState",
|
|
284
|
+
get: function get() {
|
|
285
|
+
return _classPrivateFieldGet(_E, this);
|
|
286
|
+
},
|
|
287
|
+
set: function set(v) {
|
|
288
|
+
_classPrivateFieldSet(_E, this, v);
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: "initUsers",
|
|
292
|
+
get: // 历史用户列表
|
|
293
|
+
// 同声传译-是否开启
|
|
294
|
+
function get() {
|
|
295
|
+
return _classPrivateFieldGet(_F, this);
|
|
296
|
+
},
|
|
297
|
+
set: function set(v) {
|
|
298
|
+
_classPrivateFieldSet(_F, this, v);
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "interpreterState",
|
|
302
|
+
get: function get() {
|
|
303
|
+
return this._interpreterControl.getState().enable;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// 同声传译列表-表单校验是否通过
|
|
307
|
+
}, {
|
|
308
|
+
key: "interpreterUsersCheckPass",
|
|
309
|
+
get: function get() {
|
|
310
|
+
var hasNonNullValuesExcludingKey = this.localInterpreterUsers.every(function (obj) {
|
|
311
|
+
var remainingKeys = Object.keys(obj).filter(function (key) {
|
|
312
|
+
return key !== _constant2.InterpreterItemType.KEY;
|
|
313
|
+
});
|
|
314
|
+
return remainingKeys.every(function (key) {
|
|
315
|
+
return obj[key] !== null && obj[key] !== undefined && obj[key] !== '';
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
return hasNonNullValuesExcludingKey;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// 同声传译列表-翻译官是否全部离线
|
|
322
|
+
}, {
|
|
323
|
+
key: "interpreterUsersAllOffLine",
|
|
324
|
+
get: function get() {
|
|
325
|
+
var _this2 = this;
|
|
326
|
+
var isAllOffLine = this.localInterpreterUsers.every(function (ele) {
|
|
327
|
+
var _this2$initUsers$find;
|
|
328
|
+
return (_this2$initUsers$find = _this2.initUsers.find(function (item) {
|
|
329
|
+
return item.userId === ele.userId;
|
|
330
|
+
})) === null || _this2$initUsers$find === void 0 ? void 0 : _this2$initUsers$find.isOffLine;
|
|
331
|
+
});
|
|
332
|
+
return isAllOffLine;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// 语言列表
|
|
336
|
+
}, {
|
|
337
|
+
key: "languageList",
|
|
338
|
+
get: function get() {
|
|
339
|
+
return this._interpreterControl.getInterpreterLanguageList();
|
|
340
|
+
}
|
|
341
|
+
}, {
|
|
342
|
+
key: "getInitUsers",
|
|
343
|
+
value: function
|
|
344
|
+
// 初始化历史参会者列表
|
|
345
|
+
getInitUsers() {
|
|
346
|
+
this.initUsers = (0, _toConsumableArray2["default"])(this._mainRoomControl.getUserControl().getUserList()).map(function (ele) {
|
|
347
|
+
return _objectSpread(_objectSpread({}, ele), {}, {
|
|
348
|
+
isOffLine: false
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
key: "updateUsers",
|
|
354
|
+
value: function
|
|
355
|
+
// 更新历史参会者列表
|
|
356
|
+
updateUsers(_ref3, type) {
|
|
357
|
+
var roomId = _ref3.roomId,
|
|
358
|
+
events = _ref3.events;
|
|
359
|
+
var list = (0, _toConsumableArray2["default"])(this.initUsers);
|
|
360
|
+
events.forEach(function (ele) {
|
|
361
|
+
var modifiedUser = ele.modifiedUser;
|
|
362
|
+
var index = list.findIndex(function (item) {
|
|
363
|
+
return item.userId === modifiedUser.userId;
|
|
364
|
+
});
|
|
365
|
+
if (index > -1) {
|
|
366
|
+
if (list[index]) {
|
|
367
|
+
list[index].isOffLine = _constant2.UpdateType.LEFT !== type;
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
list.push(_objectSpread(_objectSpread({}, modifiedUser), {}, {
|
|
371
|
+
isOffLine: _constant2.UpdateType.LEFT === type
|
|
372
|
+
}));
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
this.initUsers = list;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// 同声传译——开关------------------------------------
|
|
379
|
+
}, {
|
|
380
|
+
key: "openInterpreterState",
|
|
381
|
+
value: function
|
|
382
|
+
// 开启同声传译
|
|
383
|
+
openInterpreterState() {
|
|
384
|
+
var interpreterUsers = this.localInterpreterUsers.map(function (ele) {
|
|
385
|
+
var randomKey = ele.randomKey,
|
|
386
|
+
res = (0, _objectWithoutProperties2["default"])(ele, _excluded);
|
|
387
|
+
return res;
|
|
388
|
+
});
|
|
389
|
+
this._interpreterControl.setInterpreterUsers(interpreterUsers);
|
|
390
|
+
this.closeInterpreterDialog();
|
|
391
|
+
}
|
|
392
|
+
}, {
|
|
393
|
+
key: "closeInterpreterState",
|
|
394
|
+
value: function
|
|
395
|
+
// 关闭同声传译
|
|
396
|
+
closeInterpreterState() {
|
|
397
|
+
this._interpreterControl.close();
|
|
398
|
+
this.closeInterpreterDialog();
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// 同声传译——列表------------------------------------
|
|
402
|
+
}, {
|
|
403
|
+
key: "setInterpreterListEditState",
|
|
404
|
+
value: function
|
|
405
|
+
// 传译列表-设置编辑状态
|
|
406
|
+
setInterpreterListEditState() {
|
|
407
|
+
this.interpreterUsersEditState = !this.interpreterUsersEditState;
|
|
408
|
+
}
|
|
409
|
+
}, {
|
|
410
|
+
key: "addInterpreterUsers",
|
|
411
|
+
value: function
|
|
412
|
+
//传译列表-增加
|
|
413
|
+
addInterpreterUsers() {
|
|
414
|
+
this.localInterpreterUsers = [].concat((0, _toConsumableArray2["default"])(this.localInterpreterUsers), [getInterpreterItem()]);
|
|
415
|
+
}
|
|
416
|
+
}, {
|
|
417
|
+
key: "deleteInterpreterUsers",
|
|
418
|
+
value: function
|
|
419
|
+
//传译列表-删除
|
|
420
|
+
deleteInterpreterUsers(data) {
|
|
421
|
+
this.localInterpreterUsers = this.localInterpreterUsers.filter(function (ele) {
|
|
422
|
+
return ele[_constant2.InterpreterItemType.KEY] !== data[_constant2.InterpreterItemType.KEY];
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
}, {
|
|
426
|
+
key: "updateInterpreterUsers",
|
|
427
|
+
value: function
|
|
428
|
+
//传译列表-更新
|
|
429
|
+
updateInterpreterUsers(data) {
|
|
430
|
+
var index = this.localInterpreterUsers.findIndex(function (ele) {
|
|
431
|
+
return ele[_constant2.InterpreterItemType.KEY] === data[_constant2.InterpreterItemType.KEY];
|
|
432
|
+
});
|
|
433
|
+
var updateInterpreterListModel = (0, _toConsumableArray2["default"])(this.localInterpreterUsers);
|
|
434
|
+
if (index > -1) {
|
|
435
|
+
updateInterpreterListModel[index] = data;
|
|
436
|
+
} else {
|
|
437
|
+
updateInterpreterListModel.push(data);
|
|
438
|
+
}
|
|
439
|
+
this.localInterpreterUsers = updateInterpreterListModel;
|
|
440
|
+
}
|
|
441
|
+
}, {
|
|
442
|
+
key: "queryInterpreterUsers",
|
|
443
|
+
value: function
|
|
444
|
+
//传译列表-查询
|
|
445
|
+
queryInterpreterUsers() {
|
|
446
|
+
var _this$_interpreterCon;
|
|
447
|
+
var interpreterUsers = ((_this$_interpreterCon = this._interpreterControl) === null || _this$_interpreterCon === void 0 || (_this$_interpreterCon = _this$_interpreterCon.getInterpreterUserList()) === null || _this$_interpreterCon === void 0 ? void 0 : _this$_interpreterCon.map(function (ele) {
|
|
448
|
+
return _objectSpread(_objectSpread({}, ele), {}, (0, _defineProperty2["default"])({}, _constant2.InterpreterItemType.KEY, (0, _uuid.v4)()));
|
|
449
|
+
})) || [];
|
|
450
|
+
this.localInterpreterUsers = interpreterUsers.length > 0 ? interpreterUsers : [getInterpreterItem()];
|
|
451
|
+
}
|
|
452
|
+
// 同声传译——列表------------------------------------end
|
|
453
|
+
|
|
454
|
+
// 同步更改的后的语言房间状态
|
|
455
|
+
}, {
|
|
456
|
+
key: "updateInterpreterRoomStatus",
|
|
457
|
+
value: function () {
|
|
458
|
+
var _updateInterpreterRoomStatus = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(executeRoomList) {
|
|
459
|
+
var _this$_languageRoomLi2;
|
|
460
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
461
|
+
while (1) switch (_context.prev = _context.next) {
|
|
462
|
+
case 0:
|
|
463
|
+
this._languageRoomList = (_this$_languageRoomLi2 = this._languageRoomList) === null || _this$_languageRoomLi2 === void 0 ? void 0 : _this$_languageRoomLi2.map(function (ele) {
|
|
464
|
+
var executeRoom = executeRoomList.find(function (item) {
|
|
465
|
+
return item.language === ele.language;
|
|
466
|
+
}) || {};
|
|
467
|
+
return _objectSpread(_objectSpread({}, ele), executeRoom);
|
|
468
|
+
});
|
|
469
|
+
case 1:
|
|
470
|
+
case "end":
|
|
471
|
+
return _context.stop();
|
|
472
|
+
}
|
|
473
|
+
}, _callee, this);
|
|
474
|
+
}));
|
|
475
|
+
function updateInterpreterRoomStatus(_x) {
|
|
476
|
+
return _updateInterpreterRoomStatus.apply(this, arguments);
|
|
477
|
+
}
|
|
478
|
+
return updateInterpreterRoomStatus;
|
|
479
|
+
}()
|
|
480
|
+
}, {
|
|
481
|
+
key: "restoreVolumeByMainRoom",
|
|
482
|
+
value: function restoreVolumeByMainRoom(roomId, intervalId) {
|
|
483
|
+
var _this3 = this;
|
|
484
|
+
intervalId = setInterval(function () {
|
|
485
|
+
var mainRoomVolume = _this3._deviceStore.microphoneVolumeLevel;
|
|
486
|
+
if (mainRoomVolume >= 100) {
|
|
487
|
+
if (intervalId) {
|
|
488
|
+
clearInterval(intervalId);
|
|
489
|
+
}
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
_this3._mainRoomControl.getStreamControl().adjustRemoteAudioStreamVolume(roomId, mainRoomVolume + 1 >= 100 ? 100 : mainRoomVolume + 1);
|
|
493
|
+
}, 100);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// 更新翻译官已经取消的语言房间状态
|
|
497
|
+
}, {
|
|
498
|
+
key: "updateCancelRoomLstStatus",
|
|
499
|
+
value: function () {
|
|
500
|
+
var _updateCancelRoomLstStatus = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
501
|
+
var _this4 = this;
|
|
502
|
+
var orgLanguageRoomList, cancelRoomLst;
|
|
503
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
504
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
505
|
+
case 0:
|
|
506
|
+
orgLanguageRoomList = (0, _toConsumableArray2["default"])(this._languageRoomList || []);
|
|
507
|
+
cancelRoomLst = orgLanguageRoomList.filter(function (ele) {
|
|
508
|
+
var _this4$_languageRoomL;
|
|
509
|
+
return !((_this4$_languageRoomL = _this4._languageRoomList) !== null && _this4$_languageRoomL !== void 0 && _this4$_languageRoomL.find(function (item) {
|
|
510
|
+
return item.language === ele.language;
|
|
511
|
+
}));
|
|
512
|
+
});
|
|
513
|
+
this.leaveInterpreterRoom(cancelRoomLst, false);
|
|
514
|
+
case 3:
|
|
515
|
+
case "end":
|
|
516
|
+
return _context2.stop();
|
|
517
|
+
}
|
|
518
|
+
}, _callee2, this);
|
|
519
|
+
}));
|
|
520
|
+
function updateCancelRoomLstStatus() {
|
|
521
|
+
return _updateCancelRoomLstStatus.apply(this, arguments);
|
|
522
|
+
}
|
|
523
|
+
return updateCancelRoomLstStatus;
|
|
524
|
+
}() // #region checked
|
|
525
|
+
// 控制主房间说话
|
|
526
|
+
}, {
|
|
527
|
+
key: "changeMainRoomStream",
|
|
528
|
+
value: function () {
|
|
529
|
+
var _changeMainRoomStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(closeOrgSound) {
|
|
530
|
+
var localStreamList, micStreams;
|
|
531
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
532
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
533
|
+
case 0:
|
|
534
|
+
if (!this._mainRoomControl.getStreamControl()) {
|
|
535
|
+
_context3.next = 7;
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
localStreamList = this._mainRoomControl.getStreamControl().getStreamsByUserId(this._mainRoomControl.getUserControl().getLocalUser().userId);
|
|
539
|
+
micStreams = localStreamList.filter(function (ele) {
|
|
540
|
+
return ele.audioSourceType === _type4.AgoraRteAudioSourceType.MICROPHONE;
|
|
541
|
+
});
|
|
542
|
+
if (!micStreams.length) {
|
|
543
|
+
_context3.next = 7;
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
_context3.next = 6;
|
|
547
|
+
return this._mainRoomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, micStreams[0].streamId, {
|
|
548
|
+
audioPrivilege: closeOrgSound ? _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
|
|
549
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
550
|
+
}));
|
|
551
|
+
case 6:
|
|
552
|
+
this.logger.info("[interpreterLog-changeMainRoomStream] \u4E3B\u623F\u95F4-\u8F93\u51FA", (0, _defineProperty2["default"])({}, micStreams[0].streamId, {
|
|
553
|
+
audioPrivilege: closeOrgSound ? _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
|
|
554
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
555
|
+
}));
|
|
556
|
+
case 7:
|
|
557
|
+
case "end":
|
|
558
|
+
return _context3.stop();
|
|
559
|
+
}
|
|
560
|
+
}, _callee3, this);
|
|
561
|
+
}));
|
|
562
|
+
function changeMainRoomStream(_x2) {
|
|
563
|
+
return _changeMainRoomStream.apply(this, arguments);
|
|
564
|
+
}
|
|
565
|
+
return changeMainRoomStream;
|
|
566
|
+
}()
|
|
567
|
+
}, {
|
|
568
|
+
key: "clonseInterpreterRoomInput",
|
|
569
|
+
value: function () {
|
|
570
|
+
var _clonseInterpreterRoomInput = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(executeRoomList) {
|
|
571
|
+
var index, element;
|
|
572
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
573
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
574
|
+
case 0:
|
|
575
|
+
index = 0;
|
|
576
|
+
case 1:
|
|
577
|
+
if (!(index < executeRoomList.length)) {
|
|
578
|
+
_context4.next = 10;
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
element = executeRoomList[index];
|
|
582
|
+
_context4.next = 5;
|
|
583
|
+
return this._deviceStreamStore.updateStreams(element.control, false);
|
|
584
|
+
case 5:
|
|
585
|
+
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
586
|
+
roomControl: element.control,
|
|
587
|
+
event: _store.EventType.STOP
|
|
588
|
+
});
|
|
589
|
+
this.logger.info("[interpreterLog-clonseInterpreterRoomInput] \u7FFB\u8BD1\u5B98\u505C\u6B62\u6536\u542C\u539F\u8BED\u8A00\u623F\u95F4-orgRoomControl", {
|
|
590
|
+
roomControl: element.control,
|
|
591
|
+
event: _store.EventType.STOP
|
|
592
|
+
});
|
|
593
|
+
case 7:
|
|
594
|
+
index++;
|
|
595
|
+
_context4.next = 1;
|
|
596
|
+
break;
|
|
597
|
+
case 10:
|
|
598
|
+
case "end":
|
|
599
|
+
return _context4.stop();
|
|
600
|
+
}
|
|
601
|
+
}, _callee4, this);
|
|
602
|
+
}));
|
|
603
|
+
function clonseInterpreterRoomInput(_x3) {
|
|
604
|
+
return _clonseInterpreterRoomInput.apply(this, arguments);
|
|
605
|
+
}
|
|
606
|
+
return clonseInterpreterRoomInput;
|
|
607
|
+
}() // 更新翻译官语言房间状态
|
|
608
|
+
}, {
|
|
609
|
+
key: "updatedInterpreterRoomStatus",
|
|
610
|
+
value: function () {
|
|
611
|
+
var _updatedInterpreterRoomStatus = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
612
|
+
var interpreterState, _this$getLocalUserByI5, interpreter, executeRoomList, targetLanguage, sourceLanguage, targetRoom, sourceRoom;
|
|
613
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
614
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
615
|
+
case 0:
|
|
616
|
+
interpreterState = this._interpreterControl.getState().enable;
|
|
617
|
+
_this$getLocalUserByI5 = this.getLocalUserByInterpreter(), interpreter = _this$getLocalUserByI5.interpreter;
|
|
618
|
+
executeRoomList = [];
|
|
619
|
+
if (interpreter && this._languageRoomList) {
|
|
620
|
+
targetLanguage = interpreter.targetLanguage, sourceLanguage = interpreter.sourceLanguage;
|
|
621
|
+
targetRoom = this._languageRoomList.find(function (ele) {
|
|
622
|
+
return ele.language === targetLanguage;
|
|
623
|
+
}); //输出语言关联 roomId
|
|
624
|
+
sourceRoom = this._languageRoomList.find(function (ele) {
|
|
625
|
+
return ele.language === sourceLanguage;
|
|
626
|
+
}); //输入语言关联 roomId
|
|
627
|
+
if (targetRoom) {
|
|
628
|
+
executeRoomList.push(targetRoom);
|
|
629
|
+
}
|
|
630
|
+
if (sourceRoom) {
|
|
631
|
+
executeRoomList.push(sourceRoom);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
if (!interpreterState) {
|
|
635
|
+
_context5.next = 10;
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
_context5.next = 7;
|
|
639
|
+
return this.joinInterpreterRoom(executeRoomList);
|
|
640
|
+
case 7:
|
|
641
|
+
// 关闭 语言房间的输出流 和输入订阅
|
|
642
|
+
this.clonseInterpreterRoomInput(executeRoomList);
|
|
643
|
+
_context5.next = 12;
|
|
644
|
+
break;
|
|
645
|
+
case 10:
|
|
646
|
+
_context5.next = 12;
|
|
647
|
+
return this.leaveInterpreterRoom(executeRoomList);
|
|
648
|
+
case 12:
|
|
649
|
+
case "end":
|
|
650
|
+
return _context5.stop();
|
|
651
|
+
}
|
|
652
|
+
}, _callee5, this);
|
|
653
|
+
}));
|
|
654
|
+
function updatedInterpreterRoomStatus() {
|
|
655
|
+
return _updatedInterpreterRoomStatus.apply(this, arguments);
|
|
656
|
+
}
|
|
657
|
+
return updatedInterpreterRoomStatus;
|
|
658
|
+
}() // 更新语言房间Control
|
|
659
|
+
}, {
|
|
660
|
+
key: "updateLanguageRoomList",
|
|
661
|
+
value: function () {
|
|
662
|
+
var _updateLanguageRoomList = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
663
|
+
var _this5 = this;
|
|
664
|
+
var rooms;
|
|
665
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
666
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
667
|
+
case 0:
|
|
668
|
+
rooms = this._interpreterControl.getInterpreterRoomList(); //语言房间列表
|
|
669
|
+
this._languageRoomList = rooms === null || rooms === void 0 ? void 0 : rooms.map(function (ele) {
|
|
670
|
+
var _this5$_languageRoomL;
|
|
671
|
+
var orgLanguageRoom = (_this5$_languageRoomL = _this5._languageRoomList) === null || _this5$_languageRoomL === void 0 ? void 0 : _this5$_languageRoomL.find(function (item) {
|
|
672
|
+
return item.language === ele.language;
|
|
673
|
+
});
|
|
674
|
+
return orgLanguageRoom ? orgLanguageRoom : _objectSpread(_objectSpread({}, ele), {}, {
|
|
675
|
+
control: _this5._interpreterControl.createRoomControl(ele.roomId),
|
|
676
|
+
status: _constant2.UpdateType.LEFT
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
case 2:
|
|
680
|
+
case "end":
|
|
681
|
+
return _context6.stop();
|
|
682
|
+
}
|
|
683
|
+
}, _callee6, this);
|
|
684
|
+
}));
|
|
685
|
+
function updateLanguageRoomList() {
|
|
686
|
+
return _updateLanguageRoomList.apply(this, arguments);
|
|
687
|
+
}
|
|
688
|
+
return updateLanguageRoomList;
|
|
689
|
+
}()
|
|
690
|
+
}, {
|
|
691
|
+
key: "onStreamVolumeIndicationUpdated",
|
|
692
|
+
value: function onStreamVolumeIndicationUpdated(roomId, streamId, volume) {
|
|
693
|
+
var _this6 = this;
|
|
694
|
+
var timeoutId = null;
|
|
695
|
+
var intervalId = null;
|
|
696
|
+
if (volume > 10) {
|
|
697
|
+
var roomInfo = this._mainRoomControl.getRoomInfo();
|
|
698
|
+
if (roomInfo) {
|
|
699
|
+
this._mainRoomControl.getStreamControl().adjustRemoteAudioStreamVolume(roomInfo.roomId, 80);
|
|
700
|
+
if (timeoutId) {
|
|
701
|
+
clearTimeout(timeoutId);
|
|
702
|
+
}
|
|
703
|
+
if (intervalId) {
|
|
704
|
+
clearInterval(intervalId);
|
|
705
|
+
}
|
|
706
|
+
timeoutId = setTimeout(function () {
|
|
707
|
+
_this6.restoreVolumeByMainRoom(roomInfo.roomId, intervalId);
|
|
708
|
+
}, 6000);
|
|
709
|
+
}
|
|
710
|
+
} else {}
|
|
711
|
+
}
|
|
712
|
+
// 修改输入的语言频道
|
|
713
|
+
}, {
|
|
714
|
+
key: "changeInputLanguage",
|
|
715
|
+
value: function () {
|
|
716
|
+
var _changeInputLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(_ref4) {
|
|
717
|
+
var _this7 = this;
|
|
718
|
+
var language, options, callback, updateTargetLanguageStreams, updateSourceLanguageStreams, outputLanguageList, _this$getLocalUserByI6, interpreter, _this$_languageRoomLi3, _this$_languageRoomLi4, targetLanguage, sourceLanguage, openTargetLanguage, openSourceLanguage, updateTargetLanguage, updateSourceLanguage, sourceLanguageRoomControl, targetLanguageRoomControl;
|
|
719
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
720
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
721
|
+
case 0:
|
|
722
|
+
language = _ref4.language, options = _ref4.options, callback = _ref4.callback;
|
|
723
|
+
updateTargetLanguageStreams = /*#__PURE__*/function () {
|
|
724
|
+
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(open) {
|
|
725
|
+
var _this7$getLocalUserBy, interpreter, _this7$_languageRoomL, targetLanguage, targetLanguageRoomControl;
|
|
726
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
727
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
728
|
+
case 0:
|
|
729
|
+
_this7$getLocalUserBy = _this7.getLocalUserByInterpreter(), interpreter = _this7$getLocalUserBy.interpreter;
|
|
730
|
+
if (!interpreter) {
|
|
731
|
+
_context7.next = 12;
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
targetLanguage = interpreter.targetLanguage;
|
|
735
|
+
targetLanguageRoomControl = (_this7$_languageRoomL = _this7._languageRoomList) === null || _this7$_languageRoomL === void 0 || (_this7$_languageRoomL = _this7$_languageRoomL.find(function (ele) {
|
|
736
|
+
return ele.language === targetLanguage;
|
|
737
|
+
})) === null || _this7$_languageRoomL === void 0 ? void 0 : _this7$_languageRoomL.control;
|
|
738
|
+
if (!targetLanguageRoomControl) {
|
|
739
|
+
_context7.next = 12;
|
|
740
|
+
break;
|
|
741
|
+
}
|
|
742
|
+
_context7.prev = 5;
|
|
743
|
+
_context7.next = 8;
|
|
744
|
+
return _this7._deviceStreamStore.updateStreams(targetLanguageRoomControl, open);
|
|
745
|
+
case 8:
|
|
746
|
+
_context7.next = 12;
|
|
747
|
+
break;
|
|
748
|
+
case 10:
|
|
749
|
+
_context7.prev = 10;
|
|
750
|
+
_context7.t0 = _context7["catch"](5);
|
|
751
|
+
case 12:
|
|
752
|
+
case "end":
|
|
753
|
+
return _context7.stop();
|
|
754
|
+
}
|
|
755
|
+
}, _callee7, null, [[5, 10]]);
|
|
756
|
+
}));
|
|
757
|
+
return function updateTargetLanguageStreams(_x5) {
|
|
758
|
+
return _ref5.apply(this, arguments);
|
|
759
|
+
};
|
|
760
|
+
}();
|
|
761
|
+
updateSourceLanguageStreams = /*#__PURE__*/function () {
|
|
762
|
+
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(open) {
|
|
763
|
+
var _this7$getLocalUserBy2, interpreter, _this7$_languageRoomL2, sourceLanguage, sourceLanguageRoomControl;
|
|
764
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
765
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
766
|
+
case 0:
|
|
767
|
+
_this7$getLocalUserBy2 = _this7.getLocalUserByInterpreter(), interpreter = _this7$getLocalUserBy2.interpreter;
|
|
768
|
+
if (!interpreter) {
|
|
769
|
+
_context8.next = 12;
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
sourceLanguage = interpreter.sourceLanguage;
|
|
773
|
+
sourceLanguageRoomControl = (_this7$_languageRoomL2 = _this7._languageRoomList) === null || _this7$_languageRoomL2 === void 0 || (_this7$_languageRoomL2 = _this7$_languageRoomL2.find(function (ele) {
|
|
774
|
+
return ele.language === sourceLanguage;
|
|
775
|
+
})) === null || _this7$_languageRoomL2 === void 0 ? void 0 : _this7$_languageRoomL2.control;
|
|
776
|
+
if (!sourceLanguageRoomControl) {
|
|
777
|
+
_context8.next = 12;
|
|
778
|
+
break;
|
|
779
|
+
}
|
|
780
|
+
_context8.prev = 5;
|
|
781
|
+
_context8.next = 8;
|
|
782
|
+
return _this7._deviceStreamStore.updateStreams(sourceLanguageRoomControl, open);
|
|
783
|
+
case 8:
|
|
784
|
+
_context8.next = 12;
|
|
785
|
+
break;
|
|
786
|
+
case 10:
|
|
787
|
+
_context8.prev = 10;
|
|
788
|
+
_context8.t0 = _context8["catch"](5);
|
|
789
|
+
case 12:
|
|
790
|
+
case "end":
|
|
791
|
+
return _context8.stop();
|
|
792
|
+
}
|
|
793
|
+
}, _callee8, null, [[5, 10]]);
|
|
794
|
+
}));
|
|
795
|
+
return function updateSourceLanguageStreams(_x6) {
|
|
796
|
+
return _ref6.apply(this, arguments);
|
|
797
|
+
};
|
|
798
|
+
}();
|
|
799
|
+
outputLanguageList = (0, _toConsumableArray2["default"])(options);
|
|
800
|
+
_this$getLocalUserByI6 = this.getLocalUserByInterpreter(), interpreter = _this$getLocalUserByI6.interpreter;
|
|
801
|
+
if (!interpreter) {
|
|
802
|
+
_context9.next = 27;
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
targetLanguage = interpreter.targetLanguage, sourceLanguage = interpreter.sourceLanguage;
|
|
806
|
+
openTargetLanguage = language === targetLanguage;
|
|
807
|
+
openSourceLanguage = language === sourceLanguage;
|
|
808
|
+
updateTargetLanguage = function updateTargetLanguage() {
|
|
809
|
+
outputLanguageList = (0, _constant2.updateOutputLanguageList)({
|
|
810
|
+
outputLanguageList: outputLanguageList,
|
|
811
|
+
language: targetLanguage,
|
|
812
|
+
open: openTargetLanguage
|
|
813
|
+
});
|
|
814
|
+
};
|
|
815
|
+
updateSourceLanguage = function updateSourceLanguage() {
|
|
816
|
+
outputLanguageList = (0, _constant2.updateOutputLanguageList)({
|
|
817
|
+
outputLanguageList: outputLanguageList,
|
|
818
|
+
language: sourceLanguage,
|
|
819
|
+
open: openSourceLanguage
|
|
820
|
+
});
|
|
821
|
+
};
|
|
822
|
+
if (!this._deviceStore.microphoneEnabled) {
|
|
823
|
+
_context9.next = 20;
|
|
824
|
+
break;
|
|
825
|
+
}
|
|
826
|
+
_context9.next = 14;
|
|
827
|
+
return updateTargetLanguageStreams(openTargetLanguage);
|
|
828
|
+
case 14:
|
|
829
|
+
updateTargetLanguage();
|
|
830
|
+
_context9.next = 17;
|
|
831
|
+
return updateSourceLanguageStreams(openSourceLanguage);
|
|
832
|
+
case 17:
|
|
833
|
+
updateSourceLanguage();
|
|
834
|
+
_context9.next = 23;
|
|
835
|
+
break;
|
|
836
|
+
case 20:
|
|
837
|
+
updateTargetLanguage();
|
|
838
|
+
updateSourceLanguage();
|
|
839
|
+
_toast.FcrToastApi.open({
|
|
840
|
+
toastProps: {
|
|
841
|
+
type: 'info',
|
|
842
|
+
content: '请打开麦克风'
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
case 23:
|
|
846
|
+
sourceLanguageRoomControl = (_this$_languageRoomLi3 = this._languageRoomList) === null || _this$_languageRoomLi3 === void 0 || (_this$_languageRoomLi3 = _this$_languageRoomLi3.find(function (ele) {
|
|
847
|
+
return ele.language === sourceLanguage;
|
|
848
|
+
})) === null || _this$_languageRoomLi3 === void 0 ? void 0 : _this$_languageRoomLi3.control;
|
|
849
|
+
targetLanguageRoomControl = (_this$_languageRoomLi4 = this._languageRoomList) === null || _this$_languageRoomLi4 === void 0 || (_this$_languageRoomLi4 = _this$_languageRoomLi4.find(function (ele) {
|
|
850
|
+
return ele.language === targetLanguage;
|
|
851
|
+
})) === null || _this$_languageRoomLi4 === void 0 ? void 0 : _this$_languageRoomLi4.control;
|
|
852
|
+
if (sourceLanguageRoomControl && targetLanguageRoomControl) {
|
|
853
|
+
this._deviceStreamStore.setInterpreterRoomControlInfo({
|
|
854
|
+
targetLanguageRoomControl: targetLanguageRoomControl,
|
|
855
|
+
sourceLanguageRoomControl: sourceLanguageRoomControl,
|
|
856
|
+
interpreter: interpreter,
|
|
857
|
+
language: language
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
callback && callback(outputLanguageList);
|
|
861
|
+
case 27:
|
|
862
|
+
case "end":
|
|
863
|
+
return _context9.stop();
|
|
864
|
+
}
|
|
865
|
+
}, _callee9, this);
|
|
866
|
+
}));
|
|
867
|
+
function changeInputLanguage(_x4) {
|
|
868
|
+
return _changeInputLanguage.apply(this, arguments);
|
|
869
|
+
}
|
|
870
|
+
return changeInputLanguage;
|
|
871
|
+
}() // 修改输出的语言频道
|
|
872
|
+
}, {
|
|
873
|
+
key: "changeOutputLanguage",
|
|
874
|
+
value: function () {
|
|
875
|
+
var _changeOutputLanguage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(_ref7) {
|
|
876
|
+
var language, orgLanguage, callback, _this$getLocalUserByI7, interpreter, interpreterRoomList, joinExecuteRoomList, leaveExecuteRoomList, _targetLanguage, _sourceLanguage, _this$_languageRoomLi5, orgRoomControl, _this$_languageRoomLi6, _this$_languageRoomLi7, isInterpreterLanguage, isInterpreterOrgLanguage, roomControl, _orgRoomControl;
|
|
877
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
878
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
879
|
+
case 0:
|
|
880
|
+
language = _ref7.language, orgLanguage = _ref7.orgLanguage, callback = _ref7.callback;
|
|
881
|
+
if (!this._languageRoomList) {
|
|
882
|
+
_context10.next = 18;
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
_this$getLocalUserByI7 = this.getLocalUserByInterpreter(), interpreter = _this$getLocalUserByI7.interpreter;
|
|
886
|
+
interpreterRoomList = [];
|
|
887
|
+
joinExecuteRoomList = [];
|
|
888
|
+
leaveExecuteRoomList = [];
|
|
889
|
+
if (interpreter) {
|
|
890
|
+
_targetLanguage = interpreter.targetLanguage, _sourceLanguage = interpreter.sourceLanguage;
|
|
891
|
+
interpreterRoomList = [_targetLanguage, _sourceLanguage];
|
|
892
|
+
}
|
|
893
|
+
if (language === _switchOutputLanguageRoom.CLOSE_ALL_LANGUAGE_ROOM) {
|
|
894
|
+
leaveExecuteRoomList = this._languageRoomList;
|
|
895
|
+
if (interpreter) {
|
|
896
|
+
leaveExecuteRoomList = leaveExecuteRoomList.filter(function (ele) {
|
|
897
|
+
return !interpreterRoomList.includes(ele.language);
|
|
898
|
+
});
|
|
899
|
+
orgRoomControl = (_this$_languageRoomLi5 = this._languageRoomList.find(function (ele) {
|
|
900
|
+
return ele.language === orgLanguage;
|
|
901
|
+
})) === null || _this$_languageRoomLi5 === void 0 ? void 0 : _this$_languageRoomLi5.control;
|
|
902
|
+
if (orgRoomControl) {
|
|
903
|
+
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
904
|
+
roomControl: orgRoomControl,
|
|
905
|
+
event: _store.EventType.STOP
|
|
906
|
+
});
|
|
907
|
+
this.logger.info("[interpreterLog-changeOutputLanguage-true] \u7FFB\u8BD1\u5B98\u505C\u6B62\u6536\u542C\u539F\u8BED\u8A00\u623F\u95F4-orgRoomControl", {
|
|
908
|
+
roomControl: orgRoomControl,
|
|
909
|
+
event: _store.EventType.STOP
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
} else {
|
|
914
|
+
joinExecuteRoomList = this._languageRoomList.filter(function (ele) {
|
|
915
|
+
return ele.language === language;
|
|
916
|
+
});
|
|
917
|
+
leaveExecuteRoomList = this._languageRoomList.filter(function (ele) {
|
|
918
|
+
return ele.language !== language;
|
|
919
|
+
});
|
|
920
|
+
if (interpreter) {
|
|
921
|
+
isInterpreterLanguage = interpreterRoomList.includes(language);
|
|
922
|
+
if (isInterpreterLanguage) {
|
|
923
|
+
joinExecuteRoomList = joinExecuteRoomList.filter(function (ele) {
|
|
924
|
+
return ele.language !== language;
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
isInterpreterOrgLanguage = orgLanguage && orgLanguage !== _switchOutputLanguageRoom.CLOSE_ALL_LANGUAGE_ROOM && interpreterRoomList.includes(orgLanguage);
|
|
928
|
+
if (isInterpreterOrgLanguage) {
|
|
929
|
+
leaveExecuteRoomList = leaveExecuteRoomList.filter(function (ele) {
|
|
930
|
+
return ele.language !== orgLanguage;
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
roomControl = (_this$_languageRoomLi6 = this._languageRoomList.find(function (ele) {
|
|
934
|
+
return ele.language === language;
|
|
935
|
+
})) === null || _this$_languageRoomLi6 === void 0 ? void 0 : _this$_languageRoomLi6.control;
|
|
936
|
+
_orgRoomControl = (_this$_languageRoomLi7 = this._languageRoomList.find(function (ele) {
|
|
937
|
+
return ele.language === orgLanguage;
|
|
938
|
+
})) === null || _this$_languageRoomLi7 === void 0 ? void 0 : _this$_languageRoomLi7.control;
|
|
939
|
+
if (roomControl) {
|
|
940
|
+
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
941
|
+
roomControl: roomControl,
|
|
942
|
+
event: _store.EventType.START
|
|
943
|
+
});
|
|
944
|
+
this.logger.info("[interpreterLog-changeOutputLanguage] \u7FFB\u8BD1\u5B98\u5F00\u59CB\u6536\u542C\u539F\u8BED\u8A00\u623F\u95F4-newRoomControl", {
|
|
945
|
+
roomControl: roomControl,
|
|
946
|
+
event: _store.EventType.START
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
if (_orgRoomControl) {
|
|
950
|
+
this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_INTERPRETER_REMOTE_AUDIO, {
|
|
951
|
+
roomControl: _orgRoomControl,
|
|
952
|
+
event: _store.EventType.STOP
|
|
953
|
+
});
|
|
954
|
+
this.logger.info("[interpreterLog-changeOutputLanguage-false] \u7FFB\u8BD1\u5B98\u505C\u6B62\u6536\u542C\u539F\u8BED\u8A00\u623F\u95F4-orgRoomControl", {
|
|
955
|
+
roomControl: roomControl,
|
|
956
|
+
event: _store.EventType.START
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
_context10.prev = 8;
|
|
962
|
+
_context10.next = 11;
|
|
963
|
+
return this.joinInterpreterRoom(joinExecuteRoomList);
|
|
964
|
+
case 11:
|
|
965
|
+
_context10.next = 13;
|
|
966
|
+
return this.leaveInterpreterRoom(leaveExecuteRoomList);
|
|
967
|
+
case 13:
|
|
968
|
+
_context10.next = 18;
|
|
969
|
+
break;
|
|
970
|
+
case 15:
|
|
971
|
+
_context10.prev = 15;
|
|
972
|
+
_context10.t0 = _context10["catch"](8);
|
|
973
|
+
callback && callback();
|
|
974
|
+
case 18:
|
|
975
|
+
callback && callback();
|
|
976
|
+
case 19:
|
|
977
|
+
case "end":
|
|
978
|
+
return _context10.stop();
|
|
979
|
+
}
|
|
980
|
+
}, _callee10, this, [[8, 15]]);
|
|
981
|
+
}));
|
|
982
|
+
function changeOutputLanguage(_x7) {
|
|
983
|
+
return _changeOutputLanguage.apply(this, arguments);
|
|
984
|
+
}
|
|
985
|
+
return changeOutputLanguage;
|
|
986
|
+
}()
|
|
987
|
+
}, {
|
|
988
|
+
key: "bindLocalMicrophoneId",
|
|
989
|
+
value: function bindLocalMicrophoneId(room) {
|
|
990
|
+
var microphoneId = this._deviceStore.currentDeviceId.microphoneDeviceId;
|
|
991
|
+
if (microphoneId) {
|
|
992
|
+
var streamList = room.control.getStreamControl().getStreamsByUserId(room.control.getUserControl().getLocalUser().userId);
|
|
993
|
+
var micStream = streamList.find(function (stream) {
|
|
994
|
+
return stream.audioSourceType === _fcrCore.FcrAudioSourceType.MICROPHONE;
|
|
995
|
+
});
|
|
996
|
+
if (micStream && micStream.audioSourceId !== microphoneId) {
|
|
997
|
+
var _room$control$getRoom;
|
|
998
|
+
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));
|
|
999
|
+
room.control.getStreamControl().bindLocalStreams([{
|
|
1000
|
+
streamId: micStream.streamId,
|
|
1001
|
+
audioSourceId: microphoneId
|
|
1002
|
+
}]);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
// 加入语言房间
|
|
1008
|
+
}, {
|
|
1009
|
+
key: "joinInterpreterRoom",
|
|
1010
|
+
value: function () {
|
|
1011
|
+
var _joinInterpreterRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(data) {
|
|
1012
|
+
var update,
|
|
1013
|
+
_this$getLocalUserByI8,
|
|
1014
|
+
localUser,
|
|
1015
|
+
interpreter,
|
|
1016
|
+
executeRoomList,
|
|
1017
|
+
index,
|
|
1018
|
+
room,
|
|
1019
|
+
_args11 = arguments;
|
|
1020
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
1021
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1022
|
+
case 0:
|
|
1023
|
+
update = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : true;
|
|
1024
|
+
_this$getLocalUserByI8 = this.getLocalUserByInterpreter(), localUser = _this$getLocalUserByI8.localUser, interpreter = _this$getLocalUserByI8.interpreter;
|
|
1025
|
+
executeRoomList = (0, _toConsumableArray2["default"])(data);
|
|
1026
|
+
index = 0;
|
|
1027
|
+
case 4:
|
|
1028
|
+
if (!(index < executeRoomList.length)) {
|
|
1029
|
+
_context11.next = 24;
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
room = executeRoomList[index];
|
|
1033
|
+
if (!(room.status === _constant2.UpdateType.LEFT)) {
|
|
1034
|
+
_context11.next = 20;
|
|
1035
|
+
break;
|
|
1036
|
+
}
|
|
1037
|
+
_context11.prev = 7;
|
|
1038
|
+
executeRoomList[index].status = _constant2.UpdateType.LOADING;
|
|
1039
|
+
_context11.next = 11;
|
|
1040
|
+
return this._roomStore.joinInterpreterRoom({
|
|
1041
|
+
control: room.control,
|
|
1042
|
+
roomJoinOptions: {
|
|
1043
|
+
roomToken: '',
|
|
1044
|
+
streamLatency: _fcrCore.FcrStreamLatencyLevel.ULTRA_LOW,
|
|
1045
|
+
createStreamConfigs: [{
|
|
1046
|
+
videoSourceState: _type3.AgoraRtcMediaSourceState.STOPPED,
|
|
1047
|
+
audioSourceState: _type3.AgoraRtcMediaSourceState.STOPPED,
|
|
1048
|
+
videoSourceId: '',
|
|
1049
|
+
audioSourceId: '',
|
|
1050
|
+
streamName: 'default',
|
|
1051
|
+
streamType: _type2.AgoraRteMediaStreamType.NONE,
|
|
1052
|
+
videoSourceType: _type4.AgoraRteVideoSourceType.CAMERA,
|
|
1053
|
+
audioSourceType: _type4.AgoraRteAudioSourceType.MICROPHONE
|
|
1054
|
+
}],
|
|
1055
|
+
userName: localUser.userName,
|
|
1056
|
+
userRole: !!interpreter ? _type.FcrUserRole.COHOST : _type.FcrUserRole.PARTICIPANT
|
|
1057
|
+
},
|
|
1058
|
+
language: room.language
|
|
1059
|
+
});
|
|
1060
|
+
case 11:
|
|
1061
|
+
// room.control.getStreamControl().addObserver({
|
|
1062
|
+
// onStreamVolumeIndicationUpdated: this.onStreamVolumeIndicationUpdated,
|
|
1063
|
+
// });
|
|
1064
|
+
executeRoomList[index].status = _constant2.UpdateType.JOIN;
|
|
1065
|
+
_context11.next = 17;
|
|
1066
|
+
break;
|
|
1067
|
+
case 14:
|
|
1068
|
+
_context11.prev = 14;
|
|
1069
|
+
_context11.t0 = _context11["catch"](7);
|
|
1070
|
+
executeRoomList[index].status = _constant2.UpdateType.LEFT;
|
|
1071
|
+
case 17:
|
|
1072
|
+
this.bindLocalMicrophoneId(executeRoomList[index]);
|
|
1073
|
+
_context11.next = 21;
|
|
1074
|
+
break;
|
|
1075
|
+
case 20:
|
|
1076
|
+
console.log('非离开状态 无法加入房间', room);
|
|
1077
|
+
case 21:
|
|
1078
|
+
index++;
|
|
1079
|
+
_context11.next = 4;
|
|
1080
|
+
break;
|
|
1081
|
+
case 24:
|
|
1082
|
+
if (update) {
|
|
1083
|
+
this.updateInterpreterRoomStatus(executeRoomList);
|
|
1084
|
+
}
|
|
1085
|
+
case 25:
|
|
1086
|
+
case "end":
|
|
1087
|
+
return _context11.stop();
|
|
1088
|
+
}
|
|
1089
|
+
}, _callee11, this, [[7, 14]]);
|
|
1090
|
+
}));
|
|
1091
|
+
function joinInterpreterRoom(_x8) {
|
|
1092
|
+
return _joinInterpreterRoom.apply(this, arguments);
|
|
1093
|
+
}
|
|
1094
|
+
return joinInterpreterRoom;
|
|
1095
|
+
}() // 离开语言房间
|
|
1096
|
+
}, {
|
|
1097
|
+
key: "leaveInterpreterRoom",
|
|
1098
|
+
value: function () {
|
|
1099
|
+
var _leaveInterpreterRoom = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(data) {
|
|
1100
|
+
var update,
|
|
1101
|
+
executeRoomList,
|
|
1102
|
+
index,
|
|
1103
|
+
room,
|
|
1104
|
+
_args12 = arguments;
|
|
1105
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
1106
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1107
|
+
case 0:
|
|
1108
|
+
update = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : true;
|
|
1109
|
+
executeRoomList = (0, _toConsumableArray2["default"])(data);
|
|
1110
|
+
index = 0;
|
|
1111
|
+
case 3:
|
|
1112
|
+
if (!(index < executeRoomList.length)) {
|
|
1113
|
+
_context12.next = 22;
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
room = executeRoomList[index];
|
|
1117
|
+
if (!(room.status === _constant2.UpdateType.JOIN)) {
|
|
1118
|
+
_context12.next = 18;
|
|
1119
|
+
break;
|
|
1120
|
+
}
|
|
1121
|
+
_context12.prev = 6;
|
|
1122
|
+
executeRoomList[index].status = _constant2.UpdateType.LOADING;
|
|
1123
|
+
_context12.next = 10;
|
|
1124
|
+
return this._roomStore.leaveInterpreterRoom({
|
|
1125
|
+
control: room.control,
|
|
1126
|
+
language: room.language
|
|
1127
|
+
});
|
|
1128
|
+
case 10:
|
|
1129
|
+
// room.control.getStreamControl().removeObserver({
|
|
1130
|
+
// onStreamVolumeIndicationUpdated: this.onStreamVolumeIndicationUpdated,
|
|
1131
|
+
// });
|
|
1132
|
+
executeRoomList[index].status = _constant2.UpdateType.LEFT;
|
|
1133
|
+
_context12.next = 16;
|
|
1134
|
+
break;
|
|
1135
|
+
case 13:
|
|
1136
|
+
_context12.prev = 13;
|
|
1137
|
+
_context12.t0 = _context12["catch"](6);
|
|
1138
|
+
executeRoomList[index].status = _constant2.UpdateType.JOIN;
|
|
1139
|
+
case 16:
|
|
1140
|
+
_context12.next = 19;
|
|
1141
|
+
break;
|
|
1142
|
+
case 18:
|
|
1143
|
+
console.log('非加入状态 无法离开房间', room);
|
|
1144
|
+
case 19:
|
|
1145
|
+
index++;
|
|
1146
|
+
_context12.next = 3;
|
|
1147
|
+
break;
|
|
1148
|
+
case 22:
|
|
1149
|
+
if (update) {
|
|
1150
|
+
this.updateInterpreterRoomStatus(executeRoomList);
|
|
1151
|
+
}
|
|
1152
|
+
case 23:
|
|
1153
|
+
case "end":
|
|
1154
|
+
return _context12.stop();
|
|
1155
|
+
}
|
|
1156
|
+
}, _callee12, this, [[6, 13]]);
|
|
1157
|
+
}));
|
|
1158
|
+
function leaveInterpreterRoom(_x9) {
|
|
1159
|
+
return _leaveInterpreterRoom.apply(this, arguments);
|
|
1160
|
+
}
|
|
1161
|
+
return leaveInterpreterRoom;
|
|
1162
|
+
}() // #endregion
|
|
1163
|
+
// #region 工具方法
|
|
1164
|
+
}, {
|
|
1165
|
+
key: "openInterpreterDialog",
|
|
1166
|
+
value: function
|
|
1167
|
+
// 开启弹窗
|
|
1168
|
+
openInterpreterDialog() {
|
|
1169
|
+
this._currentDialogId = this._uiEventStore.openDialog(_constant.DialogKey.INTERPRETER);
|
|
1170
|
+
}
|
|
1171
|
+
}, {
|
|
1172
|
+
key: "closeInterpreterDialog",
|
|
1173
|
+
value: function
|
|
1174
|
+
// 关闭弹窗
|
|
1175
|
+
closeInterpreterDialog() {
|
|
1176
|
+
this._uiEventStore.closeDialog(this._currentDialogId);
|
|
1177
|
+
}
|
|
1178
|
+
}, {
|
|
1179
|
+
key: "setIsScroll",
|
|
1180
|
+
value: function
|
|
1181
|
+
// 设置容器滚动状态
|
|
1182
|
+
setIsScroll(enable) {
|
|
1183
|
+
this.isScroll = enable;
|
|
1184
|
+
}
|
|
1185
|
+
}, {
|
|
1186
|
+
key: "getLocalUserByInterpreter",
|
|
1187
|
+
value: function
|
|
1188
|
+
// 获取本地用户关联的翻译官信息
|
|
1189
|
+
getLocalUserByInterpreter() {
|
|
1190
|
+
var localUser = this._mainRoomControl.getUserControl().getLocalUser(); // 本地用户信息
|
|
1191
|
+
var interpreterUsers = this._interpreterControl.getInterpreterUserList(); //翻译官列表
|
|
1192
|
+
var interpreter = interpreterUsers === null || interpreterUsers === void 0 ? void 0 : interpreterUsers.find(function (ele) {
|
|
1193
|
+
return ele.userId === localUser.userId;
|
|
1194
|
+
}); //本地用户关联的翻译官信息
|
|
1195
|
+
return {
|
|
1196
|
+
interpreter: interpreter,
|
|
1197
|
+
localUser: localUser
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
}, {
|
|
1201
|
+
key: "checkIsSelfOperation",
|
|
1202
|
+
value: function
|
|
1203
|
+
// 检查操作用户是否是用户本人
|
|
1204
|
+
checkIsSelfOperation(operatorUser) {
|
|
1205
|
+
var userInfo = this._mainRoomControl.getUserControl().getLocalUser();
|
|
1206
|
+
var isSelfOperation = operatorUser.userId === userInfo.userId;
|
|
1207
|
+
return isSelfOperation;
|
|
1208
|
+
}
|
|
1209
|
+
}, {
|
|
1210
|
+
key: "closeDialog",
|
|
1211
|
+
value: function
|
|
1212
|
+
// 关闭同声传译弹窗
|
|
1213
|
+
closeDialog() {
|
|
1214
|
+
this._uiEventStore.closeDialog(this._currentDialogId);
|
|
1215
|
+
}
|
|
1216
|
+
// #endregion
|
|
1217
|
+
|
|
1218
|
+
// #region 提示
|
|
1219
|
+
}, {
|
|
1220
|
+
key: "interpreterUsersUpdatedToast",
|
|
1221
|
+
value: function interpreterUsersUpdatedToast(roomId, users, operatorUser) {
|
|
1222
|
+
if (operatorUser) {
|
|
1223
|
+
this.updateInterpreterUsersToast(roomId, users, operatorUser); // 列表更新提醒
|
|
1224
|
+
}
|
|
1225
|
+
var _this$getLocalUserByI9 = this.getLocalUserByInterpreter(),
|
|
1226
|
+
interpreter = _this$getLocalUserByI9.interpreter,
|
|
1227
|
+
localUser = _this$getLocalUserByI9.localUser;
|
|
1228
|
+
var preInterpreter = this.localInterpreterUsers.find(function (ele) {
|
|
1229
|
+
return ele.userId === localUser.userId;
|
|
1230
|
+
});
|
|
1231
|
+
if (interpreter) {
|
|
1232
|
+
if (preInterpreter) {
|
|
1233
|
+
var isUpdate = preInterpreter.sourceLanguage !== interpreter.sourceLanguage || preInterpreter.targetLanguage !== interpreter.targetLanguage;
|
|
1234
|
+
if (isUpdate) {
|
|
1235
|
+
this.openUpdateLanguageDialog(interpreter); // 触发翻译官-语言变更提醒
|
|
1236
|
+
}
|
|
1237
|
+
} else {
|
|
1238
|
+
this.openCreateInterpreterStatusToast(interpreter); // 触发翻译官-创建提醒
|
|
1239
|
+
}
|
|
1240
|
+
} else {
|
|
1241
|
+
if (preInterpreter) {
|
|
1242
|
+
this.openCancelInterpreterStatusToast(); // 触发翻译官-取消提醒
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}, {
|
|
1247
|
+
key: "interpreterStateUpdatedToast",
|
|
1248
|
+
value: function interpreterStateUpdatedToast(roomId, state, operatorUser) {
|
|
1249
|
+
if (operatorUser) {
|
|
1250
|
+
var isSelfOperation = this.checkIsSelfOperation(operatorUser); //是否本人
|
|
1251
|
+
if (!isSelfOperation) {
|
|
1252
|
+
this.openUpdateInterpreterStateToast(roomId, state, operatorUser); // 触发状态变更提醒
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
if (state.enable) {
|
|
1256
|
+
var _this$getLocalUserByI10 = this.getLocalUserByInterpreter(),
|
|
1257
|
+
interpreter = _this$getLocalUserByI10.interpreter;
|
|
1258
|
+
if (interpreter) {
|
|
1259
|
+
this.openCreateInterpreterStatusToast(interpreter); // 触发翻译官-创建提醒
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
// 同声传译-状态更新-Toast
|
|
1265
|
+
}, {
|
|
1266
|
+
key: "openUpdateInterpreterStateToast",
|
|
1267
|
+
value: function openUpdateInterpreterStateToast(roomId, state, operatorUser) {
|
|
1268
|
+
var _this8 = this;
|
|
1269
|
+
if (state.enable) {
|
|
1270
|
+
var _this$_interpreterCon2;
|
|
1271
|
+
this._uiEventStore.showNotification({
|
|
1272
|
+
type: _eventStore.NotificationContentType.INTERPRETER_STATUS,
|
|
1273
|
+
placement: 'topLeft',
|
|
1274
|
+
onClose: function onClose() {
|
|
1275
|
+
_this8._uiEventStore.sendEvent(_constant.UIAction.COLSE_NOTIFICATION, _eventStore.NotificationContentType.INTERPRETER_STATUS);
|
|
1276
|
+
},
|
|
1277
|
+
data: {
|
|
1278
|
+
operatorUser: operatorUser,
|
|
1279
|
+
interpreterUserList: (_this$_interpreterCon2 = this._interpreterControl) === null || _this$_interpreterCon2 === void 0 ? void 0 : _this$_interpreterCon2.getInterpreterUserList()
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
} else {
|
|
1283
|
+
var content = "".concat((0, _i18n.transI18n)(operatorUser.userRole === _type.FcrUserRole.HOST ? 'fmt_role_host' : 'fmt_role_cohost'), " ").concat(operatorUser.userName, "\u5173\u95ED\u4E86\u540C\u58F0\u4F20\u8BD1\u529F\u80FD");
|
|
1284
|
+
_toast.FcrToastApi.open({
|
|
1285
|
+
toastProps: {
|
|
1286
|
+
type: 'info',
|
|
1287
|
+
content: content
|
|
1288
|
+
}
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
// 同声传译-列表更新-Toast
|
|
1293
|
+
}, {
|
|
1294
|
+
key: "updateInterpreterUsersToast",
|
|
1295
|
+
value: function updateInterpreterUsersToast(roomId, users, operatorUser) {
|
|
1296
|
+
_toast.FcrToastApi.open({
|
|
1297
|
+
toastProps: {
|
|
1298
|
+
type: 'info',
|
|
1299
|
+
content: "".concat((0, _i18n.transI18n)(operatorUser.userRole === _type.FcrUserRole.HOST ? 'fmt_role_host' : 'fmt_role_cohost'), " ").concat(operatorUser.userName, " ").concat(operatorUser.userName, "\u66F4\u65B0\u4E86\u540C\u58F0\u4F20\u8BD1\u7684\u7FFB\u8BD1\u5B98\u6216\u8BED\u8A00")
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
// 翻译官-语言更新-Dialog
|
|
1304
|
+
}, {
|
|
1305
|
+
key: "openUpdateLanguageDialog",
|
|
1306
|
+
value: function openUpdateLanguageDialog(interpreter) {
|
|
1307
|
+
var _this9 = this;
|
|
1308
|
+
var dialogKey = this._uiEventStore.openConfirmDialog({
|
|
1309
|
+
title: '请注意,翻译语言有变更',
|
|
1310
|
+
content: (0, _dialogContent.DialogContent)({
|
|
1311
|
+
content: '会议管理员指定了你新的翻译语言。',
|
|
1312
|
+
userInfo: interpreter
|
|
1313
|
+
}),
|
|
1314
|
+
alignCenter: true,
|
|
1315
|
+
onOk: function onOk() {
|
|
1316
|
+
_this9._uiEventStore.closeDialog(dialogKey);
|
|
1317
|
+
},
|
|
1318
|
+
closable: false,
|
|
1319
|
+
showCancel: false,
|
|
1320
|
+
okText: '我知道了',
|
|
1321
|
+
width: 321
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
// 翻译官-人员创建-Dialog
|
|
1326
|
+
}, {
|
|
1327
|
+
key: "openCreateInterpreterStatusToast",
|
|
1328
|
+
value: function openCreateInterpreterStatusToast(interpreter) {
|
|
1329
|
+
var _this10 = this;
|
|
1330
|
+
var dialogKey = this._uiEventStore.openConfirmDialog({
|
|
1331
|
+
title: '你被指为翻译官',
|
|
1332
|
+
content: (0, _dialogContent.DialogContent)({
|
|
1333
|
+
content: '请确认打开麦克风,并通过主界面按钮进行2种语言的输出切换。',
|
|
1334
|
+
userInfo: interpreter
|
|
1335
|
+
}),
|
|
1336
|
+
alignCenter: true,
|
|
1337
|
+
onOk: function onOk() {
|
|
1338
|
+
_this10._uiEventStore.closeDialog(dialogKey);
|
|
1339
|
+
},
|
|
1340
|
+
closable: false,
|
|
1341
|
+
showCancel: false,
|
|
1342
|
+
okText: '我知道了',
|
|
1343
|
+
width: 321,
|
|
1344
|
+
height: 234
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
// 翻译官-人员取消-Dialog
|
|
1348
|
+
}, {
|
|
1349
|
+
key: "openCancelInterpreterStatusToast",
|
|
1350
|
+
value: function openCancelInterpreterStatusToast() {
|
|
1351
|
+
var _this11 = this;
|
|
1352
|
+
var dialogKey = this._uiEventStore.openConfirmDialog({
|
|
1353
|
+
title: '翻译权限被收回',
|
|
1354
|
+
content: (0, _dialogContent.DialogContent)({
|
|
1355
|
+
content: '会议管理员已取消您的翻译官身份',
|
|
1356
|
+
userInfo: null
|
|
1357
|
+
}),
|
|
1358
|
+
alignCenter: true,
|
|
1359
|
+
onOk: function onOk() {
|
|
1360
|
+
_this11._uiEventStore.closeDialog(dialogKey);
|
|
1361
|
+
},
|
|
1362
|
+
closable: false,
|
|
1363
|
+
showCancel: false,
|
|
1364
|
+
okText: '我知道了',
|
|
1365
|
+
width: 321
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
// #endregion
|
|
1369
|
+
}, {
|
|
1370
|
+
key: "release",
|
|
1371
|
+
value: function release() {}
|
|
1372
|
+
}]);
|
|
1373
|
+
}();
|
|
1374
|
+
_InterpreterStore = InterpreterStore;
|
|
1375
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_InterpreterStore, [[_mobx.observable, 1, "isScroll"], [_mobx.observable, 1, "_languageRoomList"], [_mobx.observable, 1, "localInterpreterUsers"], [_mobx.observable, 1, "storeLocalUser"], [_mobx.observable, 1, "interpreterUsersEditState"], [_mobx.observable, 1, "initUsers"], [_mobx.computed, 3, "interpreterState"], [_mobx.computed, 3, "interpreterUsersCheckPass"], [_mobx.computed, 3, "interpreterUsersAllOffLine"], [_mobx.computed, 3, "languageList"], [_getInitUsersDecs, 18, "getInitUsers"], [_updateUsersDecs, 18, "updateUsers"], [_openInterpreterStateDecs, 18, "openInterpreterState"], [_closeInterpreterStateDecs, 18, "closeInterpreterState"], [_setInterpreterListEditStateDecs, 18, "setInterpreterListEditState"], [_addInterpreterUsersDecs, 18, "addInterpreterUsers"], [_deleteInterpreterUsersDecs, 18, "deleteInterpreterUsers"], [_updateInterpreterUsersDecs, 18, "updateInterpreterUsers"], [_queryInterpreterUsersDecs, 18, "queryInterpreterUsers"], [_updateInterpreterRoomStatusDecs, 18, "updateInterpreterRoomStatus"], [_restoreVolumeByMainRoomDecs, 18, "restoreVolumeByMainRoom"], [_updateCancelRoomLstStatusDecs, 18, "updateCancelRoomLstStatus"], [_changeMainRoomStreamDecs, 18, "changeMainRoomStream"], [_clonseInterpreterRoomInputDecs, 18, "clonseInterpreterRoomInput"], [_updatedInterpreterRoomStatusDecs, 18, "updatedInterpreterRoomStatus"], [_updateLanguageRoomListDecs, 18, "updateLanguageRoomList"], [_onStreamVolumeIndicationUpdatedDecs, 18, "onStreamVolumeIndicationUpdated"], [_changeInputLanguageDecs, 18, "changeInputLanguage"], [_changeOutputLanguageDecs, 18, "changeOutputLanguage"], [_bindLocalMicrophoneIdDecs, 18, "bindLocalMicrophoneId"], [_joinInterpreterRoomDecs, 18, "joinInterpreterRoom"], [_leaveInterpreterRoomDecs, 18, "leaveInterpreterRoom"], [_openInterpreterDialogDecs, 18, "openInterpreterDialog"], [_closeInterpreterDialogDecs, 18, "closeInterpreterDialog"], [_setIsScrollDecs, 18, "setIsScroll"], [_getLocalUserByInterpreterDecs, 18, "getLocalUserByInterpreter"], [_checkIsSelfOperationDecs, 18, "checkIsSelfOperation"], [_closeDialogDecs, 18, "closeDialog"], [_interpreterUsersUpdatedToastDecs, 18, "interpreterUsersUpdatedToast"], [_interpreterStateUpdatedToastDecs, 18, "interpreterStateUpdatedToast"], [_openUpdateInterpreterStateToastDecs, 18, "openUpdateInterpreterStateToast"], [_updateInterpreterUsersToastDecs, 18, "updateInterpreterUsersToast"], [_openUpdateLanguageDialogDecs, 18, "openUpdateLanguageDialog"], [_openCreateInterpreterStatusToastDecs, 18, "openCreateInterpreterStatusToast"], [_openCancelInterpreterStatusToastDecs, 18, "openCancelInterpreterStatusToast"]], []).e, 7);
|
|
1376
|
+
_init_isScroll = _applyDecs$e[0];
|
|
1377
|
+
_init__languageRoomList = _applyDecs$e[1];
|
|
1378
|
+
_init_localInterpreterUsers = _applyDecs$e[2];
|
|
1379
|
+
_init_storeLocalUser = _applyDecs$e[3];
|
|
1380
|
+
_init_interpreterUsersEditState = _applyDecs$e[4];
|
|
1381
|
+
_init_initUsers = _applyDecs$e[5];
|
|
1382
|
+
_initProto = _applyDecs$e[6];
|