fcr-core 3.7.8 → 3.8.0-alpha
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/chat-connection/index.d.ts +1 -1
- package/lib/engine/index.js +6 -5
- package/lib/imports.d.ts +7 -2
- package/lib/imports.js +25 -4
- package/lib/index.d.ts +2 -2
- package/lib/index.js +12 -0
- package/lib/media-control/desktop.js +4 -4
- package/lib/media-control/mobile.js +20 -20
- package/lib/media-control/type.d.ts +8 -0
- package/lib/plugins/chatroom.js +19 -3
- package/lib/room-control/ability-control/type.d.ts +4 -1
- package/lib/room-control/ability-control/type.js +3 -0
- package/lib/room-control/helpers/constants.d.ts +4 -0
- package/lib/room-control/helpers/constants.js +5 -1
- package/lib/room-control/index.js +16 -5
- package/lib/room-control/interpreter-control/index.js +2 -4
- package/lib/room-control/mainroom-control/index.js +66 -1
- package/lib/room-control/privilege-control/index.js +43 -3
- package/lib/room-control/privilege-control/type.d.ts +57 -10
- package/lib/room-control/privilege-control/type.js +17 -0
- package/lib/room-control/room-control-factory.js +1 -1
- package/lib/room-control/room-session/index.js +23 -13
- package/lib/room-control/room-session/type.d.ts +2 -2
- package/lib/room-control/sharing-control/index.d.ts +5 -5
- package/lib/room-control/sharing-control/index.js +43 -13
- package/lib/room-control/sharing-control/type.d.ts +9 -5
- package/lib/room-control/sharing-control/type.js +6 -1
- package/lib/room-control/stream-control/index.d.ts +8 -1
- package/lib/room-control/stream-control/index.js +139 -36
- package/lib/room-control/stream-control/type.d.ts +6 -0
- package/lib/room-control/stt-control/de-compress-gzip.d.ts +1 -0
- package/lib/room-control/stt-control/de-compress-gzip.js +49 -0
- package/lib/room-control/stt-control/index.d.ts +1 -0
- package/lib/room-control/stt-control/index.js +353 -0
- package/lib/room-control/stt-control/type.d.ts +142 -0
- package/lib/room-control/stt-control/type.js +16 -0
- package/lib/room-control/type.d.ts +15 -0
- package/lib/room-control/type.js +13 -1
- package/lib/room-control/whiteboard-control/enum.d.ts +15 -0
- package/lib/room-control/whiteboard-control/{types.js → enum.js} +12 -1
- package/lib/room-control/whiteboard-control/type.d.ts +38 -0
- package/lib/room-control/whiteboard-control/type.js +15 -0
- package/lib/room-control/whiteboard-control/utils.d.ts +3 -0
- package/lib/room-control/whiteboard-control/utils.js +23 -0
- package/lib/room-control/whiteboard-control-v1/board-subwindow.d.ts +6 -0
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +26 -0
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +58 -0
- package/lib/room-control/whiteboard-control-v1/board-window.js +571 -0
- package/lib/room-control/{whiteboard-control/enums.d.ts → whiteboard-control-v1/enum.d.ts} +3 -17
- package/lib/room-control/{whiteboard-control/enums.js → whiteboard-control-v1/enum.js} +3 -20
- package/lib/room-control/whiteboard-control-v1/factory.d.ts +9 -0
- package/lib/room-control/whiteboard-control-v1/factory.js +22 -0
- package/lib/room-control/whiteboard-control-v1/index.d.ts +1 -0
- package/lib/room-control/whiteboard-control-v1/index.js +440 -0
- package/lib/room-control/whiteboard-control-v1/mount-manager.d.ts +4 -0
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +15 -0
- package/lib/room-control/whiteboard-control-v1/type.d.ts +300 -0
- package/lib/room-control/whiteboard-control-v1/type.js +13 -0
- package/lib/room-control/whiteboard-control-v1/utils.d.ts +53 -0
- package/lib/room-control/whiteboard-control-v1/utils.js +290 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +17 -31
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -233
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +10 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +48 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +11 -19
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.js +1 -3
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +42 -0
- package/lib/room-control/whiteboard-control-v2/base/index.js +317 -0
- package/lib/room-control/whiteboard-control-v2/{main-window.d.ts → base/main-window.d.ts} +6 -4
- package/lib/room-control/whiteboard-control-v2/{main-window.js → base/main-window.js} +31 -18
- package/lib/room-control/whiteboard-control-v2/constant.d.ts +6 -0
- package/lib/room-control/whiteboard-control-v2/constant.js +15 -0
- package/lib/room-control/whiteboard-control-v2/enum.d.ts +26 -0
- package/lib/room-control/whiteboard-control-v2/enum.js +34 -0
- package/lib/room-control/{whiteboard-control/types.d.ts → whiteboard-control-v2/type.d.ts} +51 -165
- package/lib/room-control/whiteboard-control-v2/type.js +5 -0
- package/lib/room-control/whiteboard-control-v2/utils.d.ts +5 -4
- package/lib/room-control/whiteboard-control-v2/utils.js +22 -21
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +34 -33
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +124 -191
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +11 -0
- package/lib/room-control/whiteboard-control-v2/{annotation-control/index.js → whiteboard-control/factory.js} +35 -44
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +18 -30
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.js +1 -9
- package/lib/room-router/index.js +4 -0
- package/lib/schema.d.ts +23 -9
- package/lib/schema.js +10 -4
- package/lib/service/api.d.ts +75 -19
- package/lib/service/api.js +193 -24
- package/lib/type.d.ts +15 -2
- package/lib/type.js +13 -0
- package/lib/utilities/error-helpers.d.ts +2 -1
- package/lib/utilities/error-helpers.js +1 -0
- package/lib/utilities/error.d.ts +1 -0
- package/lib/utilities/error.js +1 -0
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/shared-storage.d.ts +3 -1
- package/lib/utilities/shared-storage.js +9 -1
- package/package.json +11 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.d.ts +0 -19
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.d.ts +0 -36
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.js +0 -262
- package/lib/room-control/whiteboard-control-v2/index.d.ts +0 -38
- package/lib/room-control/whiteboard-control-v2/index.js +0 -286
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.d.ts +0 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +0 -32
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.d.ts +0 -36
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.js +0 -252
|
@@ -6,7 +6,7 @@ export declare class FcrChatConnectionImpl implements FcrChatConnection {
|
|
|
6
6
|
private _api;
|
|
7
7
|
private _chatIpList?;
|
|
8
8
|
private _restIpList?;
|
|
9
|
-
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
9
|
+
protected logger: import("agora-foundation/lib/logger/type").Logger;
|
|
10
10
|
private _observable;
|
|
11
11
|
private _initConfig?;
|
|
12
12
|
private _conn?;
|
package/lib/engine/index.js
CHANGED
|
@@ -84,11 +84,12 @@ class FcrCoreEngine {
|
|
|
84
84
|
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
85
85
|
this._config = config;
|
|
86
86
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
87
|
+
this.logger.info('Fcr core engine is created, version: ', this.getVersion());
|
|
87
88
|
const parameters = this._presetParameters(config.parameters);
|
|
88
89
|
this._rteEngine = new _imports.AgoraRteEngine({
|
|
89
90
|
appId: config.appId,
|
|
90
91
|
userId: config.userId,
|
|
91
|
-
|
|
92
|
+
userToken: config.token,
|
|
92
93
|
rteRegion: config.region,
|
|
93
94
|
rtcRegion: _imports.AgoraRtcRegion.AREA_GLOBAL,
|
|
94
95
|
rtmRegion: _imports.AgoraRtmRegion.AREA_GLOBAL,
|
|
@@ -100,7 +101,7 @@ class FcrCoreEngine {
|
|
|
100
101
|
dualScreenVideoStreamConfig: config.dualScreenVideoStreamConfig,
|
|
101
102
|
parameters: parameters
|
|
102
103
|
});
|
|
103
|
-
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0, _imports.getSharedDomainHolder)(config.region));
|
|
104
|
+
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0, _imports.getSharedDomainHolder)(config.region), this._rteEngine.getRequestScheduler());
|
|
104
105
|
this._apiService = new _api.FcrCoreServiceApi(this._restfulClient, config.appId, config.region, !(0, _parameters.isEndpointRegionDisabled)(config.parameters));
|
|
105
106
|
|
|
106
107
|
// cannot be lazy loaded, because all the observers should be added before the engine is started
|
|
@@ -185,7 +186,7 @@ class FcrCoreEngine {
|
|
|
185
186
|
const scene = this._rteEngine.createScene({
|
|
186
187
|
sceneId: roomId
|
|
187
188
|
});
|
|
188
|
-
return new _mainroomControl.FcrMainRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new _chatroom.FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache));
|
|
189
|
+
return new _mainroomControl.FcrMainRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new _chatroom.FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache, false));
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
/**
|
|
@@ -197,7 +198,7 @@ class FcrCoreEngine {
|
|
|
197
198
|
const scene = this._rteEngine.createScene({
|
|
198
199
|
sceneId: roomId
|
|
199
200
|
});
|
|
200
|
-
return new _waitingroomControl.FcrWaitingRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new _chatroom.FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache));
|
|
201
|
+
return new _waitingroomControl.FcrWaitingRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new _chatroom.FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache, false));
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
/**
|
|
@@ -382,7 +383,7 @@ class FcrCoreEngine {
|
|
|
382
383
|
this.logger.info("setup fixed service domain list: ".concat(JSON.stringify(coreIpList)));
|
|
383
384
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
384
385
|
(0, _imports.getSharedDomainHolder)(this._config.region).setFixedDomainList(coreIpList);
|
|
385
|
-
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0, _imports.getSharedDomainHolder)(this._config.region));
|
|
386
|
+
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0, _imports.getSharedDomainHolder)(this._config.region), this._rteEngine.getRequestScheduler());
|
|
386
387
|
this._apiService.setRestfulClient(this._restfulClient);
|
|
387
388
|
}
|
|
388
389
|
}
|
package/lib/imports.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type { Whiteboard as FcrWhiteboard, WhiteboardToolType as FcrWhiteboardTo
|
|
|
16
16
|
export { WhiteboardPermissionFlag as FcrWhiteboardPermissionFlag } from '@netless/forge-whiteboard';
|
|
17
17
|
export type { JoinRoomOptions as FcrJoinRoomOptions } from '@netless/forge-room';
|
|
18
18
|
export { getLogger, createLogger } from 'agora-foundation/lib/logger';
|
|
19
|
+
export type { Logger } from 'agora-foundation/lib/logger';
|
|
19
20
|
export { serializeArgs } from 'agora-foundation/lib/decorator/log/log-serializer';
|
|
20
21
|
export { AgoraObservable } from 'agora-foundation/lib/utilities/observable';
|
|
21
22
|
export { retryAttempt } from 'agora-foundation/lib/utilities/async-retry';
|
|
@@ -28,6 +29,7 @@ export { z, ZodError, anySchema, booleanSchema, numberSchema, stringSchema, fcrR
|
|
|
28
29
|
export { validateParams } from 'agora-foundation/lib/decorator/validate';
|
|
29
30
|
export { Mutex } from 'agora-foundation/lib/worker/mutex';
|
|
30
31
|
export type { AgoraRtcNetworkStats, AgoraRtcDeviceInfo, AgoraRtcDisplayInfo, AgoraRtcWindowInfo, AgoraRtePerformanceInfo, AgoraRteScenePropertiesDeletedEvent, AgoraRteStreamEncryptionConfig, AgoraRteStreamJoinConfig, AgoraRteDualVideoStreamConfig, AgoraRteMessage, AgoraRteScenePropertiesUpdatedEvent, AgoraRteRenderView, AgoraRteScene, } from 'agora-rte-sdk';
|
|
32
|
+
export type { AgoraRtmClient } from 'agora-rte-sdk/lib/core/rtm/client';
|
|
31
33
|
export type { AgoraRteEngineObserver } from 'agora-rte-sdk/lib/type';
|
|
32
34
|
export type { AgoraRteNetworkQualityEvent } from 'agora-rte-sdk/lib/core/scene/type';
|
|
33
35
|
export type { AgoraRteOperatCause } from 'agora-rte-sdk/lib/core/processor/type';
|
|
@@ -55,9 +57,12 @@ export { registerPlugin } from 'agora-rte-sdk/lib/core/engine/plugin';
|
|
|
55
57
|
export { AgoraRteUserUpdatedReason } from 'agora-rte-sdk/lib/core/scene/type';
|
|
56
58
|
export type { AgoraRteUploadEvent } from 'agora-rte-sdk/lib/core/monitor/type';
|
|
57
59
|
export { FcrCoreEngine } from './engine';
|
|
58
|
-
export { FcrWhiteboardControlFactoryImpl } from './room-control/whiteboard-control-v2/whiteboard-control';
|
|
59
|
-
export { FcrAnnotationControlFactoryImpl } from './room-control/whiteboard-control-v2/annotation-control';
|
|
60
|
+
export { FcrWhiteboardControlFactoryImpl } from './room-control/whiteboard-control-v2/whiteboard-control/factory';
|
|
61
|
+
export { FcrAnnotationControlFactoryImpl } from './room-control/whiteboard-control-v2/annotation-control/factory';
|
|
62
|
+
export { deCompressGzipToJson } from './room-control/stt-control/de-compress-gzip';
|
|
60
63
|
export type FcrImageData = ImageData;
|
|
61
64
|
export type FcrWhiteboardView = HTMLElement;
|
|
62
65
|
export { getVersion } from './utilities/package-info';
|
|
63
66
|
export declare const localStorage: Storage;
|
|
67
|
+
export { v4 } from 'uuid';
|
|
68
|
+
export { default as merge } from 'lodash/merge';
|
package/lib/imports.js
CHANGED
|
@@ -226,7 +226,7 @@ Object.defineProperty(exports, "EasemobChatSDK", {
|
|
|
226
226
|
Object.defineProperty(exports, "FcrAnnotationControlFactoryImpl", {
|
|
227
227
|
enumerable: true,
|
|
228
228
|
get: function () {
|
|
229
|
-
return
|
|
229
|
+
return _factory2.FcrAnnotationControlFactoryImpl;
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
Object.defineProperty(exports, "FcrApplicationPlatform", {
|
|
@@ -274,7 +274,7 @@ Object.defineProperty(exports, "FcrWhiteboardApplication", {
|
|
|
274
274
|
Object.defineProperty(exports, "FcrWhiteboardControlFactoryImpl", {
|
|
275
275
|
enumerable: true,
|
|
276
276
|
get: function () {
|
|
277
|
-
return
|
|
277
|
+
return _factory.FcrWhiteboardControlFactoryImpl;
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
Object.defineProperty(exports, "FcrWhiteboardPermissionFlag", {
|
|
@@ -343,6 +343,12 @@ Object.defineProperty(exports, "createUnionSchema", {
|
|
|
343
343
|
return _schema.createUnionSchema;
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
|
+
Object.defineProperty(exports, "deCompressGzipToJson", {
|
|
347
|
+
enumerable: true,
|
|
348
|
+
get: function () {
|
|
349
|
+
return _deCompressGzip.deCompressGzipToJson;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
346
352
|
Object.defineProperty(exports, "fcrRenderViewSchema", {
|
|
347
353
|
enumerable: true,
|
|
348
354
|
get: function () {
|
|
@@ -392,6 +398,12 @@ Object.defineProperty(exports, "md5", {
|
|
|
392
398
|
return _jsMd.md5;
|
|
393
399
|
}
|
|
394
400
|
});
|
|
401
|
+
Object.defineProperty(exports, "merge", {
|
|
402
|
+
enumerable: true,
|
|
403
|
+
get: function () {
|
|
404
|
+
return _merge.default;
|
|
405
|
+
}
|
|
406
|
+
});
|
|
395
407
|
Object.defineProperty(exports, "numberSchema", {
|
|
396
408
|
enumerable: true,
|
|
397
409
|
get: function () {
|
|
@@ -476,6 +488,12 @@ Object.defineProperty(exports, "unknownSchema", {
|
|
|
476
488
|
return _schema.unknownSchema;
|
|
477
489
|
}
|
|
478
490
|
});
|
|
491
|
+
Object.defineProperty(exports, "v4", {
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get: function () {
|
|
494
|
+
return _uuid.v4;
|
|
495
|
+
}
|
|
496
|
+
});
|
|
479
497
|
Object.defineProperty(exports, "validateParams", {
|
|
480
498
|
enumerable: true,
|
|
481
499
|
get: function () {
|
|
@@ -522,9 +540,12 @@ var _domainHolder = require("agora-rte-sdk/lib/core/services/domain-holder");
|
|
|
522
540
|
var _type5 = require("agora-rte-sdk/lib/core/media/type");
|
|
523
541
|
var _plugin = require("agora-rte-sdk/lib/core/engine/plugin");
|
|
524
542
|
var _engine = require("./engine");
|
|
525
|
-
var
|
|
526
|
-
var
|
|
543
|
+
var _factory = require("./room-control/whiteboard-control-v2/whiteboard-control/factory");
|
|
544
|
+
var _factory2 = require("./room-control/whiteboard-control-v2/annotation-control/factory");
|
|
545
|
+
var _deCompressGzip = require("./room-control/stt-control/de-compress-gzip");
|
|
527
546
|
var _packageInfo = require("./utilities/package-info");
|
|
547
|
+
var _uuid = require("uuid");
|
|
548
|
+
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
528
549
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
529
550
|
// Other utility exports
|
|
530
551
|
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { FcrCoreEngineConfig, FcrDualVideoStreamConfig, FcrDesktopMediaControl, FcrDesktopMediaObserver, FcrMobileMediaControl, FcrMobileMediaObserver, FcrMonitorControl, FcrMonitorObserver, FcrBaseRoomControl, FcrRoomObserver, FcrUserControl, FcrUserObserver, FcrStreamControl, FcrStreamObserver, FcrPrivilegeControl, FcrPermission, } from './type';
|
|
2
|
-
export { FcrStreamLatencyLevel, FcrPermissionAction, FcrPrivilegeUserRole, FcrUserRole, FcrStreamState, FcrRegion, FcrStreamType, FcrUserUpdatedReason, FcrRoomConnectorType, FcrVideoSourceType, FcrAudioSourceType, FcrMediaSourceState, FcrVideoRenderMode, FcrVideoStreamType, FcrCapability, FcrAiDenoiseLevel, FcrStreamPrivilegeOperation, FcrStreamPrivilegeVideoSourceType, FcrStreamPrivilegeAudioSourceType, FcrConnectionState, FcrCoreEngine, registerPlugin, } from './type';
|
|
1
|
+
export type { FcrCoreEngineConfig, FcrDualVideoStreamConfig, FcrDesktopMediaControl, FcrDesktopMediaObserver, FcrMobileMediaControl, FcrMobileMediaObserver, FcrMonitorControl, FcrMonitorObserver, FcrBaseRoomControl, FcrRoomObserver, FcrUserControl, FcrUserObserver, FcrStreamControl, FcrStreamObserver, FcrPrivilegeControl, FcrPermission, FcrBoardMainWindow, FcrBoardMainWindowObserver, FcrColor, } from './type';
|
|
2
|
+
export { FcrStreamLatencyLevel, FcrPermissionAction, FcrPrivilegeUserRole, FcrUserRole, FcrStreamState, FcrRegion, FcrStreamType, FcrUserUpdatedReason, FcrRoomConnectorType, FcrVideoSourceType, FcrAudioSourceType, FcrMediaSourceState, FcrVideoRenderMode, FcrVideoStreamType, FcrCapability, FcrAiDenoiseLevel, FcrStreamPrivilegeOperation, FcrStreamPrivilegeVideoSourceType, FcrStreamPrivilegeAudioSourceType, FcrConnectionState, FcrCoreEngine, registerPlugin, FcrBoardToolType, FcrBoardShape, } from './type';
|
|
3
3
|
export { FcrError } from './type';
|
package/lib/index.js
CHANGED
|
@@ -15,6 +15,18 @@ Object.defineProperty(exports, "FcrAudioSourceType", {
|
|
|
15
15
|
return _type.FcrAudioSourceType;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "FcrBoardShape", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _type.FcrBoardShape;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "FcrBoardToolType", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _type.FcrBoardToolType;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
Object.defineProperty(exports, "FcrCapability", {
|
|
19
31
|
enumerable: true,
|
|
20
32
|
get: function () {
|
|
@@ -121,22 +121,22 @@ class FcrDesktopMediaControlImpl {
|
|
|
121
121
|
return this._mediaControl.getDisplayList();
|
|
122
122
|
}
|
|
123
123
|
getCameraTrack(deviceId) {
|
|
124
|
-
const track = this._mediaControl.
|
|
124
|
+
const track = this._mediaControl.getCameraTrack(deviceId);
|
|
125
125
|
track.addObserver(this._cameraLogObserver);
|
|
126
126
|
return track;
|
|
127
127
|
}
|
|
128
128
|
getMicrophoneTrack(deviceId) {
|
|
129
|
-
const track = this._mediaControl.
|
|
129
|
+
const track = this._mediaControl.getMicrophoneTrack(deviceId);
|
|
130
130
|
track.addObserver(this._microphoneLogObserver);
|
|
131
131
|
return track;
|
|
132
132
|
}
|
|
133
133
|
getScreenTrack(sourceId) {
|
|
134
|
-
const track = this._mediaControl.
|
|
134
|
+
const track = this._mediaControl.getScreenTrack(sourceId);
|
|
135
135
|
track.addObserver(this._screenLogObserver);
|
|
136
136
|
return track;
|
|
137
137
|
}
|
|
138
138
|
getLoopbackTrack(sourceId) {
|
|
139
|
-
const track = this._mediaControl.
|
|
139
|
+
const track = this._mediaControl.getLoopbackTrack(sourceId);
|
|
140
140
|
track.addObserver(this._loopbackLogObserver);
|
|
141
141
|
return track;
|
|
142
142
|
}
|
|
@@ -53,12 +53,12 @@ class FcrMobileMediaControlImpl {
|
|
|
53
53
|
(0, _defineProperty2.default)(this, "_screenDeviceName", undefined);
|
|
54
54
|
(0, _defineProperty2.default)(this, "_loopbackDeviceName", undefined);
|
|
55
55
|
this._mediaControl = mediaControl;
|
|
56
|
-
this._mediaControl.
|
|
56
|
+
this._mediaControl.getCameraTrack(this._cameraDeviceName).addObserver({
|
|
57
57
|
onCameraStateUpdated: (deviceId, state) => {
|
|
58
58
|
this._observable.notifyObservers('onCameraStateUpdated', state);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
this._mediaControl.
|
|
61
|
+
this._mediaControl.getMicrophoneTrack(this._microphoneDeviceName).addObserver({
|
|
62
62
|
onMicrophoneStateUpdated: (deviceId, state) => {
|
|
63
63
|
this._observable.notifyObservers('onMicrophoneStateUpdated', state);
|
|
64
64
|
},
|
|
@@ -66,7 +66,7 @@ class FcrMobileMediaControlImpl {
|
|
|
66
66
|
this._observable.notifyObservers('onMicrophoneVolumeIndicationUpdated', volume);
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
this._mediaControl.
|
|
69
|
+
this._mediaControl.getScreenTrack(this._screenDeviceName).addObserver({
|
|
70
70
|
onScreenCaptureStateUpdated: (sourceId, state) => {
|
|
71
71
|
this._observable.notifyObservers('onScreenCaptureStateUpdated', state);
|
|
72
72
|
}
|
|
@@ -102,45 +102,45 @@ class FcrMobileMediaControlImpl {
|
|
|
102
102
|
getDeviceState(deviceType) {
|
|
103
103
|
switch (deviceType) {
|
|
104
104
|
case _type.FcrDeviceType.Camera:
|
|
105
|
-
return this._mediaControl.
|
|
105
|
+
return this._mediaControl.getCameraTrack(this._cameraDeviceName).getState();
|
|
106
106
|
case _type.FcrDeviceType.Microphone:
|
|
107
|
-
return this._mediaControl.
|
|
107
|
+
return this._mediaControl.getMicrophoneTrack(this._microphoneDeviceName).getState();
|
|
108
108
|
default:
|
|
109
109
|
return _type.FcrMediaSourceState.CLOSE;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
startCameraTest() {
|
|
113
|
-
this._mediaControl.
|
|
113
|
+
this._mediaControl.getCameraTrack(this._cameraDeviceName).startTest();
|
|
114
114
|
}
|
|
115
115
|
stopCameraTest() {
|
|
116
|
-
this._mediaControl.
|
|
116
|
+
this._mediaControl.getCameraTrack(this._cameraDeviceName).startTest();
|
|
117
117
|
}
|
|
118
118
|
startCameraPreview(view, config) {
|
|
119
|
-
this._mediaControl.
|
|
119
|
+
this._mediaControl.getCameraTrack(this._cameraDeviceName).startPreview(config, view);
|
|
120
120
|
}
|
|
121
121
|
stopCameraPreview(view) {
|
|
122
|
-
this._mediaControl.
|
|
122
|
+
this._mediaControl.getCameraTrack(this._cameraDeviceName).stopPreview(view);
|
|
123
123
|
}
|
|
124
124
|
stopCameraPreviewOnAllCanvas() {
|
|
125
125
|
throw new Error('Method not implemented.');
|
|
126
126
|
}
|
|
127
127
|
startScreenCapture(excludeWindowList) {
|
|
128
|
-
this._mediaControl.
|
|
128
|
+
this._mediaControl.getScreenTrack(this._screenDeviceName).start(_imports.AgoraRteScreenCaptureType.SCREEN, excludeWindowList);
|
|
129
129
|
}
|
|
130
130
|
stopScreenCapture() {
|
|
131
|
-
this._mediaControl.
|
|
131
|
+
this._mediaControl.getScreenTrack(this._screenDeviceName).stop();
|
|
132
132
|
}
|
|
133
133
|
getScreenCaptureState() {
|
|
134
|
-
return this._mediaControl.
|
|
134
|
+
return this._mediaControl.getScreenTrack(this._screenDeviceName).getState();
|
|
135
135
|
}
|
|
136
136
|
startLoopbackRecording() {
|
|
137
|
-
this._mediaControl.
|
|
137
|
+
this._mediaControl.getLoopbackTrack(this._loopbackDeviceName).start();
|
|
138
138
|
}
|
|
139
139
|
stopLoopbackRecording() {
|
|
140
|
-
this._mediaControl.
|
|
140
|
+
this._mediaControl.getLoopbackTrack(this._loopbackDeviceName).stop();
|
|
141
141
|
}
|
|
142
142
|
getLoopbackRecordingState() {
|
|
143
|
-
return this._mediaControl.
|
|
143
|
+
return this._mediaControl.getLoopbackTrack(this._loopbackDeviceName).getState();
|
|
144
144
|
}
|
|
145
145
|
enableSpeaker(enable) {
|
|
146
146
|
this._mediaControl.setEnableSpeaker(enable);
|
|
@@ -177,17 +177,17 @@ class FcrMobileMediaControlImpl {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
switchCamera() {
|
|
180
|
-
this._mediaControl.
|
|
181
|
-
return this._mediaControl.
|
|
180
|
+
this._mediaControl.getCameraTrack(this._cameraDeviceName).switchPosition();
|
|
181
|
+
return this._mediaControl.getCameraTrack(this._cameraDeviceName).getPosition();
|
|
182
182
|
}
|
|
183
183
|
getCameraPosition() {
|
|
184
|
-
return this._mediaControl.
|
|
184
|
+
return this._mediaControl.getCameraTrack(this._cameraDeviceName).getPosition();
|
|
185
185
|
}
|
|
186
186
|
getCameraTrack(deviceId) {
|
|
187
|
-
return this._mediaControl.
|
|
187
|
+
return this._mediaControl.getCameraTrack(deviceId);
|
|
188
188
|
}
|
|
189
189
|
getMicrophoneTrack(deviceId) {
|
|
190
|
-
return this._mediaControl.
|
|
190
|
+
return this._mediaControl.getMicrophoneTrack(deviceId);
|
|
191
191
|
}
|
|
192
192
|
isCapabilitySupported(capability) {
|
|
193
193
|
return this._mediaControl.isCapabilitySupported(capability);
|
|
@@ -163,6 +163,14 @@ export interface FcrAudioEffectEnhancer {
|
|
|
163
163
|
* Disables original sound mode for the audio track.
|
|
164
164
|
*/
|
|
165
165
|
disableOriginalSoundMode(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Enables AGC for the audio track.
|
|
168
|
+
*/
|
|
169
|
+
enableAGC(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Disables AGC for the audio track.
|
|
172
|
+
*/
|
|
173
|
+
disableAGC(): void;
|
|
166
174
|
}
|
|
167
175
|
export interface FcrVideoEffectEnhancer {
|
|
168
176
|
/**
|
package/lib/plugins/chatroom.js
CHANGED
|
@@ -62,14 +62,21 @@ class FcrChatRoomControlImpl {
|
|
|
62
62
|
return this._chatConnection.getConnectionInstance();
|
|
63
63
|
}
|
|
64
64
|
get chatRoomId() {
|
|
65
|
+
if (!this._joinSceneSuccess) {
|
|
66
|
+
return '';
|
|
67
|
+
}
|
|
65
68
|
return this._scene.getScenePropertiesByKeyPath('widgets.easemobIM.extra.chatRoomId');
|
|
66
69
|
}
|
|
67
|
-
constructor(_scene, _chatConnection,
|
|
70
|
+
constructor(_scene, _chatConnection, sharedCache, joinSceneSuccess) {
|
|
68
71
|
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
69
72
|
prefix: 'FcrChatRoomControlImpl'
|
|
70
73
|
})));
|
|
71
74
|
(0, _defineProperty2.default)(this, "_observable", new _observable.AgoraObservable());
|
|
72
75
|
(0, _defineProperty2.default)(this, "_connectionState", _type.FcrChatRoomConnectionState.Disconnected);
|
|
76
|
+
(0, _defineProperty2.default)(this, "_sceneObserver", {
|
|
77
|
+
onJoinSceneSuccess: () => this._handleJoinSceneSuccess(),
|
|
78
|
+
onJoinSceneFailure: () => this._handleJoinSceneFailure()
|
|
79
|
+
});
|
|
73
80
|
(0, _defineProperty2.default)(this, "_chatConnectionObserver", {
|
|
74
81
|
onConnectionStateUpdated: async state => {
|
|
75
82
|
// im reconnect
|
|
@@ -254,10 +261,17 @@ class FcrChatRoomControlImpl {
|
|
|
254
261
|
}
|
|
255
262
|
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM_CHATROOM, _error.FcrErrorCode.UNDEFINED_ERROR, 'unknown local message type', new Error('unknown local message type'));
|
|
256
263
|
});
|
|
264
|
+
(0, _defineProperty2.default)(this, "_handleJoinSceneSuccess", () => {
|
|
265
|
+
this._joinSceneSuccess = true;
|
|
266
|
+
this._joinChatRoom(this._chatConnection.getConnectionState());
|
|
267
|
+
});
|
|
268
|
+
(0, _defineProperty2.default)(this, "_handleJoinSceneFailure", () => {
|
|
269
|
+
this._joinSceneSuccess = false;
|
|
270
|
+
});
|
|
257
271
|
this._scene = _scene;
|
|
258
272
|
this._chatConnection = _chatConnection;
|
|
259
|
-
this.
|
|
260
|
-
this.
|
|
273
|
+
this._roomCache = sharedCache.getRoomCache(_scene.sceneId);
|
|
274
|
+
this._joinSceneSuccess = joinSceneSuccess;
|
|
261
275
|
this._addLogObserver();
|
|
262
276
|
this._chatConnection.addObserver(this._chatConnectionObserver);
|
|
263
277
|
if (this._chatConnection.getConnectionInstance()) {
|
|
@@ -293,10 +307,12 @@ class FcrChatRoomControlImpl {
|
|
|
293
307
|
});
|
|
294
308
|
}
|
|
295
309
|
_removeEventListener() {
|
|
310
|
+
this._scene.removeObserver(this._sceneObserver);
|
|
296
311
|
this.conn.removeEventHandler("chatroom".concat(this._scene.sceneId));
|
|
297
312
|
}
|
|
298
313
|
_addEventListener() {
|
|
299
314
|
this._removeEventListener();
|
|
315
|
+
this._scene.addObserver(this._sceneObserver);
|
|
300
316
|
this.conn.addEventHandler("chatroom".concat(this._scene.sceneId), {
|
|
301
317
|
onTextMessage: msg => {
|
|
302
318
|
if (msg.to !== this.chatRoomId) {
|
|
@@ -4,7 +4,10 @@ export declare enum FcrAbility {
|
|
|
4
4
|
RoomDetail = "room:detail",
|
|
5
5
|
Live = "live",
|
|
6
6
|
Interpreter = "interpreter",
|
|
7
|
-
Annotation = "annotation"
|
|
7
|
+
Annotation = "annotation",
|
|
8
|
+
Caption = "caption",
|
|
9
|
+
Transcribe = "transcribe",
|
|
10
|
+
Recording = "recording"
|
|
8
11
|
}
|
|
9
12
|
export interface FcrAbilityControl {
|
|
10
13
|
isAbilitySupported(ability: FcrAbility): boolean;
|
|
@@ -10,5 +10,8 @@ let FcrAbility = exports.FcrAbility = /*#__PURE__*/function (FcrAbility) {
|
|
|
10
10
|
FcrAbility["Live"] = "live";
|
|
11
11
|
FcrAbility["Interpreter"] = "interpreter";
|
|
12
12
|
FcrAbility["Annotation"] = "annotation";
|
|
13
|
+
FcrAbility["Caption"] = "caption";
|
|
14
|
+
FcrAbility["Transcribe"] = "transcribe";
|
|
15
|
+
FcrAbility["Recording"] = "recording";
|
|
13
16
|
return FcrAbility;
|
|
14
17
|
}({});
|
|
@@ -44,6 +44,10 @@ export declare const ROOM_MESSAGE_COMMANDS: {
|
|
|
44
44
|
readonly LIVE_STREAMING_UPDATE: 700;
|
|
45
45
|
/** 用户被踢出命令 */
|
|
46
46
|
readonly USER_KICK_OUT: 5;
|
|
47
|
+
/** 房间会话请求命令 */
|
|
48
|
+
readonly ROOM_SESSION_REQUEST: 1001;
|
|
49
|
+
/** 房间会话接受命令 */
|
|
50
|
+
readonly ROOM_SESSION_ACCEPT: 1002;
|
|
47
51
|
};
|
|
48
52
|
/**
|
|
49
53
|
* 录制状态值
|
|
@@ -52,7 +52,11 @@ const ROOM_MESSAGE_COMMANDS = exports.ROOM_MESSAGE_COMMANDS = {
|
|
|
52
52
|
/** 直播状态更新命令 */
|
|
53
53
|
LIVE_STREAMING_UPDATE: 700,
|
|
54
54
|
/** 用户被踢出命令 */
|
|
55
|
-
USER_KICK_OUT: 5
|
|
55
|
+
USER_KICK_OUT: 5,
|
|
56
|
+
/** 房间会话请求命令 */
|
|
57
|
+
ROOM_SESSION_REQUEST: 1001,
|
|
58
|
+
/** 房间会话接受命令 */
|
|
59
|
+
ROOM_SESSION_ACCEPT: 1002
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
/**
|
|
@@ -45,6 +45,7 @@ var _logger = require("../utilities/logger");
|
|
|
45
45
|
var _2 = require("..");
|
|
46
46
|
var _helpers = require("./helpers");
|
|
47
47
|
var _errorHelpers = require("../utilities/error-helpers");
|
|
48
|
+
var _sttControl = require("./stt-control");
|
|
48
49
|
var _FcrBaseRoomControlImpl;
|
|
49
50
|
let _initProto; // Core SDK imports
|
|
50
51
|
// Service and API imports
|
|
@@ -117,6 +118,7 @@ class FcrBaseRoomControlImpl {
|
|
|
117
118
|
this.logger.info('[whiteboard]: join scene success, start create sharing control');
|
|
118
119
|
this.sharingControl = new _sharingControl.FcrSharingControlImpl(this._scene, this._api, this._engine, this._privilegeControl, this._streamControl, this._sharedCache, this._userControl);
|
|
119
120
|
}
|
|
121
|
+
this._sttControl = new _sttControl.FcrSttControlImpl(this._scene, this._api, this._sharedCache);
|
|
120
122
|
this._observable.notifyObservers('onJoinRoomSuccess', sceneId);
|
|
121
123
|
},
|
|
122
124
|
// onJoinSceneFailure: (sceneId, error) => {
|
|
@@ -220,6 +222,17 @@ class FcrBaseRoomControlImpl {
|
|
|
220
222
|
}
|
|
221
223
|
};
|
|
222
224
|
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* 获取字幕控制器
|
|
228
|
+
* @returns 字幕控制器实例
|
|
229
|
+
* @throws {FcrError} 如果控制器未初始化
|
|
230
|
+
*/
|
|
231
|
+
// @trace
|
|
232
|
+
getSttControl() {
|
|
233
|
+
(0, _helpers.validateControllerInitialized)(this._sttControl, _errorHelpers.ControllerType.STT);
|
|
234
|
+
return this._sttControl;
|
|
235
|
+
}
|
|
223
236
|
/**
|
|
224
237
|
* 获取屏幕共享控制器
|
|
225
238
|
* @returns 屏幕共享控制器实例
|
|
@@ -427,7 +440,7 @@ class FcrBaseRoomControlImpl {
|
|
|
427
440
|
* @private
|
|
428
441
|
*/
|
|
429
442
|
_handleJoinFailure(error) {
|
|
430
|
-
this.logger.error("
|
|
443
|
+
this.logger.error("failed to join room: ".concat(error.message));
|
|
431
444
|
this._observable.notifyObservers('onJoinRoomFailure', this._scene.sceneId, error);
|
|
432
445
|
}
|
|
433
446
|
|
|
@@ -567,11 +580,9 @@ class FcrBaseRoomControlImpl {
|
|
|
567
580
|
this._scene.removeObserver(this._sceneObserver);
|
|
568
581
|
this._engine.removeObserver(this._engineObserver);
|
|
569
582
|
try {
|
|
570
|
-
var _this$_chatRoomContro2;
|
|
583
|
+
var _this$_chatRoomContro2, _this$sharingControl, _this$sharingControl2;
|
|
571
584
|
return await Promise.all([// @ts-ignore
|
|
572
|
-
(_this$_chatRoomContro2 = this._chatRoomControl) === null || _this$_chatRoomContro2 === void 0 ? void 0 : _this$_chatRoomContro2.leave(),
|
|
573
|
-
// this._whiteboardControl?.close(),
|
|
574
|
-
this._scene.leave()]);
|
|
585
|
+
(_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()]);
|
|
575
586
|
} finally {
|
|
576
587
|
this._joinRoomSuccess = false;
|
|
577
588
|
}
|
|
@@ -64,6 +64,7 @@ class FcrInterpreterControlImpl {
|
|
|
64
64
|
this._roomCache = _sharedCache.getRoomCache(this._scene.sceneId);
|
|
65
65
|
this._roomId = this._scene.sceneId;
|
|
66
66
|
this._addInterpreterObservers();
|
|
67
|
+
this._addLogObserver();
|
|
67
68
|
}
|
|
68
69
|
createRoomControl(roomId) {
|
|
69
70
|
return new _room.FcrInterpreterRoomControlImpl(this._engine, this._engine.createScene({
|
|
@@ -179,10 +180,7 @@ class FcrInterpreterControlImpl {
|
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
182
|
_addLogObserver() {
|
|
182
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['
|
|
183
|
-
// 'onNetworkQualityUpdated',
|
|
184
|
-
// 'onNetworkStatsUpdated',
|
|
185
|
-
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated', 'onInterpreterStateUpdated', 'onInterpreterUsersUpdated', 'onInterpreterRoomListUpdated']));
|
|
183
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onInterpreterStateUpdated', 'onInterpreterUsersUpdated', 'onInterpreterRoomListUpdated']));
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
186
|
exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
@@ -25,6 +25,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
25
25
|
});
|
|
26
26
|
exports.FcrMainRoomControlImpl = void 0;
|
|
27
27
|
require("core-js/modules/es.json.stringify.js");
|
|
28
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
29
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
28
30
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
29
31
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
30
32
|
var _imports = require("../../imports");
|
|
@@ -38,6 +40,8 @@ var _schema = require("../../schema");
|
|
|
38
40
|
var _logger = require("../../utilities/logger");
|
|
39
41
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
40
42
|
var _sharedStorage = require("../../utilities/shared-storage");
|
|
43
|
+
var _utils = require("../whiteboard-control-v2/utils");
|
|
44
|
+
var _utils2 = require("../whiteboard-control/utils");
|
|
41
45
|
var _FcrMainRoomControlImpl;
|
|
42
46
|
let _initProto, _enableWaitingRoomDecs, _moveToWaitingRoomByUserIdsDecs, _ref;
|
|
43
47
|
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)]; } }; }
|
|
@@ -60,6 +64,10 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
60
64
|
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
61
65
|
prefix: 'FcrMainRoomControlImpl'
|
|
62
66
|
})));
|
|
67
|
+
(0, _defineProperty2.default)(this, "_privilegeObserver", {
|
|
68
|
+
onLocalUserPermissionInfoAdded: this._onLocalUserPermissionInfoAdded,
|
|
69
|
+
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
70
|
+
});
|
|
63
71
|
this._groupControl = new _groupControl.FcrGroupControl(engine, scene, api, sharedCache);
|
|
64
72
|
this._interpreterControl = new _interpreterControl.FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
65
73
|
this._addLogObserver();
|
|
@@ -99,6 +107,8 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
99
107
|
(0, _sharedStorage.clearAnnotationBoardOptions)();
|
|
100
108
|
(0, _sharedStorage.clearWhiteboardOptions)();
|
|
101
109
|
await super.join(options);
|
|
110
|
+
const privilegeControl = this.getPrivilegeControl();
|
|
111
|
+
privilegeControl.addObserver(this._privilegeObserver);
|
|
102
112
|
const task = sharedScheduler.addIntervalTask(() => {
|
|
103
113
|
this._engine.getMonitor().uploadLog({
|
|
104
114
|
userUuid: this._config.userId,
|
|
@@ -115,6 +125,8 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
115
125
|
}
|
|
116
126
|
async leave() {
|
|
117
127
|
try {
|
|
128
|
+
const privilegeControl = this.getPrivilegeControl();
|
|
129
|
+
privilegeControl.removeObserver(this._privilegeObserver);
|
|
118
130
|
return await super.leave();
|
|
119
131
|
} finally {
|
|
120
132
|
var _this$_logUploadTask;
|
|
@@ -185,6 +197,59 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
185
197
|
userId
|
|
186
198
|
}), _error.FcrErrorModuleCode.ROOM_WHITEBOARD, 'get whiteboard token failed');
|
|
187
199
|
}
|
|
200
|
+
_onLocalUserPermissionInfoAdded(roomId, event) {
|
|
201
|
+
if ((0, _utils2.hasBoardWritePermission)(event.permissionInfo)) {
|
|
202
|
+
this.logger.info("add board write permission");
|
|
203
|
+
this.getSharingControl().getBoardControl().setOperationPrivilege(true);
|
|
204
|
+
}
|
|
205
|
+
if ((0, _utils2.hasAnnotationWritePermission)(event.permissionInfo)) {
|
|
206
|
+
this.logger.info("add annotation write permission");
|
|
207
|
+
this.getSharingControl().getAnnotationControl().setOperationPrivilege(true);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
_onLocalUserPermissionInfoDeleted(roomId, event) {
|
|
211
|
+
if ((0, _utils2.hasBoardWritePermission)(event.permissionInfo)) {
|
|
212
|
+
this.logger.info("remove board write permission");
|
|
213
|
+
this.getSharingControl().getBoardControl().setOperationPrivilege(false);
|
|
214
|
+
}
|
|
215
|
+
if ((0, _utils2.hasAnnotationWritePermission)(event.permissionInfo)) {
|
|
216
|
+
this.logger.info("remove annotation write permission");
|
|
217
|
+
this.getSharingControl().getAnnotationControl().setOperationPrivilege(false);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
_checkIfUpdateAnnotationMainWindow() {
|
|
221
|
+
const streamControl = this.getStreamControl();
|
|
222
|
+
const userControl = this.getUserControl();
|
|
223
|
+
const mainWindow = this.getSharingControl().getAnnotationControl().getMainWindow();
|
|
224
|
+
const annotationConfig = (0, _utils.getAnnotationConfigFromRoomProperties)(this._scene.getSceneProperties(), this.logger);
|
|
225
|
+
if (mainWindow) {
|
|
226
|
+
const stream = streamControl.getStreamList().find(stream => stream.videoSourceType === _type.FcrVideoSourceType.SCREEN);
|
|
227
|
+
const localUserId = userControl.getLocalUser().userId;
|
|
228
|
+
if (stream) {
|
|
229
|
+
var _userControl$getUser;
|
|
230
|
+
const ownerId = stream.owner.userId;
|
|
231
|
+
const isNotMeSharing = ownerId !== localUserId;
|
|
232
|
+
const platform = (_userControl$getUser = userControl.getUser(ownerId)) === null || _userControl$getUser === void 0 ? void 0 : _userControl$getUser.platform;
|
|
233
|
+
const isPcPlatform = platform && [_type.FcrPlatform.WEB_DESKTOP, _type.FcrPlatform.WINDOWS, _type.FcrPlatform.MACOS].includes(platform);
|
|
234
|
+
const isAndroidPlatform = platform && platform === _type.FcrPlatform.ANDROID;
|
|
235
|
+
this.logger.info("check if set auto cancel draw, isPcPlatform: ".concat(isPcPlatform, ", isAndroidPlatform: ").concat(isAndroidPlatform, ", isNotMeSharing: ").concat(isNotMeSharing, ", ownerId: ").concat(ownerId, ", localUserId: ").concat(localUserId, ", platform: ").concat(platform));
|
|
236
|
+
if (isPcPlatform) {
|
|
237
|
+
mainWindow.setAutoCancelDraw(false);
|
|
238
|
+
}
|
|
239
|
+
if (isAndroidPlatform) {
|
|
240
|
+
mainWindow.setAutoCancelDraw(isNotMeSharing);
|
|
241
|
+
}
|
|
242
|
+
if (!isNotMeSharing) {
|
|
243
|
+
mainWindow.clean();
|
|
244
|
+
mainWindow.updateWindowSize({
|
|
245
|
+
width: annotationConfig.size.width,
|
|
246
|
+
height: annotationConfig.size.height
|
|
247
|
+
});
|
|
248
|
+
this._api.syncScreenShareOwnerAnnotationOpenDone(this._scene.sceneId);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
188
253
|
_addLogObserver() {
|
|
189
254
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onCloudRecordingStateUpdated', 'onJoinRoomFailure', 'onJoinRoomSuccess', 'onLiveStreamingStateUpdated',
|
|
190
255
|
// 'onNetworkQualityUpdated',
|
|
@@ -194,4 +259,4 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
194
259
|
}
|
|
195
260
|
exports.FcrMainRoomControlImpl = FcrMainRoomControlImpl;
|
|
196
261
|
_FcrMainRoomControlImpl = FcrMainRoomControlImpl;
|
|
197
|
-
[_initProto] = _applyDecs(_FcrMainRoomControlImpl, [[_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_enableWaitingRoomDecs, 2, "enableWaitingRoom"], [_moveToWaitingRoomByUserIdsDecs, 2, "moveToWaitingRoomByUserIds"], [_imports.trace, 2, "moveToWaitingRoomByUserRoles"], [_imports.bound, 2, "
|
|
262
|
+
[_initProto] = _applyDecs(_FcrMainRoomControlImpl, [[_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_enableWaitingRoomDecs, 2, "enableWaitingRoom"], [_moveToWaitingRoomByUserIdsDecs, 2, "moveToWaitingRoomByUserIds"], [_imports.trace, 2, "moveToWaitingRoomByUserRoles"], [_imports.bound, 2, "_onLocalUserPermissionInfoAdded"], [_imports.bound, 2, "_onLocalUserPermissionInfoDeleted"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
|