fcr-core 3.11.0-rc.1 → 3.11.0-rc.2
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 +5 -3
- package/lib/imports.d.ts +1 -1
- package/lib/imports.js +6 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +14 -1
- package/lib/peer-session/index.js +23 -4
- package/lib/remote-control/index.js +7 -0
- package/lib/room-control/index.js +22 -11
- package/lib/room-control/infinity-room-control/index.js +3 -4
- package/lib/room-control/mainroom-control/index.js +2 -4
- package/lib/room-control/room-control-factory.js +5 -1
- package/lib/room-control/sharing-control/index.d.ts +3 -2
- package/lib/room-control/sharing-control/index.js +13 -2
- package/lib/room-control/type.d.ts +11 -6
- package/lib/room-control/type.js +6 -6
- package/lib/room-control/user-control/index.js +2 -2
- package/lib/room-control/whiteboard-control-v2/base/index.js +21 -13
- package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +6 -0
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +13 -3
- package/lib/room-control/whiteboard-control-v2/type.d.ts +5 -0
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -0
- package/lib/room-control/widget-control/index.d.ts +1 -0
- package/lib/room-control/widget-control/index.js +115 -0
- package/lib/room-control/widget-control/type.d.ts +33 -0
- package/lib/room-control/widget-control/type.js +5 -0
- package/lib/room-router/index.js +7 -1
- package/lib/service/api.d.ts +5 -0
- package/lib/service/api.js +16 -2
- package/lib/type.d.ts +1 -1
- package/lib/utilities/convertRoomType.d.ts +2 -0
- package/lib/utilities/convertRoomType.js +26 -0
- package/lib/utilities/error-helpers.d.ts +2 -1
- package/lib/utilities/error-helpers.js +1 -0
- package/lib/utilities/parameters.d.ts +1 -0
- package/lib/utilities/parameters.js +5 -1
- package/lib/utilities/shared-storage.d.ts +3 -0
- package/lib/utilities/shared-storage.js +19 -2
- package/lib-es/engine/index.js +5 -3
- package/lib-es/imports.js +1 -1
- package/lib-es/index.js +3 -1
- package/lib-es/peer-session/index.js +23 -4
- package/lib-es/remote-control/index.js +7 -0
- package/lib-es/room-control/index.js +22 -11
- package/lib-es/room-control/infinity-room-control/index.js +3 -4
- package/lib-es/room-control/mainroom-control/index.js +2 -4
- package/lib-es/room-control/room-control-factory.js +5 -1
- package/lib-es/room-control/sharing-control/index.js +13 -2
- package/lib-es/room-control/type.js +6 -6
- package/lib-es/room-control/user-control/index.js +2 -2
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +21 -13
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +13 -3
- package/lib-es/room-control/widget-control/index.js +109 -0
- package/lib-es/room-control/widget-control/type.js +1 -0
- package/lib-es/room-router/index.js +7 -1
- package/lib-es/service/api.js +16 -2
- package/lib-es/utilities/convertRoomType.js +19 -0
- package/lib-es/utilities/error-helpers.js +1 -0
- package/lib-es/utilities/parameters.js +3 -0
- package/lib-es/utilities/shared-storage.js +14 -0
- package/package.json +10 -8
package/lib/engine/index.js
CHANGED
|
@@ -60,6 +60,7 @@ var _parameters = require("../utilities/parameters");
|
|
|
60
60
|
var _validateParams = _interopRequireDefault(require("../utilities/validate-params"));
|
|
61
61
|
var _infinityRoomControl = require("../room-control/infinity-room-control");
|
|
62
62
|
var _remoteControl = require("../remote-control");
|
|
63
|
+
var _convertRoomType = require("../utilities/convertRoomType");
|
|
63
64
|
let _initProto, _renewUserTokenDecs, _createMainRoomControlDecs, _createInfinityRoomControlDecs, _createWaitingRoomControlDecs, _createRoomRouterDecs, _createRoomControlAndJoinDecs, _sendPeerMessageDecs, _setParametersDecs;
|
|
64
65
|
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)]; } }; }
|
|
65
66
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -295,7 +296,8 @@ class FcrCoreEngineImpl {
|
|
|
295
296
|
data,
|
|
296
297
|
ts
|
|
297
298
|
} = res;
|
|
298
|
-
|
|
299
|
+
const fcrRoomType = (0, _convertRoomType.convertServerRoomTypeToFcrRoomType)(data.room.roomProperties.roomType);
|
|
300
|
+
switch (fcrRoomType) {
|
|
299
301
|
case _type3.FcrRoomType.Waitingroom:
|
|
300
302
|
roomControl = this.createWaitingRoomControl(data.room.roomInfo.roomUuid);
|
|
301
303
|
break;
|
|
@@ -306,13 +308,13 @@ class FcrCoreEngineImpl {
|
|
|
306
308
|
roomControl = this.createMainRoomControl(roomId);
|
|
307
309
|
break;
|
|
308
310
|
default:
|
|
309
|
-
throw new Error(`Unknown room type: ${
|
|
311
|
+
throw new Error(`Unknown room type: ${fcrRoomType}`);
|
|
310
312
|
}
|
|
311
313
|
await roomControl.join({
|
|
312
314
|
...options,
|
|
313
315
|
snapshot: data,
|
|
314
316
|
timestamp: ts,
|
|
315
|
-
createStreamConfigs:
|
|
317
|
+
createStreamConfigs: fcrRoomType === _type3.FcrRoomType.Waitingroom ? [] : options.createStreamConfigs
|
|
316
318
|
});
|
|
317
319
|
}, [], {
|
|
318
320
|
retriesMax: 10
|
package/lib/imports.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export type { AgoraRteAudioRawDataConfig, AgoraRteBeautyOptions, AgoraRteCameraP
|
|
|
47
47
|
export type { AgoraRteMonitor } from 'agora-rte-sdk/lib/core/monitor';
|
|
48
48
|
export type { AgoraRteMediaControl } from 'agora-rte-sdk/lib/core/media/type';
|
|
49
49
|
export type { AgoraRteUpdateStreamPrivilege, AgoraRteMediaStreamInfo, } from 'agora-rte-sdk/lib/core/scene/type';
|
|
50
|
-
export { AgoraRteConnectionState, AgoraRteEngine, convertStreamTypeToPublishState, AgoraRteLatencyLevel, } from 'agora-rte-sdk';
|
|
50
|
+
export { AgoraRteConnectionState, AgoraRteEngine, convertStreamTypeToPublishState, AgoraRteLatencyLevel, AgoraRteVideoOutputOrientationMode, } from 'agora-rte-sdk';
|
|
51
51
|
export { AgoraRteRoomConnectorType, AgoraRteStreamPrivilegeOperation, AgoraRteStreamPrivilegeVideoSourceType, AgoraRteStreamPrivilegeAudioSourceType, AgoraRteMediaStreamType, } from 'agora-rte-sdk/lib/core/scene/type';
|
|
52
52
|
export { AgoraRtcRegion, AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcMediaSourceState, AgoraRtcRenderMode, AgoraRtcVideoStreamType, AgoraRtcCapability, AgoraRtcAiDenoiseLevel, AgoraRtcAudioOutputRouting, AgoraRtcLatencyLevelType, AgoraRtcEncryptionMode, AgoraRtcDegradationPreference, } from 'agora-rte-sdk/lib/core/rtc/type';
|
|
53
53
|
export { AgoraRteStreamLayer } from 'agora-rte-sdk/lib/type';
|
package/lib/imports.js
CHANGED
|
@@ -216,6 +216,12 @@ Object.defineProperty(exports, "AgoraRteVideoOrientation", {
|
|
|
216
216
|
return _type5.AgoraRteVideoOrientation;
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
|
+
Object.defineProperty(exports, "AgoraRteVideoOutputOrientationMode", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function () {
|
|
222
|
+
return _agoraRteSdk.AgoraRteVideoOutputOrientationMode;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
219
225
|
Object.defineProperty(exports, "AgoraRteVideoSourceType", {
|
|
220
226
|
enumerable: true,
|
|
221
227
|
get: function () {
|
package/lib/index.d.ts
CHANGED
|
@@ -5,3 +5,7 @@ export { FcrStreamLatencyLevel, FcrPermissionAction, FcrPrivilegeUserRole, FcrUs
|
|
|
5
5
|
export { FcrCoreEngineImpl as FcrCoreEngine } from './engine';
|
|
6
6
|
export { FcrCoreEngineConfig } from './struct';
|
|
7
7
|
export { FcrError } from './type';
|
|
8
|
+
export type { AgoraRtcDimensions } from './schema';
|
|
9
|
+
export type { AgoraRteCameraPosition as FcrCameraPosition } from './imports';
|
|
10
|
+
export { FcrDegradationPreference } from './schema';
|
|
11
|
+
export { AgoraRteVideoOutputOrientationMode as FcrVideoOutputOrientationMode } from './imports';
|
package/lib/index.js
CHANGED
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "FcrCoreEngineConfig", {
|
|
|
51
51
|
return _struct.FcrCoreEngineConfig;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "FcrDegradationPreference", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _schema.FcrDegradationPreference;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
Object.defineProperty(exports, "FcrDualVideoStreamConfig", {
|
|
55
61
|
enumerable: true,
|
|
56
62
|
get: function () {
|
|
@@ -159,6 +165,12 @@ Object.defineProperty(exports, "FcrVideoEncoderConfig", {
|
|
|
159
165
|
return _type.FcrVideoEncoderConfig;
|
|
160
166
|
}
|
|
161
167
|
});
|
|
168
|
+
Object.defineProperty(exports, "FcrVideoOutputOrientationMode", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _imports.AgoraRteVideoOutputOrientationMode;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
162
174
|
Object.defineProperty(exports, "FcrVideoRenderMode", {
|
|
163
175
|
enumerable: true,
|
|
164
176
|
get: function () {
|
|
@@ -186,4 +198,5 @@ Object.defineProperty(exports, "registerPlugin", {
|
|
|
186
198
|
var _imports = require("./imports");
|
|
187
199
|
var _type = require("./type");
|
|
188
200
|
var _engine = require("./engine");
|
|
189
|
-
var _struct = require("./struct");
|
|
201
|
+
var _struct = require("./struct");
|
|
202
|
+
var _schema = require("./schema");
|
|
@@ -326,6 +326,8 @@ class FcrPeerSessionControlImpl {
|
|
|
326
326
|
data,
|
|
327
327
|
cmd
|
|
328
328
|
} = payload;
|
|
329
|
+
const logContext = `cmd=${cmd}, sessionKey=${data.sessionKey}, sessionId=${data.sessionUuid}, ` + `action=${String(data.action)}, senderId=${senderId}, keepAlive=${!!data.keepAlive}`;
|
|
330
|
+
this.logger.info(`[PeerSession] received peer message: ${logContext}, payload=${JSON.stringify(data.payload ?? {})}`);
|
|
329
331
|
if (cmd === '1001') {
|
|
330
332
|
const session = {
|
|
331
333
|
sessionId: data.sessionUuid,
|
|
@@ -358,7 +360,10 @@ class FcrPeerSessionControlImpl {
|
|
|
358
360
|
...params,
|
|
359
361
|
action: 1
|
|
360
362
|
});
|
|
363
|
+
this.logger.info(`[PeerSession] forward peer session accepted to observers: ${logContext}`);
|
|
361
364
|
this._observable.notifyObservers('onPeerSessionAccepted', sessionResponse);
|
|
365
|
+
} else {
|
|
366
|
+
this.logger.info(`[PeerSession] ignore peer session accepted without local schedule: ${logContext}`);
|
|
362
367
|
}
|
|
363
368
|
if (this._receivedMap.has(session.sessionId)) {
|
|
364
369
|
this._receivedMap.set(session.sessionId, {
|
|
@@ -371,8 +376,10 @@ class FcrPeerSessionControlImpl {
|
|
|
371
376
|
return;
|
|
372
377
|
} else {
|
|
373
378
|
if (!this._receivedMap.has(session.sessionId)) {
|
|
374
|
-
this.logger.info(`[PeerSession]
|
|
379
|
+
this.logger.info(`[PeerSession] forward peer session request to observers: ${logContext}`);
|
|
375
380
|
this._observable.notifyObservers('onPeerSessionReceived', session);
|
|
381
|
+
} else {
|
|
382
|
+
this.logger.info(`[PeerSession] peer session request already cached, update cache only: ${logContext}`);
|
|
376
383
|
}
|
|
377
384
|
this._receivedMap.set(session.sessionId, {
|
|
378
385
|
...session,
|
|
@@ -381,6 +388,8 @@ class FcrPeerSessionControlImpl {
|
|
|
381
388
|
action: 0
|
|
382
389
|
});
|
|
383
390
|
}
|
|
391
|
+
} else {
|
|
392
|
+
this.logger.info(`[PeerSession] ignore expired peer session message: ${logContext}, ` + `timestamp=${session.timestamp}, duration=${session.duration}`);
|
|
384
393
|
}
|
|
385
394
|
} else if (cmd === '1002') {
|
|
386
395
|
if (data.action === 1) {
|
|
@@ -396,9 +405,11 @@ class FcrPeerSessionControlImpl {
|
|
|
396
405
|
cause: data.payload?.cause ?? {},
|
|
397
406
|
keepAlive: !!data.keepAlive
|
|
398
407
|
};
|
|
399
|
-
this.logger.info(`[PeerSession] received peer session accepted ${JSON.stringify(sessionResponse)}`);
|
|
400
408
|
this._scheduleMap.delete(data.sessionUuid);
|
|
409
|
+
this.logger.info(`[PeerSession] forward peer session accepted to observers: ${logContext}`);
|
|
401
410
|
this._observable.notifyObservers('onPeerSessionAccepted', sessionResponse);
|
|
411
|
+
} else {
|
|
412
|
+
this.logger.info(`[PeerSession] ignore peer session accepted without local schedule: ${logContext}`);
|
|
402
413
|
}
|
|
403
414
|
} else if (data.action === 2) {
|
|
404
415
|
if (this._scheduleMap.has(data.sessionUuid)) {
|
|
@@ -413,11 +424,13 @@ class FcrPeerSessionControlImpl {
|
|
|
413
424
|
cause: data.payload?.cause ?? {},
|
|
414
425
|
keepAlive: !!data.keepAlive
|
|
415
426
|
};
|
|
416
|
-
this.logger.info(`[PeerSession] received peer session rejected ${JSON.stringify(sessionResponse)}`);
|
|
417
427
|
if (this._scheduleMap.has(data.sessionUuid)) {
|
|
418
428
|
this._scheduleMap.delete(data.sessionUuid);
|
|
429
|
+
this.logger.info(`[PeerSession] forward peer session rejected to observers: ${logContext}`);
|
|
419
430
|
this._observable.notifyObservers('onPeerSessionRejected', sessionResponse);
|
|
420
431
|
}
|
|
432
|
+
} else {
|
|
433
|
+
this.logger.info(`[PeerSession] ignore peer session rejected without local schedule: ${logContext}`);
|
|
421
434
|
}
|
|
422
435
|
} else if (data.action === 3) {
|
|
423
436
|
const scheduleSession = this._scheduleMap.get(data.sessionUuid);
|
|
@@ -429,7 +442,6 @@ class FcrPeerSessionControlImpl {
|
|
|
429
442
|
fromUserId: senderId,
|
|
430
443
|
cause: data.payload?.cause ?? {}
|
|
431
444
|
};
|
|
432
|
-
this.logger.info(`[PeerSession] received peer session ended ${JSON.stringify(params)}`);
|
|
433
445
|
if (scheduleSession) {
|
|
434
446
|
this._scheduleMap.delete(data.sessionUuid);
|
|
435
447
|
}
|
|
@@ -437,8 +449,15 @@ class FcrPeerSessionControlImpl {
|
|
|
437
449
|
this._receivedMap.delete(data.sessionUuid);
|
|
438
450
|
}
|
|
439
451
|
this._observable.notifyObservers('onPeerSessionEnded', params.sessionId, params.fromUserId, params.cause);
|
|
452
|
+
this.logger.info(`[PeerSession] forward peer session ended to observers: ${logContext}`);
|
|
453
|
+
} else {
|
|
454
|
+
this.logger.info(`[PeerSession] ignore peer session ended without cached session: ${logContext}`);
|
|
440
455
|
}
|
|
456
|
+
} else {
|
|
457
|
+
this.logger.info(`[PeerSession] ignore peer session response with unknown action: ${logContext}`);
|
|
441
458
|
}
|
|
459
|
+
} else {
|
|
460
|
+
this.logger.info(`[PeerSession] ignore unsupported peer session cmd: ${logContext}`);
|
|
442
461
|
}
|
|
443
462
|
}
|
|
444
463
|
|
|
@@ -78,13 +78,17 @@ class FcrRemoteControlImpl {
|
|
|
78
78
|
data,
|
|
79
79
|
cmd
|
|
80
80
|
} = payload;
|
|
81
|
+
const logContext = `cmd=${cmd}, sessionKey=${data.sessionKey}, sessionId=${data.sessionUuid}, ` + `action=${String(data.action)}, senderId=${senderId}, keepAlive=${!!data.keepAlive}`;
|
|
81
82
|
if (data.sessionKey !== this._remoteControlSessionKey) {
|
|
83
|
+
this.logger.info(`[RemoteControl] ignore peer message because sessionKey does not match remote-control: ${logContext}`);
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
86
|
if (cmd === '1001') {
|
|
85
87
|
if (!data.keepAlive) {
|
|
88
|
+
this.logger.info(`[RemoteControl] ignore remote-control update without keepAlive: ${logContext}`);
|
|
86
89
|
return;
|
|
87
90
|
}
|
|
91
|
+
this.logger.info(`[RemoteControl] forward update session for handling: ${logContext}`);
|
|
88
92
|
return await this._handleUpdateRemoteControlSession({
|
|
89
93
|
senderId: senderId,
|
|
90
94
|
sessionKey: data.sessionKey,
|
|
@@ -97,6 +101,7 @@ class FcrRemoteControlImpl {
|
|
|
97
101
|
timestamp: message.timestamp
|
|
98
102
|
});
|
|
99
103
|
} else if (cmd === '1002') {
|
|
104
|
+
this.logger.info(`[RemoteControl] forward delete session for handling: ${logContext}`);
|
|
100
105
|
return await this._handleDeleteRemoteControlSession({
|
|
101
106
|
senderId: senderId,
|
|
102
107
|
sessionKey: data.sessionKey,
|
|
@@ -107,6 +112,8 @@ class FcrRemoteControlImpl {
|
|
|
107
112
|
action: data.action,
|
|
108
113
|
timestamp: message.timestamp
|
|
109
114
|
});
|
|
115
|
+
} else {
|
|
116
|
+
this.logger.info(`[RemoteControl] ignore unsupported cmd: ${logContext}`);
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
119
|
async _handleUpdateRemoteControlSession(data) {
|
|
@@ -45,6 +45,7 @@ var _2 = require("..");
|
|
|
45
45
|
var _errorHelpers = require("../utilities/error-helpers");
|
|
46
46
|
var _helpers = require("./helpers");
|
|
47
47
|
var _sttControl = require("./stt-control");
|
|
48
|
+
var _widgetControl = require("./widget-control");
|
|
48
49
|
var _applicationControl = require("./application-control");
|
|
49
50
|
let _initProto, _joinDecs, _updateRoomPropertiesDecs, _updateIncrementRoomPropertiesDecs, _deleteRoomPropertiesDecs, _startCloudRecordingDecs, _startLiveStreamingDecs, _updateLiveStreamingLayoutDecs, _sendRoomMessageDecs; // Core SDK imports
|
|
50
51
|
// Service and API imports
|
|
@@ -79,6 +80,7 @@ class FcrBaseRoomControlImpl {
|
|
|
79
80
|
_joinRoomSuccess = false;
|
|
80
81
|
_joining = false;
|
|
81
82
|
_joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
83
|
+
_isClientRecordingOwner = false;
|
|
82
84
|
_isStartingClientRecording = false;
|
|
83
85
|
constructor(_engine, _scene, _api, _config, _roomType, _chatConnection, _sharedCache, _chatRoomControl) {
|
|
84
86
|
this._engine = _engine;
|
|
@@ -117,9 +119,10 @@ class FcrBaseRoomControlImpl {
|
|
|
117
119
|
// TODO: 确认是否需要限制在主房间
|
|
118
120
|
this._roomType === _type2.FcrRoomType.Mainroom || this._roomType === _type2.FcrRoomType.Infinityroom)) {
|
|
119
121
|
this.logger.info('join scene success, start create sharing control');
|
|
120
|
-
this.sharingControl = new _sharingControl.FcrSharingControlImpl(this._scene, this._api, this._engine, this._privilegeControl, this._streamControl, this._sharedCache, this._userControl);
|
|
122
|
+
this.sharingControl = new _sharingControl.FcrSharingControlImpl(this._scene, this._api, this._engine, this._config, this._privilegeControl, this._streamControl, this._sharedCache, this._userControl);
|
|
121
123
|
}
|
|
122
124
|
this._sttControl = new _sttControl.FcrSttControlImpl(this._scene, this._api, this._sharedCache);
|
|
125
|
+
this._widgetControl = new _widgetControl.FcrWidgetControlImpl(this._scene, this._api, this._sharedCache);
|
|
123
126
|
this._observable.notifyObservers('onJoinRoomSuccess', sceneId);
|
|
124
127
|
},
|
|
125
128
|
// onJoinSceneFailure: (sceneId, error) => {
|
|
@@ -257,6 +260,7 @@ class FcrBaseRoomControlImpl {
|
|
|
257
260
|
*/
|
|
258
261
|
_registerClientRecordingObserver() {
|
|
259
262
|
this._engine.getMediaControl().addClientRecordingObserver(this._clientRecordingObserver);
|
|
263
|
+
this._isClientRecordingOwner = true;
|
|
260
264
|
}
|
|
261
265
|
|
|
262
266
|
/**
|
|
@@ -264,6 +268,7 @@ class FcrBaseRoomControlImpl {
|
|
|
264
268
|
*/
|
|
265
269
|
_unregisterClientRecordingObserver() {
|
|
266
270
|
this._engine.getMediaControl().removeClientRecordingObserver(this._clientRecordingObserver);
|
|
271
|
+
this._isClientRecordingOwner = false;
|
|
267
272
|
}
|
|
268
273
|
|
|
269
274
|
/**
|
|
@@ -276,6 +281,10 @@ class FcrBaseRoomControlImpl {
|
|
|
276
281
|
(0, _helpers.validateControllerInitialized)(this._sttControl, _errorHelpers.ControllerType.STT);
|
|
277
282
|
return this._sttControl;
|
|
278
283
|
}
|
|
284
|
+
getWidgetControl() {
|
|
285
|
+
(0, _helpers.validateControllerInitialized)(this._widgetControl, _errorHelpers.ControllerType.WIDGET);
|
|
286
|
+
return this._widgetControl;
|
|
287
|
+
}
|
|
279
288
|
getApplicationControl() {
|
|
280
289
|
(0, _helpers.validateControllerInitialized)(this._applicationControl, _errorHelpers.ControllerType.APPLICATION);
|
|
281
290
|
return this._applicationControl;
|
|
@@ -400,7 +409,6 @@ class FcrBaseRoomControlImpl {
|
|
|
400
409
|
(0, _helpers.validateRoomJoined)(this._joinRoomSuccess, 'get schedule info');
|
|
401
410
|
const schedule = this._scene.getScenePropertiesByKeyPath('schedule');
|
|
402
411
|
return {
|
|
403
|
-
...schedule,
|
|
404
412
|
duration: schedule.duration ?? 0,
|
|
405
413
|
startTime: Math.floor((schedule.startTime ?? 0) / 1000)
|
|
406
414
|
};
|
|
@@ -762,17 +770,20 @@ class FcrBaseRoomControlImpl {
|
|
|
762
770
|
async _cleanup() {
|
|
763
771
|
this._scene.removeObserver(this._sceneObserver);
|
|
764
772
|
this._engine.removeObserver(this._engineObserver);
|
|
765
|
-
this._unregisterClientRecordingObserver();
|
|
766
773
|
|
|
767
|
-
//
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
this.
|
|
774
|
+
// 只有注册过录制观察者的 room control 才拥有录制生命周期,
|
|
775
|
+
// 其他房间(如等候室)的 cleanup 不应停止共享 mediaControl 上的录制。
|
|
776
|
+
if (this._isClientRecordingOwner) {
|
|
777
|
+
this._unregisterClientRecordingObserver();
|
|
778
|
+
try {
|
|
779
|
+
const mediaControl = this._engine.getMediaControl();
|
|
780
|
+
if (mediaControl.isClientRecordingActive()) {
|
|
781
|
+
await mediaControl.stopClientRecording();
|
|
782
|
+
this.logger.info('_cleanup: stopped client recording');
|
|
783
|
+
}
|
|
784
|
+
} catch (e) {
|
|
785
|
+
this.logger.error(`_cleanup: failed to stop client recording: ${e.message}`);
|
|
773
786
|
}
|
|
774
|
-
} catch (e) {
|
|
775
|
-
this.logger.error(`_cleanup: failed to stop client recording: ${e.message}`);
|
|
776
787
|
}
|
|
777
788
|
this._sharedCache.getRoomCache(this._scene.sceneId).clear();
|
|
778
789
|
try {
|
|
@@ -60,6 +60,7 @@ class FcrInfinityRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
60
60
|
this._interpreterControl = new _interpreterControl.FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
61
61
|
this._addLogObserver();
|
|
62
62
|
(0, _boardInitInfoHelper.addBoardInitInfoObserver)(this._scene, this._api, this.logger);
|
|
63
|
+
this._registerClientRecordingObserver();
|
|
63
64
|
this.logger.info(`initialized, room id: ${this._scene.sceneId}`);
|
|
64
65
|
}
|
|
65
66
|
getAnnouncement() {
|
|
@@ -114,13 +115,11 @@ class FcrInfinityRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
114
115
|
_onLocalUserPermissionInfoDeleted(roomId, event) {
|
|
115
116
|
if ((0, _utils.hasBoardWritePermission)(event.permissionInfo)) {
|
|
116
117
|
this.logger.info(`remove board write permission`);
|
|
117
|
-
|
|
118
|
-
// this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
|
|
118
|
+
this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
|
|
119
119
|
}
|
|
120
120
|
if ((0, _utils.hasAnnotationWritePermission)(event.permissionInfo)) {
|
|
121
121
|
this.logger.info(`remove annotation write permission`);
|
|
122
|
-
|
|
123
|
-
// this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
|
|
122
|
+
this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
_addLogObserver() {
|
|
@@ -139,13 +139,11 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
139
139
|
_onLocalUserPermissionInfoDeleted(roomId, event) {
|
|
140
140
|
if ((0, _utils2.hasBoardWritePermission)(event.permissionInfo)) {
|
|
141
141
|
this.logger.info(`remove board write permission`);
|
|
142
|
-
|
|
143
|
-
// this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
|
|
142
|
+
this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
|
|
144
143
|
}
|
|
145
144
|
if ((0, _utils2.hasAnnotationWritePermission)(event.permissionInfo)) {
|
|
146
145
|
this.logger.info(`remove annotation write permission`);
|
|
147
|
-
|
|
148
|
-
// this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
|
|
146
|
+
this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
_checkIfUpdateAnnotationMainWindow() {
|
|
@@ -7,6 +7,7 @@ exports.RoomControlFactory = void 0;
|
|
|
7
7
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
8
|
require("core-js/modules/esnext.iterator.map.js");
|
|
9
9
|
var _imports = require("../imports");
|
|
10
|
+
var _convertRoomType = require("../utilities/convertRoomType");
|
|
10
11
|
var _error = require("../utilities/error");
|
|
11
12
|
var _infinityRoomControl = require("./infinity-room-control");
|
|
12
13
|
var _room = require("./interpreter-control/room");
|
|
@@ -53,7 +54,10 @@ class RoomControlFactory {
|
|
|
53
54
|
roomResponse,
|
|
54
55
|
monitorControl
|
|
55
56
|
} = params;
|
|
56
|
-
const roomType = roomResponse.room.roomProperties.roomType;
|
|
57
|
+
const roomType = (0, _convertRoomType.convertServerRoomTypeToFcrRoomType)(roomResponse.room.roomProperties.roomType);
|
|
58
|
+
if (roomType === null) {
|
|
59
|
+
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, `Unsupported room types: ${roomResponse.room.roomProperties.roomType}`);
|
|
60
|
+
}
|
|
57
61
|
const RoomControlImpl = ROOM_CONTROL_IMPLEMENTATIONS[roomType];
|
|
58
62
|
if (!RoomControlImpl) {
|
|
59
63
|
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, `Unsupported room types: ${roomType}`);
|
|
@@ -5,13 +5,14 @@ import { FcrScreenSharingState, FcrSharingControl, FcrSharingObserver, FcrWhiteb
|
|
|
5
5
|
import { FcrPrivilegeControl } from '../privilege-control/type';
|
|
6
6
|
import { FcrWhiteboardControl } from '../whiteboard-control-v2/whiteboard-control/type';
|
|
7
7
|
import { FcrStreamInfo } from '../../type';
|
|
8
|
-
import { FcrUserControl } from '../..';
|
|
8
|
+
import { FcrCoreEngineConfig, FcrUserControl } from '../..';
|
|
9
9
|
import { FcrSharedCache } from '../shared-cache';
|
|
10
10
|
import { FcrAnnotationControl } from '../whiteboard-control-v2/annotation-control/type';
|
|
11
11
|
export declare class FcrSharingControlImpl implements FcrSharingControl {
|
|
12
12
|
private _scene;
|
|
13
13
|
private _api;
|
|
14
14
|
private _engine;
|
|
15
|
+
private _config;
|
|
15
16
|
private _privilegeControl;
|
|
16
17
|
private _streamControl;
|
|
17
18
|
private _sharedCache;
|
|
@@ -30,7 +31,7 @@ export declare class FcrSharingControlImpl implements FcrSharingControl {
|
|
|
30
31
|
private _whiteboardObserver;
|
|
31
32
|
get ownerId(): string;
|
|
32
33
|
get ownerStream(): FcrStreamInfo | null;
|
|
33
|
-
constructor(_scene: AgoraRteScene, _api: FcrCoreServiceApi, _engine: AgoraRteEngine, _privilegeControl: FcrPrivilegeControl, _streamControl: FcrStreamControl, _sharedCache: FcrSharedCache, _userControl: FcrUserControl);
|
|
34
|
+
constructor(_scene: AgoraRteScene, _api: FcrCoreServiceApi, _engine: AgoraRteEngine, _config: FcrCoreEngineConfig, _privilegeControl: FcrPrivilegeControl, _streamControl: FcrStreamControl, _sharedCache: FcrSharedCache, _userControl: FcrUserControl);
|
|
34
35
|
startScreenSharing(config: FcrScreenStreamCreateConfig, size?: FcrSize, labels?: Map<string, any>): Promise<string>;
|
|
35
36
|
startWhiteboard(): Promise<void>;
|
|
36
37
|
updateScreenSharing(enableAnnotation: boolean): Promise<void>;
|
|
@@ -35,6 +35,8 @@ var _factory2 = require("../whiteboard-control-v2/annotation-control/factory");
|
|
|
35
35
|
var _type3 = require("../type");
|
|
36
36
|
var _type4 = require("../whiteboard-control/type");
|
|
37
37
|
var _sceneProperties = require("../../utilities/scene-properties");
|
|
38
|
+
var _parameters = require("../../utilities/parameters");
|
|
39
|
+
var _sharedStorage = require("../../utilities/shared-storage");
|
|
38
40
|
let _initProto, _startScreenSharingDecs, _updateScreenSharingDecs;
|
|
39
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)]; } }; }
|
|
40
42
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -73,10 +75,11 @@ class FcrSharingControlImpl {
|
|
|
73
75
|
get ownerStream() {
|
|
74
76
|
return this._shareOwnerStream;
|
|
75
77
|
}
|
|
76
|
-
constructor(_scene, _api, _engine, _privilegeControl, _streamControl, _sharedCache, _userControl) {
|
|
78
|
+
constructor(_scene, _api, _engine, _config, _privilegeControl, _streamControl, _sharedCache, _userControl) {
|
|
77
79
|
this._scene = _scene;
|
|
78
80
|
this._api = _api;
|
|
79
81
|
this._engine = _engine;
|
|
82
|
+
this._config = _config;
|
|
80
83
|
this._privilegeControl = _privilegeControl;
|
|
81
84
|
this._streamControl = _streamControl;
|
|
82
85
|
this._sharedCache = _sharedCache;
|
|
@@ -88,6 +91,12 @@ class FcrSharingControlImpl {
|
|
|
88
91
|
this._streamControl.addObserver(this._streamObserver);
|
|
89
92
|
this._whiteboardControl.addObserver(this._whiteboardObserver);
|
|
90
93
|
this._scene.addObserver(this._sceneObserver);
|
|
94
|
+
(0, _sharedStorage.clearBoardIpList)();
|
|
95
|
+
const boardIpList = (0, _parameters.getScribbleForgeIpList)(this._config.parameters);
|
|
96
|
+
if (boardIpList) {
|
|
97
|
+
this.logger.info('set board ip list to storage ', boardIpList);
|
|
98
|
+
(0, _sharedStorage.setBoardIpList)(boardIpList);
|
|
99
|
+
}
|
|
91
100
|
this.logger.info(`initialized, room id: ${this._scene.sceneId}`);
|
|
92
101
|
}
|
|
93
102
|
async startScreenSharing(config, size, labels) {
|
|
@@ -159,6 +168,7 @@ class FcrSharingControlImpl {
|
|
|
159
168
|
userName,
|
|
160
169
|
roomId: this._scene.sceneId,
|
|
161
170
|
boardRatio: 1,
|
|
171
|
+
ipList: (0, _parameters.getScribbleForgeIpList)(this._config.parameters),
|
|
162
172
|
size: {
|
|
163
173
|
width: 1280,
|
|
164
174
|
height: 720
|
|
@@ -205,7 +215,8 @@ class FcrSharingControlImpl {
|
|
|
205
215
|
userId,
|
|
206
216
|
userName,
|
|
207
217
|
roomId: this._scene.sceneId,
|
|
208
|
-
boardRatio: 0
|
|
218
|
+
boardRatio: 0,
|
|
219
|
+
ipList: (0, _parameters.getScribbleForgeIpList)(this._config.parameters)
|
|
209
220
|
};
|
|
210
221
|
this._whiteboardControl = factory.createForMainProcess(
|
|
211
222
|
// @ts-ignore
|
|
@@ -14,6 +14,7 @@ import { FcrSharingControl } from './sharing-control/type';
|
|
|
14
14
|
import { FcrSttControl } from './stt-control/type';
|
|
15
15
|
import { FcrRoomAnnouncement } from './infinity-room-control/type';
|
|
16
16
|
import { FcrApplicationControl } from './application-control/type';
|
|
17
|
+
import { FcrWidgetControl } from './widget-control/type';
|
|
17
18
|
export interface FcrBaseRoomControl {
|
|
18
19
|
/**
|
|
19
20
|
* Gets the caption control.
|
|
@@ -27,6 +28,10 @@ export interface FcrBaseRoomControl {
|
|
|
27
28
|
* Gets the stream control.
|
|
28
29
|
*/
|
|
29
30
|
getStreamControl(): FcrStreamControl;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the widget control.
|
|
33
|
+
*/
|
|
34
|
+
getWidgetControl(): FcrWidgetControl;
|
|
30
35
|
/**
|
|
31
36
|
* Gets the room session control.
|
|
32
37
|
*/
|
|
@@ -348,12 +353,12 @@ export type FcrJoinBeforeHostWaitingRoomObserver = FcrRoomObserver & {};
|
|
|
348
353
|
export type FcrMainRoomObserver = FcrRoomObserver & {};
|
|
349
354
|
export type FcrLocalUserWaitingRoomMovedEvent = FcrRoomPropertiesUpdatedEvent;
|
|
350
355
|
export declare enum FcrRoomType {
|
|
351
|
-
Mainroom =
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
Interpreterroom =
|
|
355
|
-
JoinBeforeHostWaitingRoom =
|
|
356
|
-
Infinityroom =
|
|
356
|
+
Mainroom = 0,
|
|
357
|
+
Subroom = 1,
|
|
358
|
+
Waitingroom = 2,
|
|
359
|
+
Interpreterroom = 3,
|
|
360
|
+
JoinBeforeHostWaitingRoom = 4,
|
|
361
|
+
Infinityroom = 5
|
|
357
362
|
}
|
|
358
363
|
export declare enum FcrLiveStreamingStateUpdatedReason {
|
|
359
364
|
USERSTOPPED = 1,
|
package/lib/room-control/type.js
CHANGED
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FcrWidgetUuid = exports.FcrWidgetCauseCmd = exports.FcrRoomType = exports.FcrLiveStreamingStateUpdatedReason = exports.FcrLineType = void 0;
|
|
7
7
|
let FcrRoomType = exports.FcrRoomType = /*#__PURE__*/function (FcrRoomType) {
|
|
8
|
-
FcrRoomType[FcrRoomType["Mainroom"] =
|
|
9
|
-
FcrRoomType[FcrRoomType["
|
|
10
|
-
FcrRoomType[FcrRoomType["
|
|
11
|
-
FcrRoomType[FcrRoomType["Interpreterroom"] =
|
|
12
|
-
FcrRoomType[FcrRoomType["JoinBeforeHostWaitingRoom"] =
|
|
13
|
-
FcrRoomType[FcrRoomType["Infinityroom"] =
|
|
8
|
+
FcrRoomType[FcrRoomType["Mainroom"] = 0] = "Mainroom";
|
|
9
|
+
FcrRoomType[FcrRoomType["Subroom"] = 1] = "Subroom";
|
|
10
|
+
FcrRoomType[FcrRoomType["Waitingroom"] = 2] = "Waitingroom";
|
|
11
|
+
FcrRoomType[FcrRoomType["Interpreterroom"] = 3] = "Interpreterroom";
|
|
12
|
+
FcrRoomType[FcrRoomType["JoinBeforeHostWaitingRoom"] = 4] = "JoinBeforeHostWaitingRoom";
|
|
13
|
+
FcrRoomType[FcrRoomType["Infinityroom"] = 5] = "Infinityroom";
|
|
14
14
|
return FcrRoomType;
|
|
15
15
|
}({});
|
|
16
16
|
let FcrLiveStreamingStateUpdatedReason = exports.FcrLiveStreamingStateUpdatedReason = /*#__PURE__*/function (FcrLiveStreamingStateUpdatedReason) {
|
|
@@ -72,8 +72,8 @@ class FcrUserControlImpl {
|
|
|
72
72
|
});
|
|
73
73
|
const fcrUserEvents = events.map(e => {
|
|
74
74
|
return {
|
|
75
|
-
userInfo: e.userInfo && (0, _user.convertRteUserToFcrUser)(e.userInfo, this._roomCache)
|
|
76
|
-
operatorUser: e.operatorUser &&
|
|
75
|
+
userInfo: e.userInfo && (0, _user.convertRteUserToFcrUser)(e.userInfo, this._roomCache)
|
|
76
|
+
// operatorUser: e.operatorUser && convertRteUserToFcrUser(e.operatorUser, this._roomCache),
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
79
|
fcrUserEvents.forEach(event => {
|
|
@@ -170,14 +170,15 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
170
170
|
});
|
|
171
171
|
const {
|
|
172
172
|
userId,
|
|
173
|
-
userName
|
|
173
|
+
userName,
|
|
174
|
+
ipList
|
|
174
175
|
} = this.config;
|
|
175
176
|
const {
|
|
176
177
|
boardAppId,
|
|
177
178
|
boardId,
|
|
178
179
|
boardRegion,
|
|
179
|
-
boardToken
|
|
180
|
-
|
|
180
|
+
boardToken,
|
|
181
|
+
boardPerformance = false
|
|
181
182
|
} = this.boardRoomConfig || {};
|
|
182
183
|
if (!boardAppId) {
|
|
183
184
|
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, _imports.DetailErrorCode.UNDEFINED_ERROR, 'boardAppId is required');
|
|
@@ -200,6 +201,15 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
200
201
|
whiteboardOption.height = 600;
|
|
201
202
|
}
|
|
202
203
|
this.logger.info(`open board with boardId: ${boardId}, boardToken: ${boardToken}, region: ${boardRegion}, appIdentifier: ${boardAppId} whiteboardOption: ${(0, _imports.jsonstring)(whiteboardOption)}`);
|
|
204
|
+
let endpoint = undefined;
|
|
205
|
+
if (ipList !== undefined) {
|
|
206
|
+
if (Array.isArray(ipList) && ipList[0]) {
|
|
207
|
+
this.logger.info(`use ipList from config: ${(0, _imports.jsonstring)(ipList)}`);
|
|
208
|
+
endpoint = ipList[0];
|
|
209
|
+
} else {
|
|
210
|
+
this.logger.error(`ipList in config is empty or invalid: ${(0, _imports.jsonstring)(ipList)}, ignore ipList config`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
203
213
|
const rtmProvider = new _forgeRtm.RTMProvider_2_2(this.rtmClient);
|
|
204
214
|
const wbRoom = new _forgeRoom.Room(boardId, rtmProvider);
|
|
205
215
|
this.logger.info('ApplicationManager.registerApplication calling');
|
|
@@ -237,10 +247,11 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
237
247
|
nickName: userName || userId,
|
|
238
248
|
roomToken: boardToken,
|
|
239
249
|
sdkConfig: {
|
|
240
|
-
region: boardRegion,
|
|
250
|
+
region: endpoint ? 'private' : boardRegion,
|
|
241
251
|
appIdentifier: boardAppId
|
|
242
252
|
},
|
|
243
|
-
writable:
|
|
253
|
+
writable: isNeedLaunch,
|
|
254
|
+
endpoint
|
|
244
255
|
// verboseLog: true,
|
|
245
256
|
};
|
|
246
257
|
this.logger.info(`Room.joinRoom calling, params: ${(0, _imports.jsonstring)(joinRoomParams)}, timeout: ${WHITEBOARD_ROOM_JOIN_TIMEOUT}`);
|
|
@@ -286,14 +297,11 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
286
297
|
this.whiteboard = whiteboard;
|
|
287
298
|
this.boardView = boardView;
|
|
288
299
|
this.boardRoom = boardRoom;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
// boardView.setPerformanceMode(boardPerformance);
|
|
296
|
-
|
|
300
|
+
if (isNeedLaunch) {
|
|
301
|
+
// 所有人开启白板时都默认没有开启写权限, 需要写权限的地方需要自己手动开启
|
|
302
|
+
boardView.internalSetWritable(false);
|
|
303
|
+
}
|
|
304
|
+
boardView.setPerformanceMode(boardPerformance);
|
|
297
305
|
this.updateConnectionState(_type.FcrConnectionState.CONNECTED);
|
|
298
306
|
resolve(boardView);
|
|
299
307
|
if (this._waitPromiseResolve) {
|
|
@@ -28,6 +28,12 @@ export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow {
|
|
|
28
28
|
redo(): Promise<FcrReturnCode>;
|
|
29
29
|
clean(): Promise<FcrReturnCode>;
|
|
30
30
|
getSnapshotImage(): Promise<ImageData>;
|
|
31
|
+
/**
|
|
32
|
+
* 设置性能模式状态, enabled 为 true 时开启性能模式, 否则关闭性能模式
|
|
33
|
+
* 性能模式下, 白板会降低渲染质量及同步频率以提升性能, 适用于低性能设备或需要大量绘制元素的场景
|
|
34
|
+
* @param enable 是否开启性能模式
|
|
35
|
+
*/
|
|
36
|
+
setPerformanceMode(enable: boolean): FcrReturnCode;
|
|
31
37
|
setBackgroundColor(color: string): Promise<FcrReturnCode>;
|
|
32
38
|
getPageInfo(): FcrBoardPageInfo;
|
|
33
39
|
prevPage(): Promise<FcrReturnCode>;
|