fcr-core 3.10.5 → 3.10.6
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 +108 -102
- package/lib/imports.js +0 -1
- package/lib/index.d.ts +1 -1
- package/lib/media-control/desktop.js +13 -22
- package/lib/media-control/mobile.js +13 -22
- package/lib/monitor-control/index.js +7 -17
- package/lib/peer-session/index.js +121 -120
- package/lib/plugins/chat/chatroom.js +96 -119
- package/lib/plugins/chat/connector.js +48 -69
- package/lib/remote-control/index.js +216 -194
- package/lib/room-control/ability-control/index.js +10 -20
- package/lib/room-control/application-control/index.js +75 -82
- package/lib/room-control/group-control/index.js +30 -31
- package/lib/room-control/helpers/board-init-info-helper.js +10 -16
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +51 -70
- package/lib/room-control/infinity-room-control/index.js +19 -27
- package/lib/room-control/interpreter-control/index.js +65 -77
- package/lib/room-control/interpreter-control/room.js +4 -6
- package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
- package/lib/room-control/mainroom-control/index.js +25 -37
- package/lib/room-control/privilege-control/helper.js +13 -28
- package/lib/room-control/privilege-control/index.js +28 -36
- package/lib/room-control/room-connector-control/index.js +47 -52
- package/lib/room-control/room-control-factory.js +12 -10
- package/lib/room-control/room-session/index.js +74 -77
- package/lib/room-control/shared-cache.js +56 -63
- package/lib/room-control/sharing-control/index.js +57 -65
- package/lib/room-control/stream-control/index.js +238 -203
- package/lib/room-control/stream-control/type.d.ts +11 -1
- package/lib/room-control/stt-control/de-compress-gzip.js +0 -10
- package/lib/room-control/stt-control/index.js +86 -93
- package/lib/room-control/user-control/index.js +155 -162
- package/lib/room-control/waitingroom-control/index.js +9 -18
- package/lib/room-control/whiteboard-control/utils.js +2 -4
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
- package/lib/room-control/whiteboard-control-v1/board-window.js +103 -120
- package/lib/room-control/whiteboard-control-v1/factory.js +4 -7
- package/lib/room-control/whiteboard-control-v1/index.js +67 -80
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +2 -4
- package/lib/room-control/whiteboard-control-v1/utils.js +14 -17
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +10 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -17
- package/lib/room-control/whiteboard-control-v2/base/index.js +53 -61
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +30 -39
- package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -27
- package/lib/room-control/widget-control/index.js +33 -43
- package/lib/room-router/index.js +58 -66
- package/lib/service/api.js +548 -446
- package/lib/struct.js +2 -5
- package/lib/type.d.ts +1 -1
- package/lib/utilities/abortable-retry.js +0 -3
- package/lib/utilities/collection.js +11 -15
- package/lib/utilities/error-helpers.js +27 -34
- package/lib/utilities/error.js +3 -4
- package/lib/utilities/join-helper.js +31 -37
- package/lib/utilities/logger.js +5 -8
- package/lib/utilities/parameters.js +10 -21
- package/lib/utilities/retry-helpers.js +0 -1
- package/lib/utilities/stream.js +11 -16
- package/lib/utilities/user.js +3 -4
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.js +5 -10
- package/lib-es/engine/index.js +108 -102
- package/lib-es/media-control/desktop.js +13 -22
- package/lib-es/media-control/mobile.js +13 -22
- package/lib-es/monitor-control/index.js +7 -16
- package/lib-es/peer-session/index.js +121 -120
- package/lib-es/plugins/chat/chatroom.js +95 -118
- package/lib-es/plugins/chat/connector.js +47 -67
- package/lib-es/remote-control/index.js +216 -194
- package/lib-es/room-control/ability-control/index.js +10 -19
- package/lib-es/room-control/application-control/index.js +75 -81
- package/lib-es/room-control/group-control/index.js +30 -31
- package/lib-es/room-control/helpers/board-init-info-helper.js +10 -15
- package/lib-es/room-control/helpers/validation-helper.js +1 -1
- package/lib-es/room-control/index.js +51 -69
- package/lib-es/room-control/infinity-room-control/index.js +19 -26
- package/lib-es/room-control/interpreter-control/index.js +65 -77
- package/lib-es/room-control/interpreter-control/room.js +4 -5
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -5
- package/lib-es/room-control/mainroom-control/index.js +25 -37
- package/lib-es/room-control/privilege-control/helper.js +13 -27
- package/lib-es/room-control/privilege-control/index.js +28 -36
- package/lib-es/room-control/room-connector-control/index.js +47 -52
- package/lib-es/room-control/room-control-factory.js +12 -10
- package/lib-es/room-control/room-session/index.js +74 -77
- package/lib-es/room-control/shared-cache.js +56 -62
- package/lib-es/room-control/sharing-control/index.js +57 -64
- package/lib-es/room-control/stream-control/index.js +240 -205
- package/lib-es/room-control/stt-control/de-compress-gzip.js +0 -10
- package/lib-es/room-control/stt-control/index.js +86 -93
- package/lib-es/room-control/user-control/index.js +155 -162
- package/lib-es/room-control/waitingroom-control/index.js +9 -18
- package/lib-es/room-control/whiteboard-control/utils.js +2 -4
- package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +103 -120
- package/lib-es/room-control/whiteboard-control-v1/factory.js +4 -6
- package/lib-es/room-control/whiteboard-control-v1/index.js +67 -80
- package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +2 -3
- package/lib-es/room-control/whiteboard-control-v1/utils.js +14 -17
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +10 -13
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -16
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +53 -60
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +30 -39
- package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -26
- package/lib-es/room-control/widget-control/index.js +33 -42
- package/lib-es/room-router/index.js +58 -66
- package/lib-es/service/api.js +548 -445
- package/lib-es/struct.js +2 -4
- package/lib-es/utilities/abortable-retry.js +0 -3
- package/lib-es/utilities/collection.js +11 -14
- package/lib-es/utilities/error-helpers.js +26 -33
- package/lib-es/utilities/error.js +3 -4
- package/lib-es/utilities/join-helper.js +29 -36
- package/lib-es/utilities/logger.js +5 -7
- package/lib-es/utilities/parameters.js +10 -21
- package/lib-es/utilities/retry-helpers.js +0 -1
- package/lib-es/utilities/stream.js +11 -15
- package/lib-es/utilities/user.js +3 -4
- package/lib-es/utilities/validate-params.js +1 -1
- package/lib-es/utilities/video-encoder-config.js +5 -10
- package/package.json +4 -4
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import "core-js/modules/es.symbol.description.js";
|
|
2
|
-
import "core-js/modules/es.error.cause.js";
|
|
3
1
|
import "core-js/modules/es.array.push.js";
|
|
4
2
|
import "core-js/modules/esnext.function.metadata.js";
|
|
5
|
-
import "core-js/modules/esnext.iterator.filter.js";
|
|
6
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
7
3
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
8
4
|
import "core-js/modules/esnext.map.emplace.js";
|
|
9
5
|
import "core-js/modules/esnext.map.every.js";
|
|
@@ -19,15 +15,9 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
19
15
|
import "core-js/modules/esnext.map.some.js";
|
|
20
16
|
import "core-js/modules/esnext.map.update.js";
|
|
21
17
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
22
|
-
|
|
23
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
24
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
25
|
-
var _FcrWhiteboardControlImpl;
|
|
26
|
-
let _initProto, _openDecs, _setBackgroundColorDecs, _setOperationPrivilegeDecs, _setBoardWritableDecs, _ref;
|
|
18
|
+
let _initProto, _openDecs, _setBackgroundColorDecs, _setOperationPrivilegeDecs, _setBoardWritableDecs;
|
|
27
19
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
28
20
|
import "core-js/modules/esnext.iterator.map.js";
|
|
29
|
-
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; }
|
|
30
|
-
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; }
|
|
31
21
|
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)]; } }; }
|
|
32
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
33
23
|
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); }
|
|
@@ -56,20 +46,22 @@ import { convertToFcrBoardToolShape, hexColorToWhiteboardColor, textColors } fro
|
|
|
56
46
|
/**
|
|
57
47
|
* @internal
|
|
58
48
|
*/
|
|
59
|
-
_ref = (_openDecs = [bound, trace(['params'])], _setBackgroundColorDecs = [bound, trace(['backgroundColor'])], _setOperationPrivilegeDecs = [bound, trace(['hasPrivilege'])], _setBoardWritableDecs = trace(['granted']), "logger");
|
|
60
49
|
export class FcrWhiteboardControlImpl {
|
|
50
|
+
static {
|
|
51
|
+
[_initProto] = _applyDecs(this, [[[bound, trace], 2, "active"], [[bound, trace], 2, "inactive"], [_openDecs, 2, "open"], [[bound, trace], 2, "close"], [[bound, trace], 2, "release"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[bound, trace], 2, "getActivity"], [[bound, trace], 2, "getOwnerId"], [[bound, trace], 2, "getBackgroundColor"], [[bound, trace], 2, "getConnectionState"], [[bound, trace], 2, "getMainWindow"], [[bound, trace], 2, "addObserver"], [[bound, trace], 2, "removeObserver"], [[bound, trace], 2, "getBoardActiveInfo"], [[bound, trace], 2, "hasOperationPrivilege"], [_setOperationPrivilegeDecs, 2, "setOperationPrivilege"], [_setBoardWritableDecs, 2, "_setBoardWritable"], [bound, 2, "_getToken"], [bound, 2, "_handleRoomStateUpdated"], [bound, 2, "_updateConnnectionState"], [bound, 2, "_handleConnectionStateUpdated"], [trace, 2, "_connect"], [trace, 2, "_clean"]], []).e;
|
|
52
|
+
}
|
|
53
|
+
[(_openDecs = [bound, trace(['params'])], _setBackgroundColorDecs = [bound, trace(['backgroundColor'])], _setOperationPrivilegeDecs = [bound, trace(['hasPrivilege'])], _setBoardWritableDecs = trace(['granted']), "logger")] = (_initProto(this), createLogger({
|
|
54
|
+
prefix: 'FcrWhiteboardControlImpl'
|
|
55
|
+
}));
|
|
56
|
+
_client = {};
|
|
57
|
+
_joined = false;
|
|
58
|
+
_connectState = FcrConnectionState.DISCONNECTED;
|
|
59
|
+
_observable = new AgoraObservable();
|
|
60
|
+
_options = {
|
|
61
|
+
debug: false
|
|
62
|
+
};
|
|
63
|
+
_hasOperationPrivilege = false;
|
|
61
64
|
constructor(_scene, _api, _sharedCache, hasOperationPrivilege) {
|
|
62
|
-
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
63
|
-
prefix: 'FcrWhiteboardControlImpl'
|
|
64
|
-
})));
|
|
65
|
-
_defineProperty(this, "_client", {});
|
|
66
|
-
_defineProperty(this, "_joined", false);
|
|
67
|
-
_defineProperty(this, "_connectState", FcrConnectionState.DISCONNECTED);
|
|
68
|
-
_defineProperty(this, "_observable", new AgoraObservable());
|
|
69
|
-
_defineProperty(this, "_options", {
|
|
70
|
-
debug: false
|
|
71
|
-
});
|
|
72
|
-
_defineProperty(this, "_hasOperationPrivilege", false);
|
|
73
65
|
this._scene = _scene;
|
|
74
66
|
this._api = _api;
|
|
75
67
|
this._sharedCache = _sharedCache;
|
|
@@ -78,26 +70,26 @@ export class FcrWhiteboardControlImpl {
|
|
|
78
70
|
this._addLogObserver();
|
|
79
71
|
_scene.addObserver({
|
|
80
72
|
onScenePropertiesUpdated: (_, event) => {
|
|
81
|
-
var _event$cause;
|
|
82
73
|
const operatorUser = convertRteUserToFcrUser(event.operatorUser, this._roomCache);
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
74
|
+
if (event.cause?.cmd === 10) {
|
|
75
|
+
const {
|
|
76
|
+
state,
|
|
77
|
+
extra: {
|
|
78
|
+
backgroundColor: bgColor
|
|
79
|
+
}
|
|
80
|
+
} = _scene.getScenePropertiesByKeyPath('widgets.netlessBoard') ?? {
|
|
81
|
+
state: 0,
|
|
82
|
+
extra: {
|
|
83
|
+
backgroundColor: '#fff'
|
|
84
|
+
}
|
|
85
|
+
};
|
|
93
86
|
if (state === 1) {
|
|
94
87
|
this._observable.notifyObservers('onActive', _scene.getScenePropertiesByKeyPath('widgets.netlessBoard').ownerUserUuid, operatorUser);
|
|
95
88
|
}
|
|
96
89
|
if (state === 0) {
|
|
97
|
-
|
|
98
|
-
this._observable.notifyObservers('onInactive', (_event$cause$data$wid = event.cause.data.widgetCause) === null || _event$cause$data$wid === void 0 || (_event$cause$data$wid = _event$cause$data$wid.data) === null || _event$cause$data$wid === void 0 ? void 0 : _event$cause$data$wid.reason, operatorUser);
|
|
90
|
+
this._observable.notifyObservers('onInactive', event.cause.data.widgetCause?.data?.reason, operatorUser);
|
|
99
91
|
}
|
|
100
|
-
if (
|
|
92
|
+
if (event.cause.data.widgetCause?.cmd === 100101) {
|
|
101
93
|
this._observable.notifyObservers('onBackgroundColorUpdated', bgColor, operatorUser);
|
|
102
94
|
}
|
|
103
95
|
}
|
|
@@ -114,8 +106,7 @@ export class FcrWhiteboardControlImpl {
|
|
|
114
106
|
async inactive() {
|
|
115
107
|
return handleRequestError(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, FcrSharePermissionState.OFF), ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'inactive failed');
|
|
116
108
|
}
|
|
117
|
-
async open() {
|
|
118
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
109
|
+
async open(params = {}) {
|
|
119
110
|
this._whiteboardPrivateParameters = params;
|
|
120
111
|
// 白板权限禁用状态下,主持人和联席主持人仍然可以发起共享,所以,不能根据是否禁用状态直接拒绝
|
|
121
112
|
|
|
@@ -166,12 +157,13 @@ export class FcrWhiteboardControlImpl {
|
|
|
166
157
|
return FcrReturnCode.SUCCESS;
|
|
167
158
|
}
|
|
168
159
|
getBoardActiveInfo() {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
160
|
+
const {
|
|
161
|
+
state,
|
|
162
|
+
ownerUserUuid: ownerUserId
|
|
163
|
+
} = this._scene.getScenePropertiesByKeyPath('widgets.netlessBoard') || {
|
|
164
|
+
isActive: false,
|
|
165
|
+
ownerUserUuid: null
|
|
166
|
+
};
|
|
175
167
|
if (state === FcrBoardPropertiesState.ACTIVE) {
|
|
176
168
|
return {
|
|
177
169
|
isActive: true,
|
|
@@ -240,25 +232,23 @@ export class FcrWhiteboardControlImpl {
|
|
|
240
232
|
}), ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get whiteboard token failed');
|
|
241
233
|
}
|
|
242
234
|
_handleRoomStateUpdated(state) {
|
|
243
|
-
const
|
|
235
|
+
const {
|
|
236
|
+
memberState
|
|
237
|
+
} = state;
|
|
244
238
|
if (memberState) {
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
239
|
+
const {
|
|
240
|
+
strokeColor,
|
|
241
|
+
strokeWidth,
|
|
242
|
+
currentApplianceName,
|
|
243
|
+
textSize,
|
|
244
|
+
shapeType
|
|
245
|
+
} = memberState;
|
|
250
246
|
const localState = {};
|
|
251
|
-
const
|
|
252
|
-
_convertToFcrBoardToo2 = _slicedToArray(_convertToFcrBoardToo, 2),
|
|
253
|
-
tool = _convertToFcrBoardToo2[0],
|
|
254
|
-
shape = _convertToFcrBoardToo2[1];
|
|
247
|
+
const [tool, shape] = convertToFcrBoardToolShape(currentApplianceName, shapeType);
|
|
255
248
|
localState.tool = tool;
|
|
256
249
|
localState.shape = shape;
|
|
257
250
|
if (typeof strokeColor !== 'undefined') {
|
|
258
|
-
const
|
|
259
|
-
r = _strokeColor[0],
|
|
260
|
-
g = _strokeColor[1],
|
|
261
|
-
b = _strokeColor[2];
|
|
251
|
+
const [r, g, b] = strokeColor;
|
|
262
252
|
localState.strokeColor = {
|
|
263
253
|
r,
|
|
264
254
|
g,
|
|
@@ -314,21 +304,22 @@ export class FcrWhiteboardControlImpl {
|
|
|
314
304
|
}
|
|
315
305
|
async _connect() {
|
|
316
306
|
try {
|
|
317
|
-
var _this$_scene$getUser, _this$_whiteboardPriv, _this$_whiteboardPriv2, _this$_whiteboardPriv3, _this$_whiteboardPriv4;
|
|
318
307
|
this._updateConnnectionState(FcrConnectionState.CONNECTING);
|
|
319
308
|
const roomId = this._scene.sceneId;
|
|
320
309
|
const userId = this._scene.localUser.getLocalUserId();
|
|
321
|
-
const cursorName =
|
|
322
|
-
const syncMode =
|
|
323
|
-
const
|
|
324
|
-
data
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
310
|
+
const cursorName = this._scene.getUser(userId)?.userName;
|
|
311
|
+
const syncMode = this._whiteboardPrivateParameters?.syncMode ?? false;
|
|
312
|
+
const {
|
|
313
|
+
data
|
|
314
|
+
} = await this._getToken(roomId, userId);
|
|
315
|
+
const {
|
|
316
|
+
boardAppId,
|
|
317
|
+
boardId,
|
|
318
|
+
boardRegion,
|
|
319
|
+
boardToken
|
|
320
|
+
} = data || {};
|
|
330
321
|
const plugins = this._createPlugins();
|
|
331
|
-
this._client = new WhiteWebSdk(
|
|
322
|
+
this._client = new WhiteWebSdk({
|
|
332
323
|
appIdentifier: boardAppId,
|
|
333
324
|
useMobXState: true,
|
|
334
325
|
pptParams: {
|
|
@@ -342,8 +333,9 @@ export class FcrWhiteboardControlImpl {
|
|
|
342
333
|
reportDebugLogMode: LoggerReportMode.AlwaysReport,
|
|
343
334
|
reportLevelMask: this._options.debug ? 'debug' : 'info',
|
|
344
335
|
printLevelMask: this._options.debug ? 'debug' : 'info'
|
|
345
|
-
}
|
|
346
|
-
|
|
336
|
+
},
|
|
337
|
+
...this._whiteboardPrivateParameters
|
|
338
|
+
});
|
|
347
339
|
const hasPermission = this._hasOperationPrivilege;
|
|
348
340
|
const joinParams = {
|
|
349
341
|
region: boardRegion,
|
|
@@ -365,7 +357,7 @@ export class FcrWhiteboardControlImpl {
|
|
|
365
357
|
cursorName,
|
|
366
358
|
disappearCursor: true
|
|
367
359
|
},
|
|
368
|
-
floatBar:
|
|
360
|
+
floatBar: this._whiteboardPrivateParameters?.floatBar ?? {
|
|
369
361
|
colors: textColors.map(color => hexColorToWhiteboardColor(color))
|
|
370
362
|
}
|
|
371
363
|
};
|
|
@@ -377,7 +369,7 @@ export class FcrWhiteboardControlImpl {
|
|
|
377
369
|
if (hasPermission) {
|
|
378
370
|
room.setViewMode(ViewMode.Broadcaster);
|
|
379
371
|
}
|
|
380
|
-
this.logger.info(
|
|
372
|
+
this.logger.info(`set whiteboard sync mode: ${syncMode}`);
|
|
381
373
|
room.syncMode = syncMode;
|
|
382
374
|
const mountOptions = {};
|
|
383
375
|
const privateParams = this._whiteboardPrivateParameters;
|
|
@@ -436,9 +428,4 @@ export class FcrWhiteboardControlImpl {
|
|
|
436
428
|
_addLogObserver() {
|
|
437
429
|
this.addObserver(generateLogObserver(this.logger, [['onActive', ['ownerId', 'operatorUser']], ['onInactive', ['reason', 'operatorUser']], ['onBackgroundColorUpdated', ['color', 'operatorUser']], ['onConnectionStateUpdated', ['state']]]));
|
|
438
430
|
}
|
|
439
|
-
}
|
|
440
|
-
_FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
441
|
-
var _applyDecs$e = _applyDecs(_FcrWhiteboardControlImpl, [[[bound, trace], 2, "active"], [[bound, trace], 2, "inactive"], [_openDecs, 2, "open"], [[bound, trace], 2, "close"], [[bound, trace], 2, "release"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[bound, trace], 2, "getActivity"], [[bound, trace], 2, "getOwnerId"], [[bound, trace], 2, "getBackgroundColor"], [[bound, trace], 2, "getConnectionState"], [[bound, trace], 2, "getMainWindow"], [[bound, trace], 2, "addObserver"], [[bound, trace], 2, "removeObserver"], [[bound, trace], 2, "getBoardActiveInfo"], [[bound, trace], 2, "hasOperationPrivilege"], [_setOperationPrivilegeDecs, 2, "setOperationPrivilege"], [_setBoardWritableDecs, 2, "_setBoardWritable"], [bound, 2, "_getToken"], [bound, 2, "_handleRoomStateUpdated"], [bound, 2, "_updateConnnectionState"], [bound, 2, "_handleConnectionStateUpdated"], [trace, 2, "_connect"], [trace, 2, "_clean"]], []).e;
|
|
442
|
-
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
443
|
-
_initProto = _applyDecs$e2[0];
|
|
444
|
-
_applyDecs$e;
|
|
431
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
export class BoardMountManager {
|
|
2
|
+
static isMounting = false;
|
|
3
3
|
static setIsMounting(isMounting) {
|
|
4
4
|
BoardMountManager.isMounting = isMounting;
|
|
5
5
|
}
|
|
6
|
-
}
|
|
7
|
-
_defineProperty(BoardMountManager, "isMounting", false);
|
|
6
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
|
2
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
3
|
-
import "core-js/modules/es.string.replace.js";
|
|
4
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
5
2
|
import { md5 } from 'js-md5';
|
|
6
3
|
import { ApplianceNames, FcrBoardShape, FcrBoardToolType, ShapeType } from './enum';
|
|
7
4
|
import { EStrokeType } from '@netless/appliance-plugin';
|
|
@@ -126,8 +123,8 @@ export const mergeCanvasImage = async scenes => {
|
|
|
126
123
|
canvasArray.push(canvas);
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
|
-
bigCanvas.setAttribute('width',
|
|
130
|
-
bigCanvas.setAttribute('height',
|
|
126
|
+
bigCanvas.setAttribute('width', `${width}`);
|
|
127
|
+
bigCanvas.setAttribute('height', `${height * canvasArray.length}`);
|
|
131
128
|
canvasArray.forEach((canvas, index) => {
|
|
132
129
|
ctx && ctx.drawImage(canvas, 0, index * height, width, height);
|
|
133
130
|
});
|
|
@@ -222,22 +219,22 @@ export const convertToFcrBoardToolShape = (tool, shape) => {
|
|
|
222
219
|
case ApplianceNames.hand:
|
|
223
220
|
return [FcrBoardToolType.HAND];
|
|
224
221
|
}
|
|
225
|
-
switch (
|
|
226
|
-
case
|
|
222
|
+
switch (`${tool || ''}${shape || ''}`) {
|
|
223
|
+
case `${ApplianceNames.rectangle}`:
|
|
227
224
|
return [, FcrBoardShape.Rectangle];
|
|
228
|
-
case
|
|
225
|
+
case `${ApplianceNames.ellipse}`:
|
|
229
226
|
return [, FcrBoardShape.Ellipse];
|
|
230
|
-
case
|
|
227
|
+
case `${ApplianceNames.straight}`:
|
|
231
228
|
return [, FcrBoardShape.Straight];
|
|
232
|
-
case
|
|
229
|
+
case `${ApplianceNames.arrow}`:
|
|
233
230
|
return [, FcrBoardShape.Arrow];
|
|
234
|
-
case
|
|
231
|
+
case `${ApplianceNames.pencil}`:
|
|
235
232
|
return [, FcrBoardShape.Curve];
|
|
236
|
-
case
|
|
233
|
+
case `${ApplianceNames.shape}${ShapeType.Triangle}`:
|
|
237
234
|
return [, FcrBoardShape.Triangle];
|
|
238
|
-
case
|
|
235
|
+
case `${ApplianceNames.shape, ShapeType.Pentagram}`:
|
|
239
236
|
return [, FcrBoardShape.Pentagram];
|
|
240
|
-
case
|
|
237
|
+
case `${ApplianceNames.shape}${ShapeType.Rhombus}`:
|
|
241
238
|
return [, FcrBoardShape.Rhombus];
|
|
242
239
|
}
|
|
243
240
|
return [];
|
|
@@ -262,9 +259,9 @@ export const src2DataURL = src => {
|
|
|
262
259
|
const ctx = canvas.getContext('2d');
|
|
263
260
|
const image = new Image();
|
|
264
261
|
image.onload = () => {
|
|
265
|
-
canvas.setAttribute('width',
|
|
266
|
-
canvas.setAttribute('height',
|
|
267
|
-
ctx
|
|
262
|
+
canvas.setAttribute('width', `${image.width}`);
|
|
263
|
+
canvas.setAttribute('height', `${image.height}`);
|
|
264
|
+
ctx?.drawImage(image, 0, 0);
|
|
268
265
|
resolve(canvas.toDataURL('image/jpeg', 0.8));
|
|
269
266
|
};
|
|
270
267
|
image.onerror = () => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import { FcrErrorCode, FcrErrorModuleCode, generateFcrCoreClientError, handleRequestError } from '../../../utilities/error';
|
|
3
2
|
import { createLogger } from '../../../utilities/logger';
|
|
4
3
|
import { FcrBaseWhiteboardControlImpl } from '../base';
|
|
@@ -11,22 +10,20 @@ const addBoardConnectingObserver = (board, sceneConfig) => {
|
|
|
11
10
|
onConnectionStateUpdated: state => {
|
|
12
11
|
if (state === AgoraRteConnectionState.CONNECTED) {
|
|
13
12
|
if (sceneConfig.isAndroidByOwner()) {
|
|
14
|
-
|
|
15
|
-
(_board$getMainWindow = board.getMainWindow()) === null || _board$getMainWindow === void 0 || _board$getMainWindow.setAutoCancelDraw(true);
|
|
13
|
+
board.getMainWindow()?.setAutoCancelDraw(true);
|
|
16
14
|
} else {
|
|
17
|
-
|
|
18
|
-
(_board$getMainWindow2 = board.getMainWindow()) === null || _board$getMainWindow2 === void 0 || _board$getMainWindow2.setAutoCancelDraw(false);
|
|
15
|
+
board.getMainWindow()?.setAutoCancelDraw(false);
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
21
|
export class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
22
|
+
logger = createLogger({
|
|
23
|
+
prefix: 'FcrAnnotationControlImpl'
|
|
24
|
+
});
|
|
25
25
|
constructor(rtmClient, config, forgeInitConfigFetcher, _sceneConfig, _api) {
|
|
26
26
|
super(rtmClient, config, forgeInitConfigFetcher, _api);
|
|
27
|
-
_defineProperty(this, "logger", createLogger({
|
|
28
|
-
prefix: 'FcrAnnotationControlImpl'
|
|
29
|
-
}));
|
|
30
27
|
this.rtmClient = rtmClient;
|
|
31
28
|
this.config = config;
|
|
32
29
|
this._sceneConfig = _sceneConfig;
|
|
@@ -40,7 +37,7 @@ export class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
|
40
37
|
} catch (e) {
|
|
41
38
|
const error = e;
|
|
42
39
|
const errorMessage = error.message;
|
|
43
|
-
throw generateFcrCoreClientError(FcrErrorModuleCode.FCR_ROOM_WHITEBOARD, FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED,
|
|
40
|
+
throw generateFcrCoreClientError(FcrErrorModuleCode.FCR_ROOM_WHITEBOARD, FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED, `sync screen share owner annotation open done failed: ${errorMessage}`, errorMessage);
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
async syncWhiteboardWriteCount(isWritable) {
|
|
@@ -48,7 +45,7 @@ export class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
|
48
45
|
roomId: this.config.roomId,
|
|
49
46
|
userId: this.config.userId,
|
|
50
47
|
state: isWritable ? 1 : 0
|
|
51
|
-
}), ErrorModuleCode.FCR_ROOM_WHITEBOARD,
|
|
48
|
+
}), ErrorModuleCode.FCR_ROOM_WHITEBOARD, `set whiteboard write permission to ${isWritable} failed`);
|
|
52
49
|
return 0;
|
|
53
50
|
}
|
|
54
51
|
async open() {
|
|
@@ -74,11 +71,11 @@ export class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
export class FcrStandaloneAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
74
|
+
logger = createLogger({
|
|
75
|
+
prefix: 'FcrStandaloneAnnotationControlImpl'
|
|
76
|
+
});
|
|
77
77
|
constructor(rtmClient, config, forgeInitConfigFetcher, _sceneConfig) {
|
|
78
78
|
super(rtmClient, config, forgeInitConfigFetcher);
|
|
79
|
-
_defineProperty(this, "logger", createLogger({
|
|
80
|
-
prefix: 'FcrStandaloneAnnotationControlImpl'
|
|
81
|
-
}));
|
|
82
79
|
this.rtmClient = rtmClient;
|
|
83
80
|
this.config = config;
|
|
84
81
|
this._sceneConfig = _sceneConfig;
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
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; }
|
|
3
|
-
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; }
|
|
4
|
-
import "core-js/modules/es.array.push.js";
|
|
5
1
|
import "core-js/modules/es.json.stringify.js";
|
|
6
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
7
|
-
import "core-js/modules/esnext.iterator.filter.js";
|
|
8
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
9
2
|
import { FcrAnnotationControlImpl, FcrStandaloneAnnotationControlImpl } from './control';
|
|
10
3
|
import { createLogger } from '../../../utilities/logger';
|
|
11
4
|
import { generateFcrCoreClientError, handleRequestError } from '../../../utilities/error';
|
|
12
5
|
import { getAnnotationBoardOptions } from '../../../utilities/shared-storage';
|
|
13
6
|
import { DetailErrorCode, ErrorModuleCode } from '../../../imports';
|
|
14
7
|
export class FcrAnnotationControlFactoryImpl {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
8
|
+
logger = createLogger({
|
|
9
|
+
prefix: 'FcrAnnotationControlFactory'
|
|
10
|
+
});
|
|
20
11
|
createForSubProcess(rtmClient, config, annotationSceneConfig) {
|
|
21
|
-
this.logger.info(
|
|
12
|
+
this.logger.info(`create for sub process with config: ${JSON.stringify(config)}`);
|
|
22
13
|
return new FcrStandaloneAnnotationControlImpl(rtmClient, config, () => {
|
|
23
14
|
const forgeInitConfig = getAnnotationBoardOptions();
|
|
24
15
|
if (!forgeInitConfig) {
|
|
25
|
-
throw generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM_WHITEBOARD, DetailErrorCode.UNDEFINED_ERROR,
|
|
16
|
+
throw generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM_WHITEBOARD, DetailErrorCode.UNDEFINED_ERROR, `whiteboard init config is not exist`);
|
|
26
17
|
}
|
|
27
18
|
return Promise.resolve(forgeInitConfig);
|
|
28
19
|
}, annotationSceneConfig);
|
|
@@ -41,9 +32,10 @@ export class FcrAnnotationControlFactoryImpl {
|
|
|
41
32
|
};
|
|
42
33
|
return async () => {
|
|
43
34
|
const response = await getObjectInitConfig(roomId, userId);
|
|
44
|
-
return
|
|
35
|
+
return {
|
|
36
|
+
...response.data,
|
|
45
37
|
boardPerformance
|
|
46
|
-
}
|
|
38
|
+
};
|
|
47
39
|
};
|
|
48
40
|
}
|
|
49
41
|
}
|