fcr-core 3.10.2 → 3.10.5
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/engine/index.js +102 -108
- package/lib/imports.js +1 -0
- package/lib/media-control/desktop.js +22 -13
- package/lib/media-control/mobile.js +27 -19
- package/lib/media-control/type.d.ts +3 -3
- package/lib/monitor-control/index.js +17 -7
- package/lib/peer-session/index.js +120 -121
- package/lib/plugins/chat/chatroom.js +119 -96
- package/lib/plugins/chat/connector.js +69 -48
- package/lib/remote-control/index.js +194 -216
- package/lib/room-control/ability-control/index.js +20 -10
- package/lib/room-control/application-control/index.js +82 -75
- package/lib/room-control/group-control/index.js +31 -30
- package/lib/room-control/helpers/board-init-info-helper.js +16 -10
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +70 -51
- package/lib/room-control/infinity-room-control/index.js +27 -19
- package/lib/room-control/interpreter-control/index.js +77 -65
- package/lib/room-control/interpreter-control/room.js +6 -4
- package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
- package/lib/room-control/mainroom-control/index.js +37 -25
- package/lib/room-control/privilege-control/helper.js +28 -13
- package/lib/room-control/privilege-control/index.js +36 -28
- package/lib/room-control/room-connector-control/index.js +52 -49
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.js +10 -12
- package/lib/room-control/room-session/index.js +77 -74
- package/lib/room-control/shared-cache.js +63 -56
- package/lib/room-control/sharing-control/index.js +65 -57
- package/lib/room-control/stream-control/index.js +197 -193
- package/lib/room-control/stt-control/de-compress-gzip.js +10 -0
- package/lib/room-control/stt-control/index.js +93 -86
- package/lib/room-control/user-control/index.js +162 -155
- package/lib/room-control/waitingroom-control/index.js +18 -9
- package/lib/room-control/whiteboard-control/utils.js +4 -2
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
- package/lib/room-control/whiteboard-control-v1/board-window.js +120 -103
- package/lib/room-control/whiteboard-control-v1/factory.js +7 -4
- package/lib/room-control/whiteboard-control-v1/index.js +80 -67
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +4 -2
- package/lib/room-control/whiteboard-control-v1/utils.js +17 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +14 -10
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +17 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +61 -53
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +39 -30
- package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +27 -11
- package/lib/room-control/widget-control/index.js +43 -33
- package/lib/room-router/index.js +66 -58
- package/lib/schema.d.ts +15 -15
- package/lib/service/api.js +446 -548
- package/lib/struct.js +5 -2
- package/lib/utilities/abortable-retry.js +3 -0
- package/lib/utilities/collection.js +15 -11
- package/lib/utilities/error-helpers.js +34 -27
- package/lib/utilities/error.js +4 -3
- package/lib/utilities/join-helper.js +37 -31
- package/lib/utilities/logger.js +8 -5
- package/lib/utilities/parameters.js +21 -10
- package/lib/utilities/retry-helpers.js +1 -0
- package/lib/utilities/stream.js +16 -11
- package/lib/utilities/user.js +4 -3
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.js +10 -5
- package/lib-es/engine/index.js +102 -108
- package/lib-es/media-control/desktop.js +22 -13
- package/lib-es/media-control/mobile.js +27 -19
- package/lib-es/monitor-control/index.js +16 -7
- package/lib-es/peer-session/index.js +120 -121
- package/lib-es/plugins/chat/chatroom.js +118 -95
- package/lib-es/plugins/chat/connector.js +67 -47
- package/lib-es/remote-control/index.js +194 -216
- package/lib-es/room-control/ability-control/index.js +19 -10
- package/lib-es/room-control/application-control/index.js +81 -75
- package/lib-es/room-control/group-control/index.js +31 -30
- package/lib-es/room-control/helpers/board-init-info-helper.js +15 -10
- package/lib-es/room-control/helpers/validation-helper.js +1 -1
- package/lib-es/room-control/index.js +69 -51
- package/lib-es/room-control/infinity-room-control/index.js +26 -19
- package/lib-es/room-control/interpreter-control/index.js +77 -65
- package/lib-es/room-control/interpreter-control/room.js +5 -4
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +5 -4
- package/lib-es/room-control/mainroom-control/index.js +37 -25
- package/lib-es/room-control/privilege-control/helper.js +27 -13
- package/lib-es/room-control/privilege-control/index.js +36 -28
- package/lib-es/room-control/room-connector-control/index.js +52 -49
- package/lib-es/room-control/room-control-factory.js +10 -12
- package/lib-es/room-control/room-session/index.js +77 -74
- package/lib-es/room-control/shared-cache.js +62 -56
- package/lib-es/room-control/sharing-control/index.js +64 -57
- package/lib-es/room-control/stream-control/index.js +197 -193
- package/lib-es/room-control/stt-control/de-compress-gzip.js +10 -0
- package/lib-es/room-control/stt-control/index.js +93 -86
- package/lib-es/room-control/user-control/index.js +162 -155
- package/lib-es/room-control/waitingroom-control/index.js +18 -9
- package/lib-es/room-control/whiteboard-control/utils.js +4 -2
- package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +120 -103
- package/lib-es/room-control/whiteboard-control-v1/factory.js +6 -4
- package/lib-es/room-control/whiteboard-control-v1/index.js +80 -67
- package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +3 -2
- package/lib-es/room-control/whiteboard-control-v1/utils.js +17 -14
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +13 -10
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +16 -8
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +60 -53
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +39 -30
- package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +26 -11
- package/lib-es/room-control/widget-control/index.js +42 -33
- package/lib-es/room-router/index.js +66 -58
- package/lib-es/service/api.js +445 -548
- package/lib-es/struct.js +4 -2
- package/lib-es/utilities/abortable-retry.js +3 -0
- package/lib-es/utilities/collection.js +14 -11
- package/lib-es/utilities/error-helpers.js +33 -26
- package/lib-es/utilities/error.js +4 -3
- package/lib-es/utilities/join-helper.js +36 -29
- package/lib-es/utilities/logger.js +7 -5
- package/lib-es/utilities/parameters.js +21 -10
- package/lib-es/utilities/retry-helpers.js +1 -0
- package/lib-es/utilities/stream.js +15 -11
- package/lib-es/utilities/user.js +4 -3
- package/lib-es/utilities/validate-params.js +1 -1
- package/lib-es/utilities/video-encoder-config.js +10 -5
- package/package.json +4 -4
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
|
1
3
|
import "core-js/modules/esnext.function.metadata.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
2
5
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
3
6
|
import "core-js/modules/esnext.map.emplace.js";
|
|
4
7
|
import "core-js/modules/esnext.map.every.js";
|
|
@@ -14,12 +17,18 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
14
17
|
import "core-js/modules/esnext.map.some.js";
|
|
15
18
|
import "core-js/modules/esnext.map.update.js";
|
|
16
19
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
17
|
-
|
|
20
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
21
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
22
|
+
var _FcrBaseRoomControlImpl;
|
|
23
|
+
let _initProto, _joinDecs, _updateRoomPropertiesDecs, _updateIncrementRoomPropertiesDecs, _deleteRoomPropertiesDecs, _startCloudRecordingDecs, _startLiveStreamingDecs, _updateLiveStreamingLayoutDecs, _sendRoomMessageDecs, _ref;
|
|
24
|
+
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; }
|
|
25
|
+
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) { _defineProperty(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; }
|
|
18
26
|
import "core-js/modules/es.array.includes.js";
|
|
19
27
|
import "core-js/modules/es.array.push.js";
|
|
20
28
|
import "core-js/modules/es.json.stringify.js";
|
|
21
29
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
22
30
|
import "core-js/modules/esnext.iterator.for-each.js";
|
|
31
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
23
32
|
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 (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 (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (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 (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)]; } }; }
|
|
24
33
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
34
|
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); }
|
|
@@ -69,19 +78,17 @@ import { FcrApplicationControlImpl } from './application-control';
|
|
|
69
78
|
*
|
|
70
79
|
* @internal
|
|
71
80
|
*/
|
|
81
|
+
_ref = (_joinDecs = trace(['options']), _updateRoomPropertiesDecs = trace(['properties', 'cause']), _updateIncrementRoomPropertiesDecs = trace(['increments', 'cause']), _deleteRoomPropertiesDecs = trace(['properties', 'cause']), _startCloudRecordingDecs = trace(['config']), _startLiveStreamingDecs = trace(['data']), _updateLiveStreamingLayoutDecs = trace(['layoutType']), _sendRoomMessageDecs = trace(['payload', 'guaranteedDelivery']), "logger");
|
|
72
82
|
export class FcrBaseRoomControlImpl {
|
|
73
|
-
static {
|
|
74
|
-
[_initProto] = _applyDecs(this, [[trace, 2, "getSyncTimestamp"], [trace, 2, "getRoomInfo"], [trace, 2, "getRoomSchedule"], [trace, 2, "getLocalExDataSyncTypeList"], [_joinDecs, 2, "join"], [trace, 2, "leave"], [trace, 2, "release"], [trace, 2, "start"], [trace, 2, "end"], [trace, 2, "close"], [trace, 2, "getRoomState"], [trace, 2, "getRoomProperties"], [trace, 2, "getRoomPropertiesByKeyPath"], [_updateRoomPropertiesDecs, 2, "updateRoomProperties"], [_updateIncrementRoomPropertiesDecs, 2, "updateIncrementRoomProperties"], [_deleteRoomPropertiesDecs, 2, "deleteRoomProperties"], [_startCloudRecordingDecs, 2, "startCloudRecording"], [trace, 2, "pauseCloudRecording"], [trace, 2, "resumeCloudRecording"], [trace, 2, "stopCloudRecording"], [trace, 2, "getLiveStreamingState"], [trace, 2, "getLiveStreamingConfig"], [_startLiveStreamingDecs, 2, "startLiveStreaming"], [_updateLiveStreamingLayoutDecs, 2, "updateLiveStreamingLayout"], [trace, 2, "stopLiveStreaming"], [trace, 2, "getCloudRecordingState"], [_sendRoomMessageDecs, 2, "sendRoomMessage"]], []).e;
|
|
75
|
-
}
|
|
76
|
-
//@internal
|
|
77
|
-
[(_joinDecs = trace(['options']), _updateRoomPropertiesDecs = trace(['properties', 'cause']), _updateIncrementRoomPropertiesDecs = trace(['increments', 'cause']), _deleteRoomPropertiesDecs = trace(['properties', 'cause']), _startCloudRecordingDecs = trace(['config']), _startLiveStreamingDecs = trace(['data']), _updateLiveStreamingLayoutDecs = trace(['layoutType']), _sendRoomMessageDecs = trace(['payload', 'guaranteedDelivery']), "logger")] = (_initProto(this), createLogger({
|
|
78
|
-
prefix: 'FcrBaseRoomControlImpl'
|
|
79
|
-
}));
|
|
80
|
-
_observable = new AgoraObservable();
|
|
81
|
-
_joinRoomSuccess = false;
|
|
82
|
-
_joining = false;
|
|
83
|
-
_joinState = ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
84
83
|
constructor(_engine, _scene, _api, _config, _roomType, _chatConnection, _sharedCache, _chatRoomControl) {
|
|
84
|
+
//@internal
|
|
85
|
+
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
86
|
+
prefix: 'FcrBaseRoomControlImpl'
|
|
87
|
+
})));
|
|
88
|
+
_defineProperty(this, "_observable", new AgoraObservable());
|
|
89
|
+
_defineProperty(this, "_joinRoomSuccess", false);
|
|
90
|
+
_defineProperty(this, "_joining", false);
|
|
91
|
+
_defineProperty(this, "_joinState", ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED);
|
|
85
92
|
this._engine = _engine;
|
|
86
93
|
this._scene = _scene;
|
|
87
94
|
this._api = _api;
|
|
@@ -91,9 +98,8 @@ export class FcrBaseRoomControlImpl {
|
|
|
91
98
|
this._sharedCache = _sharedCache;
|
|
92
99
|
this._chatRoomControl = _chatRoomControl;
|
|
93
100
|
// 初始化 FcrJoinHelper
|
|
94
|
-
const
|
|
95
|
-
userId
|
|
96
|
-
} = this._engine.getConfig();
|
|
101
|
+
const _this$_engine$getConf = this._engine.getConfig(),
|
|
102
|
+
userId = _this$_engine$getConf.userId;
|
|
97
103
|
this._joinHelper = new FcrJoinHelper(userId, this._scene, this._api);
|
|
98
104
|
this._engineObserver = {
|
|
99
105
|
onConnectionStateUpdated: state => {
|
|
@@ -105,8 +111,9 @@ export class FcrBaseRoomControlImpl {
|
|
|
105
111
|
};
|
|
106
112
|
this._sceneObserver = {
|
|
107
113
|
onJoinSceneSuccess: (sceneId, localUser) => {
|
|
114
|
+
var _this$_chatRoomContro;
|
|
108
115
|
this._joinRoomSuccess = true;
|
|
109
|
-
this._chatRoomControl
|
|
116
|
+
(_this$_chatRoomContro = this._chatRoomControl) === null || _this$_chatRoomContro === void 0 || _this$_chatRoomContro.join();
|
|
110
117
|
this._userControl = new FcrUserControlImpl(this._scene, this._api, this._sharedCache);
|
|
111
118
|
this._streamControl = new FcrStreamControlImpl(this._engine, this._scene, this._api, this._sharedCache);
|
|
112
119
|
this._roomSessionControl = new FcrRoomSessionControlImpl(this, this._api, localUser.getLocalUserId());
|
|
@@ -140,31 +147,33 @@ export class FcrBaseRoomControlImpl {
|
|
|
140
147
|
this._observable.notifyObservers('onRoomMessageReceived', sceneId, message);
|
|
141
148
|
const payload = message.payload;
|
|
142
149
|
if (message.cmd === ROOM_MESSAGE_COMMANDS.ROOM_ROUTE_SWITCH) {
|
|
143
|
-
|
|
150
|
+
var _this$_userControl;
|
|
151
|
+
const localUserRole = (_this$_userControl = this._userControl) === null || _this$_userControl === void 0 ? void 0 : _this$_userControl.getLocalUser().userRole;
|
|
144
152
|
if (localUserRole && payload.targetRoles.includes(FcrUserRoleToStringMap[localUserRole])) {
|
|
153
|
+
var _this$_userControl2;
|
|
145
154
|
this._observable.notifyObservers('onRoomRouteSwitched', {
|
|
146
155
|
targetRouting: {
|
|
147
156
|
roomId: payload.toRoom.roomUuid,
|
|
148
157
|
roomType: payload.toRoom.roomType,
|
|
149
158
|
isJoined: false
|
|
150
159
|
},
|
|
151
|
-
operatorUser: this._userControl
|
|
160
|
+
operatorUser: (_this$_userControl2 = this._userControl) === null || _this$_userControl2 === void 0 ? void 0 : _this$_userControl2.getUser(message.senderId)
|
|
152
161
|
});
|
|
153
162
|
this.leave();
|
|
154
163
|
}
|
|
155
164
|
}
|
|
156
165
|
},
|
|
157
166
|
onScenePropertiesUpdated: async (sceneId, event) => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
167
|
+
var _event$cause, _event$cause2, _event$cause3, _event$cause4;
|
|
168
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
|
|
169
|
+
const _ref2 = this._scene.getSceneProperties().record,
|
|
170
|
+
state = _ref2.state,
|
|
171
|
+
ready = _ref2.ready,
|
|
172
|
+
onhold = _ref2.onhold;
|
|
164
173
|
const recordState = this._formatRecordingState(state, ready, onhold);
|
|
165
174
|
this._observable.notifyObservers('onCloudRecordingStateUpdated', sceneId, recordState);
|
|
166
175
|
}
|
|
167
|
-
if (event.cause
|
|
176
|
+
if (((_event$cause2 = event.cause) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.cmd) === ROOM_MESSAGE_COMMANDS.ROOM_STATE_UPDATE) {
|
|
168
177
|
const schedule = event.changedProperties.schedule;
|
|
169
178
|
if (schedule.state === ROOM_STATE_VALUES.ENDED) {
|
|
170
179
|
this._joinState = ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
@@ -172,7 +181,7 @@ export class FcrBaseRoomControlImpl {
|
|
|
172
181
|
}
|
|
173
182
|
this._observable.notifyObservers('onRoomStateUpdated', sceneId, schedule.state);
|
|
174
183
|
}
|
|
175
|
-
if (event.cause
|
|
184
|
+
if (((_event$cause3 = event.cause) === null || _event$cause3 === void 0 ? void 0 : _event$cause3.cmd) === ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
176
185
|
const changedProperties = {};
|
|
177
186
|
for (const key in event.changedProperties) {
|
|
178
187
|
if (key.startsWith('flexProps')) {
|
|
@@ -181,17 +190,17 @@ export class FcrBaseRoomControlImpl {
|
|
|
181
190
|
}
|
|
182
191
|
if (Object.keys(changedProperties).length > 0) {
|
|
183
192
|
const structure = convertToStructure(changedProperties);
|
|
184
|
-
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, {
|
|
185
|
-
...event,
|
|
193
|
+
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, _objectSpread(_objectSpread({}, event), {}, {
|
|
186
194
|
changedProperties: structure['flexProps']
|
|
187
|
-
});
|
|
195
|
+
}));
|
|
188
196
|
}
|
|
189
197
|
}
|
|
190
|
-
if (event.cause
|
|
198
|
+
if (((_event$cause4 = event.cause) === null || _event$cause4 === void 0 ? void 0 : _event$cause4.cmd) === ROOM_MESSAGE_COMMANDS.LIVE_STREAMING_UPDATE) {
|
|
199
|
+
var _event$cause5;
|
|
191
200
|
let liveStreamingState = FcrLiveStreamingState.STOPPED;
|
|
192
201
|
let state = this._scene.getScenePropertiesByKeyPath('live.state');
|
|
193
202
|
let pageUrl = this._scene.getScenePropertiesByKeyPath('live.pageUrl');
|
|
194
|
-
const reason = event.cause
|
|
203
|
+
const reason = (_event$cause5 = event.cause) === null || _event$cause5 === void 0 || (_event$cause5 = _event$cause5.data) === null || _event$cause5 === void 0 ? void 0 : _event$cause5.reason;
|
|
195
204
|
if (state === LIVE_STREAMING_STATE_VALUES.STARTED) {
|
|
196
205
|
liveStreamingState = FcrLiveStreamingState.STARTED;
|
|
197
206
|
}
|
|
@@ -202,7 +211,8 @@ export class FcrBaseRoomControlImpl {
|
|
|
202
211
|
}
|
|
203
212
|
},
|
|
204
213
|
onScenePropertiesDeleted: (sceneId, event) => {
|
|
205
|
-
|
|
214
|
+
var _event$cause6;
|
|
215
|
+
if (((_event$cause6 = event.cause) === null || _event$cause6 === void 0 ? void 0 : _event$cause6.cmd) === ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
206
216
|
this._observable.notifyObservers('onRoomPropertiesDeleted', sceneId, event);
|
|
207
217
|
}
|
|
208
218
|
},
|
|
@@ -225,7 +235,8 @@ export class FcrBaseRoomControlImpl {
|
|
|
225
235
|
}
|
|
226
236
|
},
|
|
227
237
|
onUserPropertiesUpdated: (_, event) => {
|
|
228
|
-
|
|
238
|
+
var _event$cause7;
|
|
239
|
+
if (((_event$cause7 = event.cause) === null || _event$cause7 === void 0 ? void 0 : _event$cause7.cmd) === ROOM_MESSAGE_COMMANDS.USER_KICK_OUT && event.modifiedUser.userId === this._scene.localUser.getLocalUserId()) {
|
|
229
240
|
this._joinState = ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
230
241
|
this._cleanup();
|
|
231
242
|
}
|
|
@@ -336,6 +347,7 @@ export class FcrBaseRoomControlImpl {
|
|
|
336
347
|
* @returns 房间信息,如果未加入房间则返回 undefined
|
|
337
348
|
*/
|
|
338
349
|
getRoomInfo() {
|
|
350
|
+
var _passwordInfo$payload;
|
|
339
351
|
const sceneInfo = this._scene.getSceneInfo();
|
|
340
352
|
// 检查是否已加入房间,避免在退出房间时访问已清除的 localUser
|
|
341
353
|
if (!sceneInfo || !this._joinRoomSuccess) {
|
|
@@ -344,18 +356,19 @@ export class FcrBaseRoomControlImpl {
|
|
|
344
356
|
const passwordInfo = this._scene.getScenePropertiesByKeyPath('security.password');
|
|
345
357
|
let shareLink;
|
|
346
358
|
try {
|
|
359
|
+
var _userProperties$info;
|
|
347
360
|
const userProperties = this._scene.getUserPropertiesByUserId(this._scene.localUser.getLocalUserId());
|
|
348
|
-
shareLink = userProperties
|
|
361
|
+
shareLink = userProperties === null || userProperties === void 0 || (_userProperties$info = userProperties.info) === null || _userProperties$info === void 0 ? void 0 : _userProperties$info.shareLink;
|
|
349
362
|
} catch (e) {
|
|
350
363
|
// localUser 可能在退出房间过程中被清除,
|
|
351
|
-
this.logger.warn(
|
|
364
|
+
this.logger.warn("getroomInfo error :".concat(JSON.stringify(e)));
|
|
352
365
|
}
|
|
353
366
|
const label = this._scene.getScenePropertiesByKeyPath('label');
|
|
354
367
|
return {
|
|
355
368
|
roomId: sceneInfo.sceneId,
|
|
356
369
|
roomName: sceneInfo.sceneName,
|
|
357
370
|
roomType: this._roomType,
|
|
358
|
-
password: passwordInfo
|
|
371
|
+
password: passwordInfo === null || passwordInfo === void 0 || (_passwordInfo$payload = passwordInfo.payload) === null || _passwordInfo$payload === void 0 ? void 0 : _passwordInfo$payload.text,
|
|
359
372
|
inviteLink: shareLink,
|
|
360
373
|
label
|
|
361
374
|
};
|
|
@@ -368,11 +381,12 @@ export class FcrBaseRoomControlImpl {
|
|
|
368
381
|
* @throws {FcrError} 如果未加入房间
|
|
369
382
|
*/
|
|
370
383
|
getRoomSchedule() {
|
|
384
|
+
var _schedule$duration, _schedule$startTime;
|
|
371
385
|
validateRoomJoined(this._joinRoomSuccess, 'get schedule info');
|
|
372
386
|
const schedule = this._scene.getScenePropertiesByKeyPath('schedule');
|
|
373
387
|
return {
|
|
374
|
-
duration: schedule.duration
|
|
375
|
-
startTime: Math.floor((schedule.startTime
|
|
388
|
+
duration: (_schedule$duration = schedule.duration) !== null && _schedule$duration !== void 0 ? _schedule$duration : 0,
|
|
389
|
+
startTime: Math.floor(((_schedule$startTime = schedule.startTime) !== null && _schedule$startTime !== void 0 ? _schedule$startTime : 0) / 1000)
|
|
376
390
|
};
|
|
377
391
|
}
|
|
378
392
|
|
|
@@ -384,7 +398,7 @@ export class FcrBaseRoomControlImpl {
|
|
|
384
398
|
getLocalExDataSyncTypeList() {
|
|
385
399
|
const localExDataSyncTypeList = this._scene.getLocalExDataSyncTypeList();
|
|
386
400
|
const result = [];
|
|
387
|
-
localExDataSyncTypeList
|
|
401
|
+
localExDataSyncTypeList === null || localExDataSyncTypeList === void 0 || localExDataSyncTypeList.forEach(syncTypeInfo => {
|
|
388
402
|
const convertedType = this._convertAgoraRteExDataSyncTypeInfoToFcrExDataSyncType(syncTypeInfo);
|
|
389
403
|
if (convertedType) {
|
|
390
404
|
result.push(convertedType);
|
|
@@ -448,7 +462,9 @@ export class FcrBaseRoomControlImpl {
|
|
|
448
462
|
*/
|
|
449
463
|
async _executeJoinProcess(options) {
|
|
450
464
|
const handleJoinAborted = this._createJoinAbortedHandler();
|
|
451
|
-
const
|
|
465
|
+
const _await$to = await to(this._joinHelper.join(options, handleJoinAborted)),
|
|
466
|
+
_await$to2 = _slicedToArray(_await$to, 1),
|
|
467
|
+
error = _await$to2[0];
|
|
452
468
|
if (error) {
|
|
453
469
|
throw error;
|
|
454
470
|
}
|
|
@@ -477,7 +493,7 @@ export class FcrBaseRoomControlImpl {
|
|
|
477
493
|
async _handleRobotUserSetup(options) {
|
|
478
494
|
if (options.userRole === FcrUserRole.ROBOT) {
|
|
479
495
|
const res = handleRequestError(() => this._api.setCloudRecordingReady(this._scene.sceneId), ErrorModuleCode.FCR_ROOM, 'set cloud recording ready failed');
|
|
480
|
-
this.logger.info(
|
|
496
|
+
this.logger.info("set cloud recording ready, response: ".concat(jsonstring(res)));
|
|
481
497
|
}
|
|
482
498
|
}
|
|
483
499
|
|
|
@@ -486,7 +502,7 @@ export class FcrBaseRoomControlImpl {
|
|
|
486
502
|
* @private
|
|
487
503
|
*/
|
|
488
504
|
_handleJoinFailure(error) {
|
|
489
|
-
this.logger.error(
|
|
505
|
+
this.logger.error("failed to join room: ".concat(error.message));
|
|
490
506
|
this._observable.notifyObservers('onJoinRoomFailure', this._scene.sceneId, error);
|
|
491
507
|
}
|
|
492
508
|
|
|
@@ -617,11 +633,10 @@ export class FcrBaseRoomControlImpl {
|
|
|
617
633
|
return FcrReturnCode.SUCCESS;
|
|
618
634
|
}
|
|
619
635
|
getCloudRecordingState() {
|
|
620
|
-
const
|
|
621
|
-
state,
|
|
622
|
-
ready,
|
|
623
|
-
onhold
|
|
624
|
-
} = this._scene.getScenePropertiesByKeyPath('record');
|
|
636
|
+
const _ref3 = this._scene.getScenePropertiesByKeyPath('record'),
|
|
637
|
+
state = _ref3.state,
|
|
638
|
+
ready = _ref3.ready,
|
|
639
|
+
onhold = _ref3.onhold;
|
|
625
640
|
return this._formatRecordingState(state, ready, onhold);
|
|
626
641
|
}
|
|
627
642
|
async sendRoomMessage(payload, guaranteedDelivery) {
|
|
@@ -646,7 +661,8 @@ export class FcrBaseRoomControlImpl {
|
|
|
646
661
|
this._engine.removeObserver(this._engineObserver);
|
|
647
662
|
this._sharedCache.getRoomCache(this._scene.sceneId).clear();
|
|
648
663
|
try {
|
|
649
|
-
|
|
664
|
+
var _this$_chatRoomContro2, _this$sharingControl, _this$sharingControl2;
|
|
665
|
+
return await Promise.all([(_this$_chatRoomContro2 = this._chatRoomControl) === null || _this$_chatRoomContro2 === void 0 ? void 0 : _this$_chatRoomContro2.leave(), (_this$sharingControl = this.sharingControl) === null || _this$sharingControl === void 0 ? void 0 : _this$sharingControl.getBoardControl().close(), (_this$sharingControl2 = this.sharingControl) === null || _this$sharingControl2 === void 0 ? void 0 : _this$sharingControl2.getAnnotationControl().close(), this._scene.leave()]);
|
|
650
666
|
} finally {
|
|
651
667
|
this._joinRoomSuccess = false;
|
|
652
668
|
}
|
|
@@ -668,9 +684,8 @@ export class FcrBaseRoomControlImpl {
|
|
|
668
684
|
}
|
|
669
685
|
async _liveStreamingAction(action, errorMessage) {
|
|
670
686
|
try {
|
|
671
|
-
const
|
|
672
|
-
code
|
|
673
|
-
} = await action();
|
|
687
|
+
const _await$action = await action(),
|
|
688
|
+
code = _await$action.code;
|
|
674
689
|
if (code !== RESPONSE_CODES.SUCCESS) {
|
|
675
690
|
throw liveStreamingErrorHelper.createNetworkError(errorMessage);
|
|
676
691
|
}
|
|
@@ -692,4 +707,7 @@ export class FcrBaseRoomControlImpl {
|
|
|
692
707
|
/**
|
|
693
708
|
* @internal
|
|
694
709
|
*/
|
|
710
|
+
_FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
|
|
711
|
+
var _applyDecs$e = _slicedToArray(_applyDecs(_FcrBaseRoomControlImpl, [[trace, 2, "getSyncTimestamp"], [trace, 2, "getRoomInfo"], [trace, 2, "getRoomSchedule"], [trace, 2, "getLocalExDataSyncTypeList"], [_joinDecs, 2, "join"], [trace, 2, "leave"], [trace, 2, "release"], [trace, 2, "start"], [trace, 2, "end"], [trace, 2, "close"], [trace, 2, "getRoomState"], [trace, 2, "getRoomProperties"], [trace, 2, "getRoomPropertiesByKeyPath"], [_updateRoomPropertiesDecs, 2, "updateRoomProperties"], [_updateIncrementRoomPropertiesDecs, 2, "updateIncrementRoomProperties"], [_deleteRoomPropertiesDecs, 2, "deleteRoomProperties"], [_startCloudRecordingDecs, 2, "startCloudRecording"], [trace, 2, "pauseCloudRecording"], [trace, 2, "resumeCloudRecording"], [trace, 2, "stopCloudRecording"], [trace, 2, "getLiveStreamingState"], [trace, 2, "getLiveStreamingConfig"], [_startLiveStreamingDecs, 2, "startLiveStreaming"], [_updateLiveStreamingLayoutDecs, 2, "updateLiveStreamingLayout"], [trace, 2, "stopLiveStreaming"], [trace, 2, "getCloudRecordingState"], [_sendRoomMessageDecs, 2, "sendRoomMessage"]], []).e, 1);
|
|
712
|
+
_initProto = _applyDecs$e[0];
|
|
695
713
|
export class FcrSubRoomControlImpl extends FcrBaseRoomControlImpl {}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
|
1
3
|
import "core-js/modules/es.array.push.js";
|
|
2
4
|
import "core-js/modules/esnext.function.metadata.js";
|
|
3
5
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
@@ -15,6 +17,10 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
17
|
import "core-js/modules/esnext.map.some.js";
|
|
16
18
|
import "core-js/modules/esnext.map.update.js";
|
|
17
19
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
20
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
21
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
22
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
23
|
+
var _FcrInfinityRoomControlImpl;
|
|
18
24
|
let _initProto;
|
|
19
25
|
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 (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 (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (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 (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)]; } }; }
|
|
20
26
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -30,31 +36,26 @@ import { FcrRoomType } from '../type';
|
|
|
30
36
|
import { addBoardInitInfoObserver } from '../helpers/board-init-info-helper';
|
|
31
37
|
import { clearAnnotationBoardOptions, clearWhiteboardOptions } from '../../utilities/shared-storage';
|
|
32
38
|
import { hasAnnotationWritePermission, hasBoardWritePermission } from '../whiteboard-control/utils';
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
Duration
|
|
36
|
-
} = AgoraScheduler;
|
|
39
|
+
const sharedScheduler = AgoraScheduler.shared,
|
|
40
|
+
Duration = AgoraScheduler.Duration;
|
|
37
41
|
/**
|
|
38
42
|
* @internal
|
|
39
43
|
*/
|
|
40
44
|
export class FcrInfinityRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
41
|
-
static {
|
|
42
|
-
[_initProto] = _applyDecs(this, [[trace, 2, "getAnnouncement"], [trace, 2, "join"], [trace, 2, "leave"], [bound, 2, "_onLocalUserPermissionInfoDeleted"]], [], 0, void 0, FcrBaseRoomControlImpl).e;
|
|
43
|
-
}
|
|
44
|
-
//@internal
|
|
45
|
-
logger = (_initProto(this), createLogger({
|
|
46
|
-
prefix: 'FcrInfinityRoomControlImpl'
|
|
47
|
-
}));
|
|
48
|
-
_privilegeObserver = {
|
|
49
|
-
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
50
|
-
};
|
|
51
45
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl, monitorControl) {
|
|
52
46
|
super(engine, scene, api, config, FcrRoomType.Infinityroom, chatConnection, sharedCache, chatRoomControl);
|
|
47
|
+
//@internal
|
|
48
|
+
_defineProperty(this, "logger", (_initProto(this), createLogger({
|
|
49
|
+
prefix: 'FcrInfinityRoomControlImpl'
|
|
50
|
+
})));
|
|
51
|
+
_defineProperty(this, "_privilegeObserver", {
|
|
52
|
+
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
53
|
+
});
|
|
53
54
|
this._monitorControl = monitorControl;
|
|
54
55
|
this._interpreterControl = new FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
55
56
|
this._addLogObserver();
|
|
56
57
|
addBoardInitInfoObserver(this._scene, this._api, this.logger);
|
|
57
|
-
this.logger.info(
|
|
58
|
+
this.logger.info("initialized, room id: ".concat(this._scene.sceneId));
|
|
58
59
|
}
|
|
59
60
|
getAnnouncement() {
|
|
60
61
|
const announcement = this._scene.getScenePropertiesByKeyPath('info.announcement');
|
|
@@ -85,7 +86,8 @@ export class FcrInfinityRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
85
86
|
privilegeControl.removeObserver(this._privilegeObserver);
|
|
86
87
|
return await super.leave();
|
|
87
88
|
} finally {
|
|
88
|
-
|
|
89
|
+
var _this$_logUploadTask;
|
|
90
|
+
(_this$_logUploadTask = this._logUploadTask) === null || _this$_logUploadTask === void 0 || _this$_logUploadTask.stop();
|
|
89
91
|
this._uploadLog();
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -107,12 +109,12 @@ export class FcrInfinityRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
107
109
|
}
|
|
108
110
|
_onLocalUserPermissionInfoDeleted(roomId, event) {
|
|
109
111
|
if (hasBoardWritePermission(event.permissionInfo)) {
|
|
110
|
-
this.logger.info(
|
|
112
|
+
this.logger.info("remove board write permission");
|
|
111
113
|
|
|
112
114
|
// this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
|
|
113
115
|
}
|
|
114
116
|
if (hasAnnotationWritePermission(event.permissionInfo)) {
|
|
115
|
-
this.logger.info(
|
|
117
|
+
this.logger.info("remove annotation write permission");
|
|
116
118
|
|
|
117
119
|
// this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
|
|
118
120
|
}
|
|
@@ -120,4 +122,9 @@ export class FcrInfinityRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
120
122
|
_addLogObserver() {
|
|
121
123
|
this.addObserver(generateLogObserver(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']], ['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
|
|
122
124
|
}
|
|
123
|
-
}
|
|
125
|
+
}
|
|
126
|
+
_FcrInfinityRoomControlImpl = FcrInfinityRoomControlImpl;
|
|
127
|
+
var _applyDecs$e = _applyDecs(_FcrInfinityRoomControlImpl, [[trace, 2, "getAnnouncement"], [trace, 2, "join"], [trace, 2, "leave"], [bound, 2, "_onLocalUserPermissionInfoDeleted"]], [], 0, void 0, FcrBaseRoomControlImpl).e;
|
|
128
|
+
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
129
|
+
_initProto = _applyDecs$e2[0];
|
|
130
|
+
_applyDecs$e;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
|
1
3
|
import "core-js/modules/es.array.push.js";
|
|
2
4
|
import "core-js/modules/esnext.function.metadata.js";
|
|
3
5
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
@@ -15,7 +17,11 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
17
|
import "core-js/modules/esnext.map.some.js";
|
|
16
18
|
import "core-js/modules/esnext.map.update.js";
|
|
17
19
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
18
|
-
|
|
20
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
21
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
22
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
23
|
+
var _FcrInterpreterControlImpl;
|
|
24
|
+
let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs, _ref;
|
|
19
25
|
import "core-js/modules/es.array.includes.js";
|
|
20
26
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
21
27
|
import "core-js/modules/esnext.iterator.map.js";
|
|
@@ -38,45 +44,44 @@ import { ErrorModuleCode } from '../../imports';
|
|
|
38
44
|
/**
|
|
39
45
|
* @internal
|
|
40
46
|
*/
|
|
47
|
+
_ref = (_createRoomControlDecs = [trace(['roomId']), validateParams(stringSchema)], _setInterpreterUsersDecs = [trace(['params']), validateParams(fcrInterpreterUsersParamsArraySchema)], "logger");
|
|
41
48
|
export class FcrInterpreterControlImpl {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
49
|
+
constructor(_api, _scene, _config, _engine, _chatConnection, _sharedCache) {
|
|
50
|
+
//@internal
|
|
51
|
+
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
52
|
+
prefix: 'FcrInterpreterControlImpl'
|
|
53
|
+
})));
|
|
54
|
+
_defineProperty(this, "_observable", new AgoraObservable());
|
|
55
|
+
_defineProperty(this, "_interpreterUserList", null);
|
|
56
|
+
_defineProperty(this, "_sceneObserver", {
|
|
57
|
+
onScenePropertiesUpdated: (_, event) => {
|
|
58
|
+
var _event$cause;
|
|
59
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 800) {
|
|
60
|
+
const actionType = get(event.cause.data, 'actionType');
|
|
61
|
+
let operatorUser;
|
|
62
|
+
if (event.operatorUser) {
|
|
63
|
+
operatorUser = convertRteUserToFcrUser(event.operatorUser, this._roomCache);
|
|
64
|
+
}
|
|
65
|
+
const isStateUpdated = [FcrInterpreterActionType.OPEN, FcrInterpreterActionType.CLOSE].includes(actionType);
|
|
66
|
+
const isUpdated = [
|
|
67
|
+
// FcrInterpreterActionType.OPEN,
|
|
68
|
+
FcrInterpreterActionType.UPDATE].includes(actionType);
|
|
69
|
+
if (isStateUpdated || isUpdated) {
|
|
70
|
+
this._setInterpreterUserList();
|
|
71
|
+
}
|
|
72
|
+
if (isStateUpdated) {
|
|
73
|
+
this._observable.notifyObservers('onInterpreterStateUpdated', this._roomId, this.getState(), operatorUser);
|
|
74
|
+
}
|
|
75
|
+
if (isUpdated) {
|
|
76
|
+
this._observable.notifyObservers('onInterpreterUsersUpdated', this._roomId, this.getInterpreterUserList(), operatorUser);
|
|
77
|
+
this._observable.notifyObservers('onInterpreterRoomListUpdated', this._roomId, this.getInterpreterRoomList(), operatorUser);
|
|
78
|
+
}
|
|
72
79
|
}
|
|
80
|
+
},
|
|
81
|
+
onJoinSceneSuccess: () => {
|
|
82
|
+
this._setInterpreterUserList();
|
|
73
83
|
}
|
|
74
|
-
}
|
|
75
|
-
onJoinSceneSuccess: () => {
|
|
76
|
-
this._setInterpreterUserList();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
constructor(_api, _scene, _config, _engine, _chatConnection, _sharedCache) {
|
|
84
|
+
});
|
|
80
85
|
this._api = _api;
|
|
81
86
|
this._scene = _scene;
|
|
82
87
|
this._config = _config;
|
|
@@ -97,11 +102,10 @@ export class FcrInterpreterControlImpl {
|
|
|
97
102
|
await handleRequestError(() => this._api.openInterpreter({
|
|
98
103
|
roomId: this._roomId,
|
|
99
104
|
data: {
|
|
100
|
-
interpreters: params.map(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}) => {
|
|
105
|
+
interpreters: params.map(_ref2 => {
|
|
106
|
+
let userUuid = _ref2.userId,
|
|
107
|
+
sourceLanguage = _ref2.sourceLanguage,
|
|
108
|
+
targetLanguage = _ref2.targetLanguage;
|
|
105
109
|
return {
|
|
106
110
|
userUuid,
|
|
107
111
|
languagePair: [sourceLanguage, targetLanguage]
|
|
@@ -125,31 +129,34 @@ export class FcrInterpreterControlImpl {
|
|
|
125
129
|
}
|
|
126
130
|
getInterpreterRoomList() {
|
|
127
131
|
const rooms = this._scene.getScenePropertiesByKeyPath('interpreter.rooms') || [];
|
|
128
|
-
return rooms.length > 0 ? rooms.map(
|
|
129
|
-
roomUuid,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
return rooms.length > 0 ? rooms.map(_ref3 => {
|
|
133
|
+
let roomUuid = _ref3.roomUuid,
|
|
134
|
+
language = _ref3.language;
|
|
135
|
+
return {
|
|
136
|
+
roomId: roomUuid,
|
|
137
|
+
language
|
|
138
|
+
};
|
|
139
|
+
}) : null;
|
|
135
140
|
}
|
|
136
141
|
_setInterpreterUserList() {
|
|
137
142
|
const interpreter = this._scene.getScenePropertiesByKeyPath('interpreter');
|
|
138
|
-
const {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
translates
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
const _ref4 = interpreter || {
|
|
144
|
+
translates: []
|
|
145
|
+
},
|
|
146
|
+
translates = _ref4.translates;
|
|
147
|
+
const results = translates.map(_ref5 => {
|
|
148
|
+
let userId = _ref5.userUuid,
|
|
149
|
+
userName = _ref5.userName,
|
|
150
|
+
_ref5$languagePair = _slicedToArray(_ref5.languagePair, 2),
|
|
151
|
+
sourceLanguage = _ref5$languagePair[0],
|
|
152
|
+
targetLanguage = _ref5$languagePair[1];
|
|
153
|
+
return {
|
|
154
|
+
userId,
|
|
155
|
+
userName,
|
|
156
|
+
sourceLanguage,
|
|
157
|
+
targetLanguage
|
|
158
|
+
};
|
|
159
|
+
});
|
|
153
160
|
this._interpreterUserList = results.length > 0 ? results : null;
|
|
154
161
|
}
|
|
155
162
|
getInterpreterUserList() {
|
|
@@ -175,4 +182,9 @@ export class FcrInterpreterControlImpl {
|
|
|
175
182
|
_addLogObserver() {
|
|
176
183
|
this.addObserver(generateLogObserver(this.logger, [['onInterpreterStateUpdated', ['roomId', 'state', 'operatorUser']], ['onInterpreterUsersUpdated', ['roomId', 'users', 'operatorUser']], ['onInterpreterRoomListUpdated', ['roomId', 'rooms', 'operatorUser']]]));
|
|
177
184
|
}
|
|
178
|
-
}
|
|
185
|
+
}
|
|
186
|
+
_FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
187
|
+
var _applyDecs$e = _applyDecs(_FcrInterpreterControlImpl, [[_createRoomControlDecs, 2, "createRoomControl"], [_setInterpreterUsersDecs, 2, "setInterpreterUsers"], [trace, 2, "close"], [trace, 2, "getState"], [trace, 2, "getInterpreterRoomList"], [trace, 2, "getInterpreterLanguageList"], [trace, 2, "release"]], []).e;
|
|
188
|
+
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
189
|
+
_initProto = _applyDecs$e2[0];
|
|
190
|
+
_applyDecs$e;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import { FcrBaseRoomControlImpl } from '..';
|
|
2
3
|
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
3
4
|
import { FcrRoomType } from '../type';
|
|
@@ -5,12 +6,12 @@ import { FcrRoomType } from '../type';
|
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
8
|
export class FcrInterpreterRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
8
|
-
//@internal
|
|
9
|
-
logger = createLogger({
|
|
10
|
-
prefix: 'FcrInterpreterRoomControlImpl'
|
|
11
|
-
});
|
|
12
9
|
constructor(_engine, _scene, _api, _config, _sharedCache, _chatConnection, chatRoomControl) {
|
|
13
10
|
super(_engine, _scene, _api, _config, FcrRoomType.Interpreterroom, _chatConnection, _sharedCache, chatRoomControl);
|
|
11
|
+
//@internal
|
|
12
|
+
_defineProperty(this, "logger", createLogger({
|
|
13
|
+
prefix: 'FcrInterpreterRoomControlImpl'
|
|
14
|
+
}));
|
|
14
15
|
this._engine = _engine;
|
|
15
16
|
this._scene = _scene;
|
|
16
17
|
this._api = _api;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import { FcrBaseRoomControlImpl } from '..';
|
|
2
3
|
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
3
4
|
import { FcrRoomType } from '../type';
|
|
@@ -6,12 +7,12 @@ import { FcrRoomType } from '../type';
|
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
9
|
export class FcrJoinBeforeHostWaitingRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
9
|
-
//@internal
|
|
10
|
-
logger = createLogger({
|
|
11
|
-
prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
|
|
12
|
-
});
|
|
13
10
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
14
11
|
super(engine, scene, api, config, FcrRoomType.JoinBeforeHostWaitingRoom, chatConnection, sharedCache, chatRoomControl);
|
|
12
|
+
//@internal
|
|
13
|
+
_defineProperty(this, "logger", createLogger({
|
|
14
|
+
prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
|
|
15
|
+
}));
|
|
15
16
|
this._addLogObserver();
|
|
16
17
|
}
|
|
17
18
|
addObserver(observer) {
|