fcr-core 3.10.1 → 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,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
|
3
5
|
require("core-js/modules/esnext.function.metadata.js");
|
|
6
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
4
7
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
5
8
|
require("core-js/modules/esnext.map.emplace.js");
|
|
6
9
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -16,6 +19,7 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
16
19
|
require("core-js/modules/esnext.map.some.js");
|
|
17
20
|
require("core-js/modules/esnext.map.update.js");
|
|
18
21
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
22
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
19
23
|
Object.defineProperty(exports, "__esModule", {
|
|
20
24
|
value: true
|
|
21
25
|
});
|
|
@@ -25,6 +29,9 @@ require("core-js/modules/es.array.push.js");
|
|
|
25
29
|
require("core-js/modules/es.json.stringify.js");
|
|
26
30
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
27
31
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
32
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
33
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
34
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
28
35
|
var _imports = require("../imports");
|
|
29
36
|
var _type = require("../type");
|
|
30
37
|
var _type2 = require("./type");
|
|
@@ -45,7 +52,8 @@ var _helpers = require("./helpers");
|
|
|
45
52
|
var _sttControl = require("./stt-control");
|
|
46
53
|
var _widgetControl = require("./widget-control");
|
|
47
54
|
var _applicationControl = require("./application-control");
|
|
48
|
-
|
|
55
|
+
var _FcrBaseRoomControlImpl;
|
|
56
|
+
let _initProto, _joinDecs, _updateRoomPropertiesDecs, _updateIncrementRoomPropertiesDecs, _deleteRoomPropertiesDecs, _startCloudRecordingDecs, _startLiveStreamingDecs, _updateLiveStreamingLayoutDecs, _sendRoomMessageDecs, _ref; // Core SDK imports
|
|
49
57
|
// Service and API imports
|
|
50
58
|
// Type definitions
|
|
51
59
|
// Room control types and interfaces
|
|
@@ -53,6 +61,8 @@ let _initProto, _joinDecs, _updateRoomPropertiesDecs, _updateIncrementRoomProper
|
|
|
53
61
|
// Error handling and utilities
|
|
54
62
|
// Core state
|
|
55
63
|
// Helpers and utilities
|
|
64
|
+
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; }
|
|
65
|
+
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; }
|
|
56
66
|
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)]; } }; }
|
|
57
67
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
58
68
|
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); }
|
|
@@ -66,19 +76,17 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
66
76
|
*
|
|
67
77
|
* @internal
|
|
68
78
|
*/
|
|
79
|
+
_ref = (_joinDecs = (0, _imports.trace)(['options']), _updateRoomPropertiesDecs = (0, _imports.trace)(['properties', 'cause']), _updateIncrementRoomPropertiesDecs = (0, _imports.trace)(['increments', 'cause']), _deleteRoomPropertiesDecs = (0, _imports.trace)(['properties', 'cause']), _startCloudRecordingDecs = (0, _imports.trace)(['config']), _startLiveStreamingDecs = (0, _imports.trace)(['data']), _updateLiveStreamingLayoutDecs = (0, _imports.trace)(['layoutType']), _sendRoomMessageDecs = (0, _imports.trace)(['payload', 'guaranteedDelivery']), "logger");
|
|
69
80
|
class FcrBaseRoomControlImpl {
|
|
70
|
-
static {
|
|
71
|
-
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_imports.trace, 2, "getLocalExDataSyncTypeList"], [_joinDecs, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "release"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_updateRoomPropertiesDecs, 2, "updateRoomProperties"], [_updateIncrementRoomPropertiesDecs, 2, "updateIncrementRoomProperties"], [_deleteRoomPropertiesDecs, 2, "deleteRoomProperties"], [_startCloudRecordingDecs, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_startLiveStreamingDecs, 2, "startLiveStreaming"], [_updateLiveStreamingLayoutDecs, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_sendRoomMessageDecs, 2, "sendRoomMessage"]], []).e;
|
|
72
|
-
}
|
|
73
|
-
//@internal
|
|
74
|
-
[(_joinDecs = (0, _imports.trace)(['options']), _updateRoomPropertiesDecs = (0, _imports.trace)(['properties', 'cause']), _updateIncrementRoomPropertiesDecs = (0, _imports.trace)(['increments', 'cause']), _deleteRoomPropertiesDecs = (0, _imports.trace)(['properties', 'cause']), _startCloudRecordingDecs = (0, _imports.trace)(['config']), _startLiveStreamingDecs = (0, _imports.trace)(['data']), _updateLiveStreamingLayoutDecs = (0, _imports.trace)(['layoutType']), _sendRoomMessageDecs = (0, _imports.trace)(['payload', 'guaranteedDelivery']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
75
|
-
prefix: 'FcrBaseRoomControlImpl'
|
|
76
|
-
}));
|
|
77
|
-
_observable = new _imports.AgoraObservable();
|
|
78
|
-
_joinRoomSuccess = false;
|
|
79
|
-
_joining = false;
|
|
80
|
-
_joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
81
81
|
constructor(_engine, _scene, _api, _config, _roomType, _chatConnection, _sharedCache, _chatRoomControl) {
|
|
82
|
+
//@internal
|
|
83
|
+
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
84
|
+
prefix: 'FcrBaseRoomControlImpl'
|
|
85
|
+
})));
|
|
86
|
+
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
87
|
+
(0, _defineProperty2.default)(this, "_joinRoomSuccess", false);
|
|
88
|
+
(0, _defineProperty2.default)(this, "_joining", false);
|
|
89
|
+
(0, _defineProperty2.default)(this, "_joinState", _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED);
|
|
82
90
|
this._engine = _engine;
|
|
83
91
|
this._scene = _scene;
|
|
84
92
|
this._api = _api;
|
|
@@ -88,9 +96,8 @@ class FcrBaseRoomControlImpl {
|
|
|
88
96
|
this._sharedCache = _sharedCache;
|
|
89
97
|
this._chatRoomControl = _chatRoomControl;
|
|
90
98
|
// 初始化 FcrJoinHelper
|
|
91
|
-
const
|
|
92
|
-
userId
|
|
93
|
-
} = this._engine.getConfig();
|
|
99
|
+
const _this$_engine$getConf = this._engine.getConfig(),
|
|
100
|
+
userId = _this$_engine$getConf.userId;
|
|
94
101
|
this._joinHelper = new _helpers.FcrJoinHelper(userId, this._scene, this._api);
|
|
95
102
|
this._engineObserver = {
|
|
96
103
|
onConnectionStateUpdated: state => {
|
|
@@ -102,8 +109,9 @@ class FcrBaseRoomControlImpl {
|
|
|
102
109
|
};
|
|
103
110
|
this._sceneObserver = {
|
|
104
111
|
onJoinSceneSuccess: (sceneId, localUser) => {
|
|
112
|
+
var _this$_chatRoomContro;
|
|
105
113
|
this._joinRoomSuccess = true;
|
|
106
|
-
this._chatRoomControl
|
|
114
|
+
(_this$_chatRoomContro = this._chatRoomControl) === null || _this$_chatRoomContro === void 0 || _this$_chatRoomContro.join();
|
|
107
115
|
this._userControl = new _userControl.FcrUserControlImpl(this._scene, this._api, this._sharedCache);
|
|
108
116
|
this._streamControl = new _streamControl.FcrStreamControlImpl(this._engine, this._scene, this._api, this._sharedCache);
|
|
109
117
|
this._roomSessionControl = new _roomSession.FcrRoomSessionControlImpl(this, this._api, localUser.getLocalUserId());
|
|
@@ -137,31 +145,33 @@ class FcrBaseRoomControlImpl {
|
|
|
137
145
|
this._observable.notifyObservers('onRoomMessageReceived', sceneId, message);
|
|
138
146
|
const payload = message.payload;
|
|
139
147
|
if (message.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_ROUTE_SWITCH) {
|
|
140
|
-
|
|
148
|
+
var _this$_userControl;
|
|
149
|
+
const localUserRole = (_this$_userControl = this._userControl) === null || _this$_userControl === void 0 ? void 0 : _this$_userControl.getLocalUser().userRole;
|
|
141
150
|
if (localUserRole && payload.targetRoles.includes(_type.FcrUserRoleToStringMap[localUserRole])) {
|
|
151
|
+
var _this$_userControl2;
|
|
142
152
|
this._observable.notifyObservers('onRoomRouteSwitched', {
|
|
143
153
|
targetRouting: {
|
|
144
154
|
roomId: payload.toRoom.roomUuid,
|
|
145
155
|
roomType: payload.toRoom.roomType,
|
|
146
156
|
isJoined: false
|
|
147
157
|
},
|
|
148
|
-
operatorUser: this._userControl
|
|
158
|
+
operatorUser: (_this$_userControl2 = this._userControl) === null || _this$_userControl2 === void 0 ? void 0 : _this$_userControl2.getUser(message.senderId)
|
|
149
159
|
});
|
|
150
160
|
this.leave();
|
|
151
161
|
}
|
|
152
162
|
}
|
|
153
163
|
},
|
|
154
164
|
onScenePropertiesUpdated: async (sceneId, event) => {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
var _event$cause, _event$cause2, _event$cause3, _event$cause4;
|
|
166
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
|
|
167
|
+
const _ref2 = this._scene.getSceneProperties().record,
|
|
168
|
+
state = _ref2.state,
|
|
169
|
+
ready = _ref2.ready,
|
|
170
|
+
onhold = _ref2.onhold;
|
|
161
171
|
const recordState = this._formatRecordingState(state, ready, onhold);
|
|
162
172
|
this._observable.notifyObservers('onCloudRecordingStateUpdated', sceneId, recordState);
|
|
163
173
|
}
|
|
164
|
-
if (event.cause
|
|
174
|
+
if (((_event$cause2 = event.cause) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_STATE_UPDATE) {
|
|
165
175
|
const schedule = event.changedProperties.schedule;
|
|
166
176
|
if (schedule.state === _helpers.ROOM_STATE_VALUES.ENDED) {
|
|
167
177
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
@@ -169,7 +179,7 @@ class FcrBaseRoomControlImpl {
|
|
|
169
179
|
}
|
|
170
180
|
this._observable.notifyObservers('onRoomStateUpdated', sceneId, schedule.state);
|
|
171
181
|
}
|
|
172
|
-
if (event.cause
|
|
182
|
+
if (((_event$cause3 = event.cause) === null || _event$cause3 === void 0 ? void 0 : _event$cause3.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
173
183
|
const changedProperties = {};
|
|
174
184
|
for (const key in event.changedProperties) {
|
|
175
185
|
if (key.startsWith('flexProps')) {
|
|
@@ -178,17 +188,17 @@ class FcrBaseRoomControlImpl {
|
|
|
178
188
|
}
|
|
179
189
|
if (Object.keys(changedProperties).length > 0) {
|
|
180
190
|
const structure = (0, _collection.convertToStructure)(changedProperties);
|
|
181
|
-
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, {
|
|
182
|
-
...event,
|
|
191
|
+
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, _objectSpread(_objectSpread({}, event), {}, {
|
|
183
192
|
changedProperties: structure['flexProps']
|
|
184
|
-
});
|
|
193
|
+
}));
|
|
185
194
|
}
|
|
186
195
|
}
|
|
187
|
-
if (event.cause
|
|
196
|
+
if (((_event$cause4 = event.cause) === null || _event$cause4 === void 0 ? void 0 : _event$cause4.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.LIVE_STREAMING_UPDATE) {
|
|
197
|
+
var _event$cause5;
|
|
188
198
|
let liveStreamingState = _type.FcrLiveStreamingState.STOPPED;
|
|
189
199
|
let state = this._scene.getScenePropertiesByKeyPath('live.state');
|
|
190
200
|
let pageUrl = this._scene.getScenePropertiesByKeyPath('live.pageUrl');
|
|
191
|
-
const reason = event.cause
|
|
201
|
+
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;
|
|
192
202
|
if (state === _helpers.LIVE_STREAMING_STATE_VALUES.STARTED) {
|
|
193
203
|
liveStreamingState = _type.FcrLiveStreamingState.STARTED;
|
|
194
204
|
}
|
|
@@ -199,7 +209,8 @@ class FcrBaseRoomControlImpl {
|
|
|
199
209
|
}
|
|
200
210
|
},
|
|
201
211
|
onScenePropertiesDeleted: (sceneId, event) => {
|
|
202
|
-
|
|
212
|
+
var _event$cause6;
|
|
213
|
+
if (((_event$cause6 = event.cause) === null || _event$cause6 === void 0 ? void 0 : _event$cause6.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
203
214
|
this._observable.notifyObservers('onRoomPropertiesDeleted', sceneId, event);
|
|
204
215
|
}
|
|
205
216
|
},
|
|
@@ -222,7 +233,8 @@ class FcrBaseRoomControlImpl {
|
|
|
222
233
|
}
|
|
223
234
|
},
|
|
224
235
|
onUserPropertiesUpdated: (_, event) => {
|
|
225
|
-
|
|
236
|
+
var _event$cause7;
|
|
237
|
+
if (((_event$cause7 = event.cause) === null || _event$cause7 === void 0 ? void 0 : _event$cause7.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.USER_KICK_OUT && event.modifiedUser.userId === this._scene.localUser.getLocalUserId()) {
|
|
226
238
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
227
239
|
this._cleanup();
|
|
228
240
|
}
|
|
@@ -333,6 +345,7 @@ class FcrBaseRoomControlImpl {
|
|
|
333
345
|
* @returns 房间信息,如果未加入房间则返回 undefined
|
|
334
346
|
*/
|
|
335
347
|
getRoomInfo() {
|
|
348
|
+
var _passwordInfo$payload;
|
|
336
349
|
const sceneInfo = this._scene.getSceneInfo();
|
|
337
350
|
// 检查是否已加入房间,避免在退出房间时访问已清除的 localUser
|
|
338
351
|
if (!sceneInfo || !this._joinRoomSuccess) {
|
|
@@ -341,18 +354,19 @@ class FcrBaseRoomControlImpl {
|
|
|
341
354
|
const passwordInfo = this._scene.getScenePropertiesByKeyPath('security.password');
|
|
342
355
|
let shareLink;
|
|
343
356
|
try {
|
|
357
|
+
var _userProperties$info;
|
|
344
358
|
const userProperties = this._scene.getUserPropertiesByUserId(this._scene.localUser.getLocalUserId());
|
|
345
|
-
shareLink = userProperties
|
|
359
|
+
shareLink = userProperties === null || userProperties === void 0 || (_userProperties$info = userProperties.info) === null || _userProperties$info === void 0 ? void 0 : _userProperties$info.shareLink;
|
|
346
360
|
} catch (e) {
|
|
347
361
|
// localUser 可能在退出房间过程中被清除,
|
|
348
|
-
this.logger.warn(
|
|
362
|
+
this.logger.warn("getroomInfo error :".concat(JSON.stringify(e)));
|
|
349
363
|
}
|
|
350
364
|
const label = this._scene.getScenePropertiesByKeyPath('label');
|
|
351
365
|
return {
|
|
352
366
|
roomId: sceneInfo.sceneId,
|
|
353
367
|
roomName: sceneInfo.sceneName,
|
|
354
368
|
roomType: this._roomType,
|
|
355
|
-
password: passwordInfo
|
|
369
|
+
password: passwordInfo === null || passwordInfo === void 0 || (_passwordInfo$payload = passwordInfo.payload) === null || _passwordInfo$payload === void 0 ? void 0 : _passwordInfo$payload.text,
|
|
356
370
|
inviteLink: shareLink,
|
|
357
371
|
label
|
|
358
372
|
};
|
|
@@ -365,11 +379,12 @@ class FcrBaseRoomControlImpl {
|
|
|
365
379
|
* @throws {FcrError} 如果未加入房间
|
|
366
380
|
*/
|
|
367
381
|
getRoomSchedule() {
|
|
382
|
+
var _schedule$duration, _schedule$startTime;
|
|
368
383
|
(0, _helpers.validateRoomJoined)(this._joinRoomSuccess, 'get schedule info');
|
|
369
384
|
const schedule = this._scene.getScenePropertiesByKeyPath('schedule');
|
|
370
385
|
return {
|
|
371
|
-
duration: schedule.duration
|
|
372
|
-
startTime: Math.floor((schedule.startTime
|
|
386
|
+
duration: (_schedule$duration = schedule.duration) !== null && _schedule$duration !== void 0 ? _schedule$duration : 0,
|
|
387
|
+
startTime: Math.floor(((_schedule$startTime = schedule.startTime) !== null && _schedule$startTime !== void 0 ? _schedule$startTime : 0) / 1000)
|
|
373
388
|
};
|
|
374
389
|
}
|
|
375
390
|
|
|
@@ -381,7 +396,7 @@ class FcrBaseRoomControlImpl {
|
|
|
381
396
|
getLocalExDataSyncTypeList() {
|
|
382
397
|
const localExDataSyncTypeList = this._scene.getLocalExDataSyncTypeList();
|
|
383
398
|
const result = [];
|
|
384
|
-
localExDataSyncTypeList
|
|
399
|
+
localExDataSyncTypeList === null || localExDataSyncTypeList === void 0 || localExDataSyncTypeList.forEach(syncTypeInfo => {
|
|
385
400
|
const convertedType = this._convertAgoraRteExDataSyncTypeInfoToFcrExDataSyncType(syncTypeInfo);
|
|
386
401
|
if (convertedType) {
|
|
387
402
|
result.push(convertedType);
|
|
@@ -445,7 +460,9 @@ class FcrBaseRoomControlImpl {
|
|
|
445
460
|
*/
|
|
446
461
|
async _executeJoinProcess(options) {
|
|
447
462
|
const handleJoinAborted = this._createJoinAbortedHandler();
|
|
448
|
-
const
|
|
463
|
+
const _await$to = await (0, _imports.to)(this._joinHelper.join(options, handleJoinAborted)),
|
|
464
|
+
_await$to2 = (0, _slicedToArray2.default)(_await$to, 1),
|
|
465
|
+
error = _await$to2[0];
|
|
449
466
|
if (error) {
|
|
450
467
|
throw error;
|
|
451
468
|
}
|
|
@@ -474,7 +491,7 @@ class FcrBaseRoomControlImpl {
|
|
|
474
491
|
async _handleRobotUserSetup(options) {
|
|
475
492
|
if (options.userRole === _type.FcrUserRole.ROBOT) {
|
|
476
493
|
const res = (0, _error.handleRequestError)(() => this._api.setCloudRecordingReady(this._scene.sceneId), _imports.ErrorModuleCode.FCR_ROOM, 'set cloud recording ready failed');
|
|
477
|
-
this.logger.info(
|
|
494
|
+
this.logger.info("set cloud recording ready, response: ".concat((0, _imports.jsonstring)(res)));
|
|
478
495
|
}
|
|
479
496
|
}
|
|
480
497
|
|
|
@@ -483,7 +500,7 @@ class FcrBaseRoomControlImpl {
|
|
|
483
500
|
* @private
|
|
484
501
|
*/
|
|
485
502
|
_handleJoinFailure(error) {
|
|
486
|
-
this.logger.error(
|
|
503
|
+
this.logger.error("failed to join room: ".concat(error.message));
|
|
487
504
|
this._observable.notifyObservers('onJoinRoomFailure', this._scene.sceneId, error);
|
|
488
505
|
}
|
|
489
506
|
|
|
@@ -614,11 +631,10 @@ class FcrBaseRoomControlImpl {
|
|
|
614
631
|
return _type.FcrReturnCode.SUCCESS;
|
|
615
632
|
}
|
|
616
633
|
getCloudRecordingState() {
|
|
617
|
-
const
|
|
618
|
-
state,
|
|
619
|
-
ready,
|
|
620
|
-
onhold
|
|
621
|
-
} = this._scene.getScenePropertiesByKeyPath('record');
|
|
634
|
+
const _ref3 = this._scene.getScenePropertiesByKeyPath('record'),
|
|
635
|
+
state = _ref3.state,
|
|
636
|
+
ready = _ref3.ready,
|
|
637
|
+
onhold = _ref3.onhold;
|
|
622
638
|
return this._formatRecordingState(state, ready, onhold);
|
|
623
639
|
}
|
|
624
640
|
async sendRoomMessage(payload, guaranteedDelivery) {
|
|
@@ -643,7 +659,8 @@ class FcrBaseRoomControlImpl {
|
|
|
643
659
|
this._engine.removeObserver(this._engineObserver);
|
|
644
660
|
this._sharedCache.getRoomCache(this._scene.sceneId).clear();
|
|
645
661
|
try {
|
|
646
|
-
|
|
662
|
+
var _this$_chatRoomContro2, _this$sharingControl, _this$sharingControl2;
|
|
663
|
+
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()]);
|
|
647
664
|
} finally {
|
|
648
665
|
this._joinRoomSuccess = false;
|
|
649
666
|
}
|
|
@@ -665,9 +682,8 @@ class FcrBaseRoomControlImpl {
|
|
|
665
682
|
}
|
|
666
683
|
async _liveStreamingAction(action, errorMessage) {
|
|
667
684
|
try {
|
|
668
|
-
const
|
|
669
|
-
code
|
|
670
|
-
} = await action();
|
|
685
|
+
const _await$action = await action(),
|
|
686
|
+
code = _await$action.code;
|
|
671
687
|
if (code !== _helpers.RESPONSE_CODES.SUCCESS) {
|
|
672
688
|
throw _helpers.liveStreamingErrorHelper.createNetworkError(errorMessage);
|
|
673
689
|
}
|
|
@@ -690,5 +706,8 @@ class FcrBaseRoomControlImpl {
|
|
|
690
706
|
* @internal
|
|
691
707
|
*/
|
|
692
708
|
exports.FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
|
|
709
|
+
_FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
|
|
710
|
+
var _applyDecs$e = (0, _slicedToArray2.default)(_applyDecs(_FcrBaseRoomControlImpl, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_imports.trace, 2, "getLocalExDataSyncTypeList"], [_joinDecs, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "release"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_updateRoomPropertiesDecs, 2, "updateRoomProperties"], [_updateIncrementRoomPropertiesDecs, 2, "updateIncrementRoomProperties"], [_deleteRoomPropertiesDecs, 2, "deleteRoomProperties"], [_startCloudRecordingDecs, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_startLiveStreamingDecs, 2, "startLiveStreaming"], [_updateLiveStreamingLayoutDecs, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_sendRoomMessageDecs, 2, "sendRoomMessage"]], []).e, 1);
|
|
711
|
+
_initProto = _applyDecs$e[0];
|
|
693
712
|
class FcrSubRoomControlImpl extends FcrBaseRoomControlImpl {}
|
|
694
713
|
exports.FcrSubRoomControlImpl = FcrSubRoomControlImpl;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
|
3
5
|
require("core-js/modules/es.array.push.js");
|
|
4
6
|
require("core-js/modules/esnext.function.metadata.js");
|
|
5
7
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
@@ -17,10 +19,14 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
17
19
|
require("core-js/modules/esnext.map.some.js");
|
|
18
20
|
require("core-js/modules/esnext.map.update.js");
|
|
19
21
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
22
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
20
24
|
Object.defineProperty(exports, "__esModule", {
|
|
21
25
|
value: true
|
|
22
26
|
});
|
|
23
27
|
exports.FcrInfinityRoomControlImpl = void 0;
|
|
28
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
29
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
24
30
|
var _ = require("..");
|
|
25
31
|
var _imports = require("../../imports");
|
|
26
32
|
var _type = require("../../type");
|
|
@@ -30,37 +36,33 @@ var _type2 = require("../type");
|
|
|
30
36
|
var _boardInitInfoHelper = require("../helpers/board-init-info-helper");
|
|
31
37
|
var _sharedStorage = require("../../utilities/shared-storage");
|
|
32
38
|
var _utils = require("../whiteboard-control/utils");
|
|
39
|
+
var _FcrInfinityRoomControlImpl;
|
|
33
40
|
let _initProto;
|
|
34
41
|
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)]; } }; }
|
|
35
42
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
36
43
|
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); }
|
|
37
44
|
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; }
|
|
38
45
|
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; }
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
Duration
|
|
42
|
-
} = _imports.AgoraScheduler;
|
|
46
|
+
const sharedScheduler = _imports.AgoraScheduler.shared,
|
|
47
|
+
Duration = _imports.AgoraScheduler.Duration;
|
|
43
48
|
/**
|
|
44
49
|
* @internal
|
|
45
50
|
*/
|
|
46
51
|
class FcrInfinityRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
47
|
-
static {
|
|
48
|
-
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "getAnnouncement"], [_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_imports.bound, 2, "_onLocalUserPermissionInfoDeleted"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
|
|
49
|
-
}
|
|
50
|
-
//@internal
|
|
51
|
-
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
52
|
-
prefix: 'FcrInfinityRoomControlImpl'
|
|
53
|
-
}));
|
|
54
|
-
_privilegeObserver = {
|
|
55
|
-
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
56
|
-
};
|
|
57
52
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl, monitorControl) {
|
|
58
53
|
super(engine, scene, api, config, _type2.FcrRoomType.Infinityroom, chatConnection, sharedCache, chatRoomControl);
|
|
54
|
+
//@internal
|
|
55
|
+
(0, _defineProperty2.default)(this, "logger", (_initProto(this), (0, _logger.createLogger)({
|
|
56
|
+
prefix: 'FcrInfinityRoomControlImpl'
|
|
57
|
+
})));
|
|
58
|
+
(0, _defineProperty2.default)(this, "_privilegeObserver", {
|
|
59
|
+
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
60
|
+
});
|
|
59
61
|
this._monitorControl = monitorControl;
|
|
60
62
|
this._interpreterControl = new _interpreterControl.FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
61
63
|
this._addLogObserver();
|
|
62
64
|
(0, _boardInitInfoHelper.addBoardInitInfoObserver)(this._scene, this._api, this.logger);
|
|
63
|
-
this.logger.info(
|
|
65
|
+
this.logger.info("initialized, room id: ".concat(this._scene.sceneId));
|
|
64
66
|
}
|
|
65
67
|
getAnnouncement() {
|
|
66
68
|
const announcement = this._scene.getScenePropertiesByKeyPath('info.announcement');
|
|
@@ -91,7 +93,8 @@ class FcrInfinityRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
91
93
|
privilegeControl.removeObserver(this._privilegeObserver);
|
|
92
94
|
return await super.leave();
|
|
93
95
|
} finally {
|
|
94
|
-
|
|
96
|
+
var _this$_logUploadTask;
|
|
97
|
+
(_this$_logUploadTask = this._logUploadTask) === null || _this$_logUploadTask === void 0 || _this$_logUploadTask.stop();
|
|
95
98
|
this._uploadLog();
|
|
96
99
|
}
|
|
97
100
|
}
|
|
@@ -113,12 +116,12 @@ class FcrInfinityRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
113
116
|
}
|
|
114
117
|
_onLocalUserPermissionInfoDeleted(roomId, event) {
|
|
115
118
|
if ((0, _utils.hasBoardWritePermission)(event.permissionInfo)) {
|
|
116
|
-
this.logger.info(
|
|
119
|
+
this.logger.info("remove board write permission");
|
|
117
120
|
|
|
118
121
|
// this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
|
|
119
122
|
}
|
|
120
123
|
if ((0, _utils.hasAnnotationWritePermission)(event.permissionInfo)) {
|
|
121
|
-
this.logger.info(
|
|
124
|
+
this.logger.info("remove annotation write permission");
|
|
122
125
|
|
|
123
126
|
// this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
|
|
124
127
|
}
|
|
@@ -127,4 +130,9 @@ class FcrInfinityRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
127
130
|
this.addObserver((0, _logger.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']]]));
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
|
-
exports.FcrInfinityRoomControlImpl = FcrInfinityRoomControlImpl;
|
|
133
|
+
exports.FcrInfinityRoomControlImpl = FcrInfinityRoomControlImpl;
|
|
134
|
+
_FcrInfinityRoomControlImpl = FcrInfinityRoomControlImpl;
|
|
135
|
+
var _applyDecs$e = _applyDecs(_FcrInfinityRoomControlImpl, [[_imports.trace, 2, "getAnnouncement"], [_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_imports.bound, 2, "_onLocalUserPermissionInfoDeleted"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
|
|
136
|
+
var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
|
|
137
|
+
_initProto = _applyDecs$e2[0];
|
|
138
|
+
_applyDecs$e;
|