fcr-core 3.6.0 → 3.6.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.
Files changed (38) hide show
  1. package/lib/engine/index.js +1 -1
  2. package/lib/room-control/ability-control/index.js +1 -1
  3. package/lib/room-control/index.js +12 -8
  4. package/lib/room-control/interpreter-control/index.js +13 -3
  5. package/lib/room-control/mainroom-control/index.js +17 -2
  6. package/lib/room-control/privilege-control/index.js +32 -4
  7. package/lib/room-control/privilege-control/type.d.ts +13 -3
  8. package/lib/room-control/privilege-control/type.js +3 -0
  9. package/lib/room-control/sharing-control/index.d.ts +44 -0
  10. package/lib/room-control/sharing-control/index.js +217 -0
  11. package/lib/room-control/sharing-control/type.d.ts +31 -0
  12. package/lib/room-control/sharing-control/type.js +17 -0
  13. package/lib/room-control/stream-control/index.js +80 -11
  14. package/lib/room-control/stream-control/type.d.ts +3 -2
  15. package/lib/room-control/type.d.ts +5 -5
  16. package/lib/room-control/whiteboard-control/board-window.d.ts +4 -3
  17. package/lib/room-control/whiteboard-control/board-window.js +4 -1
  18. package/lib/room-control/whiteboard-control/types.d.ts +39 -72
  19. package/lib/room-control/whiteboard-control-v2/annotation-control/index.d.ts +33 -0
  20. package/lib/room-control/whiteboard-control-v2/annotation-control/index.js +187 -0
  21. package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +32 -0
  22. package/lib/room-control/whiteboard-control-v2/annotation-control/type.js +5 -0
  23. package/lib/room-control/whiteboard-control-v2/index.d.ts +2 -1
  24. package/lib/room-control/whiteboard-control-v2/index.js +19 -1
  25. package/lib/room-control/whiteboard-control-v2/main-window.d.ts +7 -4
  26. package/lib/room-control/whiteboard-control-v2/main-window.js +20 -3
  27. package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.d.ts +38 -0
  28. package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +261 -0
  29. package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +42 -0
  30. package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.js +5 -0
  31. package/lib/schema.d.ts +21 -0
  32. package/lib/schema.js +9 -1
  33. package/lib/service/api.d.ts +64 -3
  34. package/lib/service/api.js +88 -3
  35. package/lib/type.d.ts +7 -0
  36. package/lib/utilities/package-info.d.ts +2 -0
  37. package/lib/utilities/package-info.js +6 -2
  38. package/package.json +7 -7
@@ -0,0 +1,31 @@
1
+ import { FcrUserInfo } from '../../type';
2
+ import { FcrScreenStreamCreateConfig, FcrSize } from '../stream-control/type';
3
+ import { FcrAnnotationControl } from '../whiteboard-control-v2/annotation-control/type';
4
+ import { FcrWhiteboardControl } from '../whiteboard-control-v2/whiteboard-control/type';
5
+ import { FcrBoardInactiveReason } from '../whiteboard-control/types';
6
+ export interface FcrSharingControl {
7
+ startScreenSharing(config: FcrScreenStreamCreateConfig, size?: FcrSize): Promise<string>;
8
+ startWhiteboard(): Promise<void>;
9
+ updateScreenSharing(enableAnnotation: boolean): Promise<void>;
10
+ stop(): Promise<void>;
11
+ getScreenSharingState(): FcrScreenSharingState;
12
+ getWhiteboardState(): FcrWhiteboardState;
13
+ getAnnotationControl(): FcrAnnotationControl | undefined;
14
+ getBoardControl(): FcrWhiteboardControl;
15
+ addObserver(observer: FcrSharingObserver): void;
16
+ removeObserver(observer: FcrSharingObserver): void;
17
+ }
18
+ export interface FcrSharingObserver {
19
+ onScreenSharingUpdated?: (ownerId: string, state: FcrScreenSharingState) => void;
20
+ onWhiteboardStarted?: (ownerId: string, operatorUser: FcrUserInfo) => void;
21
+ onWhiteboardEnded?: (reason: FcrBoardInactiveReason, operatorUser?: FcrUserInfo) => void;
22
+ }
23
+ export declare enum FcrScreenSharingState {
24
+ END = 0,
25
+ START_ONLY_SCREEN = 1,
26
+ START_WHIT_ANNOTATION = 2
27
+ }
28
+ export declare enum FcrWhiteboardState {
29
+ END = 0,
30
+ START = 1
31
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FcrWhiteboardState = exports.FcrScreenSharingState = void 0;
7
+ let FcrScreenSharingState = exports.FcrScreenSharingState = /*#__PURE__*/function (FcrScreenSharingState) {
8
+ FcrScreenSharingState[FcrScreenSharingState["END"] = 0] = "END";
9
+ FcrScreenSharingState[FcrScreenSharingState["START_ONLY_SCREEN"] = 1] = "START_ONLY_SCREEN";
10
+ FcrScreenSharingState[FcrScreenSharingState["START_WHIT_ANNOTATION"] = 2] = "START_WHIT_ANNOTATION";
11
+ return FcrScreenSharingState;
12
+ }({});
13
+ let FcrWhiteboardState = exports.FcrWhiteboardState = /*#__PURE__*/function (FcrWhiteboardState) {
14
+ FcrWhiteboardState[FcrWhiteboardState["END"] = 0] = "END";
15
+ FcrWhiteboardState[FcrWhiteboardState["START"] = 1] = "START";
16
+ return FcrWhiteboardState;
17
+ }({});
@@ -12,10 +12,12 @@ Object.defineProperty(exports, "__esModule", {
12
12
  });
13
13
  exports.FcrStreamControlImpl = void 0;
14
14
  require("core-js/modules/es.array.push.js");
15
+ require("core-js/modules/esnext.async-iterator.find.js");
15
16
  require("core-js/modules/esnext.async-iterator.for-each.js");
16
17
  require("core-js/modules/esnext.async-iterator.map.js");
17
18
  require("core-js/modules/esnext.async-iterator.some.js");
18
19
  require("core-js/modules/esnext.iterator.constructor.js");
20
+ require("core-js/modules/esnext.iterator.find.js");
19
21
  require("core-js/modules/esnext.iterator.for-each.js");
20
22
  require("core-js/modules/esnext.iterator.map.js");
21
23
  require("core-js/modules/esnext.iterator.some.js");
@@ -43,6 +45,7 @@ var _error = require("../../utilities/error");
43
45
  var _logger = require("../../utilities/logger");
44
46
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
45
47
  var _schema = require("../../schema");
48
+ var _type2 = require("agora-rte-sdk/lib/core/scene/type");
46
49
  var _FcrStreamControlImpl;
47
50
  let _initProto, _addLocalStreamsDecs, _bindLocalStreamsDecs, _updatePublishPrivilegeOfStreamsDecs, _removeStreamsDecs, _setVideoEncoderConfigDecs, _startRenderRemoteVideoStreamDecs, _stopRenderRemoteVideoStreamDecs, _startPlayRemoteAudioStreamDecs, _stopPlayRemoteAudioStreamDecs, _takeSnapshotDecs, _addLocalScreenStreamDecs, _adjustRemoteAudioStreamVolumeDecs, _mergeAudioStreamDecs, _splitAudioStreamDecs, _ref;
48
51
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -52,10 +55,10 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
52
55
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
53
56
  function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
54
57
  function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
55
- _ref = (_addLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrLocalStreamCreateArrayConfigSchema)], _bindLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrStreamBindConfigArrySchema)], _updatePublishPrivilegeOfStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrUpdateStreamCustomSchema, _schema.fcrUpdateStreamPrivilegeScopeSchema.optional())], _removeStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _setVideoEncoderConfigDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.agoraRtcVideoEncoderConfigurationSchema, _schema.fcrVideoStreamTypeSchema)], _startRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrVideoStreamTypeSchema, _schema.fcrRenderConfigSchema, (0, _schema.createUnionSchema)([_schema.fcrRenderViewSchema, _imports.objectSchema]))], _stopRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRenderViewSchema)], _startPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _stopPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _takeSnapshotDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _addLocalScreenStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrScreenStreamCreateConfigSchema)], _adjustRemoteAudioStreamVolumeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.numberSchema)], _mergeAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _splitAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger");
56
58
  /**
57
59
  * @internal
58
60
  */
61
+ _ref = (_addLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrLocalStreamCreateArrayConfigSchema)], _bindLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrStreamBindConfigArrySchema)], _updatePublishPrivilegeOfStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrUpdateStreamCustomSchema, _schema.fcrUpdateStreamPrivilegeScopeSchema.optional())], _removeStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _setVideoEncoderConfigDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.agoraRtcVideoEncoderConfigurationSchema, _schema.fcrVideoStreamTypeSchema)], _startRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrVideoStreamTypeSchema, _schema.fcrRenderConfigSchema, (0, _schema.createUnionSchema)([_schema.fcrRenderViewSchema, _imports.objectSchema]))], _stopRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRenderViewSchema)], _startPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _stopPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _takeSnapshotDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _addLocalScreenStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrScreenStreamCreateConfigSchema, _schema.fcrSizeSchema)], _adjustRemoteAudioStreamVolumeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.numberSchema)], _mergeAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _splitAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger");
59
62
  class FcrStreamControlImpl {
60
63
  constructor(_engine, _scene, _api, _sharedCache) {
61
64
  //@internal
@@ -160,6 +163,9 @@ class FcrStreamControlImpl {
160
163
  connectorType: info.connectorType
161
164
  };
162
165
  });
166
+ (0, _defineProperty2.default)(this, "_getPublishStateByPrivilege", privilege => {
167
+ return privilege === _type2.AgoraRteStreamPrivilegeOperation.HAS_PRIVILEGE ? 1 : privilege === _type2.AgoraRteStreamPrivilegeOperation.NOPRIVILEGE ? 0 : undefined;
168
+ });
163
169
  (0, _defineProperty2.default)(this, "_convertStreamEvent", event => {
164
170
  return {
165
171
  modifiedStream: this._convertStreamInfo(event.modifiedStream),
@@ -200,6 +206,7 @@ class FcrStreamControlImpl {
200
206
  this._sharedCache = _sharedCache;
201
207
  this._roomCache = _sharedCache.getRoomCache(this._scene.sceneId);
202
208
  const streamList = this._scene.getStreamList();
209
+ this._mediaControl = this._engine.getMediaControl();
203
210
  streamList.forEach(stream => {
204
211
  const user = stream.owner;
205
212
  const streamInfo = this._convertStreamInfo(stream);
@@ -231,28 +238,69 @@ class FcrStreamControlImpl {
231
238
  }
232
239
  }
233
240
  addLocalStreams(streams) {
234
- return (0, _error.handleRequestError)(() => this._scene.localUser.addLocalStreams(streams), _error.FcrErrorModuleCode.ROOM_STREAM, 'add local streams failed');
241
+ return (0, _error.handleRequestError)(() => this._api.upsertStreamBatch(this._scene.sceneId, streams.map(config => {
242
+ var _config$generateToken;
243
+ return _objectSpread({
244
+ streamName: config.streamName,
245
+ streamUuid: '0',
246
+ // means that this stream needs to be created
247
+ generateToken: (_config$generateToken = config.generateToken) !== null && _config$generateToken !== void 0 ? _config$generateToken : config.videoSourceType === _imports.AgoraRteVideoSourceType.SCREEN,
248
+ userUuid: config.ownerId,
249
+ videoSourceType: config.videoSourceType,
250
+ audioSourceType: config.audioSourceType,
251
+ videoSourceUuid: config.videoSourceId,
252
+ audioSourceUuid: config.audioSourceId
253
+ }, (0, _imports.convertStreamTypeToPublishState)(config.streamType));
254
+ })), _error.FcrErrorModuleCode.ROOM_STREAM, 'add local streams failed');
235
255
  }
236
256
  bindLocalStreams(streams) {
237
- return (0, _error.handleRequestError)(() => this._scene.localUser.bindLocalStreams(streams), _error.FcrErrorModuleCode.ROOM_STREAM, 'bind local streams failed');
257
+ return (0, _error.handleRequestError)(() => this._api.upsertStreamBatch(this._scene.sceneId, streams.map(config => ({
258
+ streamUuid: config.streamId,
259
+ videoSourceUuid: config.videoSourceId,
260
+ audioSourceUuid: config.audioSourceId
261
+ }))), _error.FcrErrorModuleCode.ROOM_STREAM, 'bind local streams failed');
238
262
  }
239
263
  updatePublishPrivilegeOfStreams() {
240
264
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
241
265
  args[_key] = arguments[_key];
242
266
  }
243
267
  if (args.length === 1) {
244
- return (0, _error.handleRequestError)(() => this._scene.localUser.updatePublishPrivilegeOfStreams(args[0]), _error.FcrErrorModuleCode.ROOM_STREAM, 'update publish privilege of streams failed');
268
+ const privileges = args[0];
269
+ return (0, _error.handleRequestError)(() => this._api.upsertStreamBatch(this._scene.sceneId, Object.keys(privileges).map(streamId => ({
270
+ streamUuid: streamId,
271
+ audioState: this._getPublishStateByPrivilege(privileges[streamId].audioPrivilege),
272
+ videoState: this._getPublishStateByPrivilege(privileges[streamId].videoPrivilege)
273
+ }))), _error.FcrErrorModuleCode.ROOM_STREAM, 'update publish privilege of streams failed');
245
274
  } else if (args.length === 2) {
246
275
  const [privilege, scope] = args;
247
276
  const targetRteRoles = scope.targetRoleType.map(role => _type.FcrUserRoleToStringMap[role]);
248
- return (0, _error.handleRequestError)(() => this._scene.localUser.updatePublishPrivilegeOfStreams(privilege, {
249
- targetRoleType: targetRteRoles,
250
- targetRoleTypeIsInclude: scope.targetRoleTypeIsInclude
277
+ const includeRoles = [];
278
+ const excludeRoles = [];
279
+ const condition = {
280
+ videoSourceType: scope.videoSourceType,
281
+ audioSourceType: scope.audioSourceType
282
+ };
283
+ if (scope.targetRoleTypeIsInclude) {
284
+ includeRoles.push(...targetRteRoles);
285
+ } else {
286
+ excludeRoles.push(...targetRteRoles);
287
+ }
288
+ const audioState = this._getPublishStateByPrivilege(privilege.audioPrivilege);
289
+ const videoState = this._getPublishStateByPrivilege(privilege.videoPrivilege);
290
+ return (0, _error.handleRequestError)(() => this._api.updateStreamBatchByCondition({
291
+ roomUuid: this._scene.sceneId,
292
+ includeRoles,
293
+ excludeRoles,
294
+ videoState,
295
+ audioState,
296
+ condition
251
297
  }), _error.FcrErrorModuleCode.ROOM_STREAM, 'update publish privilege of streams failed');
252
298
  }
253
299
  }
254
300
  removeStreams(streams) {
255
- return (0, _error.handleRequestError)(() => this._scene.localUser.removeStreams(streams), _error.FcrErrorModuleCode.ROOM_STREAM, 'remove streams failed');
301
+ return (0, _error.handleRequestError)(() => this._api.deleteStreamBatch(this._scene.sceneId, streams.map(streamUuid => ({
302
+ streamUuid
303
+ }))), _error.FcrErrorModuleCode.ROOM_STREAM, 'remove streams failed');
256
304
  }
257
305
  setVideoEncoderConfig(streamId, config, streamType) {
258
306
  return this._scene.localUser.setVideoEncoderConfig(config, streamType, streamId);
@@ -279,18 +327,30 @@ class FcrStreamControlImpl {
279
327
  takeSnapshot(streamId, filePath) {
280
328
  return this._scene.streamPlayer.takeSnapshot(streamId, filePath);
281
329
  }
282
- async addLocalScreenStream(config) {
330
+ async addLocalScreenStream(config, size) {
283
331
  const res = await (0, _error.handleRequestError)(() => this._api.startShareScreen({
284
332
  roomId: this._scene.sceneId,
285
333
  userId: this._scene.getLocalUser().getLocalUserId(),
286
- config: _objectSpread({
334
+ config: _objectSpread(_objectSpread({
287
335
  videoSourceType: _.FcrVideoSourceType.SCREEN,
288
336
  audioSourceType: _.FcrAudioSourceType.LOOPBACK,
289
337
  videoSourceState: _.FcrMediaSourceState.CLOSE,
290
338
  audioSourceState: _.FcrMediaSourceState.CLOSE,
291
339
  videoSourceUuid: config.videoSourceId,
292
340
  audioSourceUuid: config.audioSourceId
293
- }, (0, _imports.convertStreamTypeToPublishState)(config.streamType))
341
+ }, (0, _imports.convertStreamTypeToPublishState)(config.streamType)), {}, {
342
+ annotation: size ? {
343
+ size: {
344
+ width: size.width,
345
+ height: size.height
346
+ }
347
+ } : {
348
+ size: {
349
+ width: 0,
350
+ height: 0
351
+ }
352
+ }
353
+ })
294
354
  }), _error.FcrErrorModuleCode.ROOM_STREAM, 'add local screen stream failed');
295
355
  const {
296
356
  data: {
@@ -348,6 +408,15 @@ class FcrStreamControlImpl {
348
408
  removeObserver(observer) {
349
409
  this._observable.removeObserver(observer);
350
410
  }
411
+ async findSelectionByParamId(paramSourceId) {
412
+ var _this$_mediaControl, _this$_mediaControl2;
413
+ const wins = (await ((_this$_mediaControl = this._mediaControl) === null || _this$_mediaControl === void 0 ? void 0 : _this$_mediaControl.getWindowList())) || [];
414
+ const displays = (await ((_this$_mediaControl2 = this._mediaControl) === null || _this$_mediaControl2 === void 0 ? void 0 : _this$_mediaControl2.getDisplayList())) || [];
415
+ const findInList = list => list.find(item => item.id === paramSourceId);
416
+ const winMatch = findInList(wins);
417
+ const displayMatch = findInList(displays);
418
+ return winMatch || displayMatch || null;
419
+ }
351
420
  _addLogObserver() {
352
421
  this.addObserver((0, _logger.generateLogObserver)(this.logger, [
353
422
  // 'onLocalVideoStatsUpdated',
@@ -1,7 +1,7 @@
1
1
  import { FcrOperateCause, FcrRenderView, FcrStreamInfo, FcrUserInfo, FcrUserRole, FcrVideoEncoderConfig, FcrVideoRenderConfig } from '../../type';
2
2
  import { FcrVideoStreamType, FcrStreamPrivilegeOperation, FcrStreamPrivilegeVideoSourceType, FcrStreamPrivilegeAudioSourceType } from '../..';
3
3
  import { AgoraRteSnapshotInfo, AgoraRtcLocalVideoStats, AgoraRtcLocalAudioStats, AgoraRtcRemoteVideoStats, AgoraRtcRemoteAudioStats, AgoraRtcDimensions, AgoraRteMediaStreamCreateConfig } from '../../imports';
4
- import { FcrMediaStreamCreateConfigSchema, FcrStreamBindConfigSchema, FcrScreenStreamCreateConfigSchema } from '../../schema';
4
+ import { FcrMediaStreamCreateConfigSchema, FcrStreamBindConfigSchema, FcrScreenStreamCreateConfigSchema, fcrSizeSchema } from '../../schema';
5
5
  export interface FcrStreamControl {
6
6
  /**
7
7
  * Gets the map of list of streams, indexed by user ID.
@@ -103,7 +103,7 @@ export interface FcrStreamControl {
103
103
  * Adds a local screen stream.
104
104
  * @param config
105
105
  */
106
- addLocalScreenStream(config: FcrScreenStreamCreateConfig): Promise<string>;
106
+ addLocalScreenStream(config: FcrScreenStreamCreateConfig, size?: FcrSize): Promise<string>;
107
107
  /**
108
108
  * Removes the local screen stream.
109
109
  */
@@ -122,6 +122,7 @@ export interface FcrStreamControl {
122
122
  export type FcrLocalStreamCreateConfig = FcrMediaStreamCreateConfigSchema;
123
123
  export type FcrStreamBindConfig = FcrStreamBindConfigSchema;
124
124
  export type FcrScreenStreamCreateConfig = FcrScreenStreamCreateConfigSchema;
125
+ export type FcrSize = fcrSizeSchema;
125
126
  export type FcrUpdateStreamPrivilege = {
126
127
  videoPrivilege: FcrStreamPrivilegeOperation;
127
128
  audioPrivilege: FcrStreamPrivilegeOperation;
@@ -8,17 +8,13 @@ import { FcrRoomConnectorControl } from './room-connector-control/type';
8
8
  import { FcrRoomSessionControl } from './room-session/type';
9
9
  import { FcrStreamControl } from './stream-control/type';
10
10
  import { FcrUserControl, FcrUserRole } from './user-control/type';
11
- import { FcrWhiteboardControl } from './whiteboard-control/types';
12
11
  import { FcrAbilityControl } from './ability-control/type';
12
+ import { FcrSharingControl } from './sharing-control/type';
13
13
  export interface FcrBaseRoomControl {
14
14
  /**
15
15
  * Gets the user control.
16
16
  */
17
17
  getUserControl(): FcrUserControl;
18
- /**
19
- * Gets the whiteboard control.
20
- */
21
- getBoardControl(): FcrWhiteboardControl;
22
18
  /**
23
19
  * Gets the stream control.
24
20
  */
@@ -43,6 +39,10 @@ export interface FcrBaseRoomControl {
43
39
  * Gets the ability control.
44
40
  */
45
41
  getAbilityControl(): FcrAbilityControl;
42
+ /**
43
+ * Gets the sharing control.
44
+ */
45
+ getSharingControl(): FcrSharingControl;
46
46
  /**
47
47
  * Gets the room ID.
48
48
  */
@@ -1,7 +1,7 @@
1
1
  import { Room } from '@netless/window-manager';
2
2
  import '@netless/window-manager/dist/style.css';
3
3
  import { FcrBoardToolType } from './enums';
4
- import { Color, FcrBoardWindowObserver, FcrBoardMainWindow } from './types';
4
+ import { Color, FcrBoardMainWindow, FcrBoardMainWindowObserver } from './types';
5
5
  import { FcrPrivilegeControl } from '../privilege-control/type';
6
6
  export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow {
7
7
  protected logger: import("agora-foundation/lib/logger").Logger;
@@ -14,9 +14,10 @@ export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow {
14
14
  private _observable;
15
15
  private _destroyed;
16
16
  constructor(room: Room, privilegeControl: FcrPrivilegeControl);
17
+ setBoardTransparent(isTransparent: boolean): Promise<void>;
17
18
  getSnapshotImage(): Promise<ImageData>;
18
- addObserver(observer: FcrBoardWindowObserver): void;
19
- removeObserver(observer: FcrBoardWindowObserver): void;
19
+ addObserver(observer: FcrBoardMainWindowObserver): void;
20
+ removeObserver(observer: FcrBoardMainWindowObserver): void;
20
21
  getContentView(): HTMLElement;
21
22
  setContainerSizeRatio(ratio: number): Promise<void>;
22
23
  getPageInfo(): {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.error.cause.js");
5
4
  require("core-js/modules/es.array.push.js");
6
5
  require("core-js/modules/esnext.async-iterator.filter.js");
7
6
  require("core-js/modules/esnext.async-iterator.for-each.js");
@@ -29,6 +28,7 @@ Object.defineProperty(exports, "__esModule", {
29
28
  value: true
30
29
  });
31
30
  exports.FcrBoardMainWindowImpl = void 0;
31
+ require("core-js/modules/es.error.cause.js");
32
32
  require("core-js/modules/es.promise.finally.js");
33
33
  require("core-js/modules/esnext.async-iterator.map.js");
34
34
  require("core-js/modules/esnext.iterator.map.js");
@@ -69,6 +69,9 @@ class FcrBoardMainWindowImpl {
69
69
  this._mount();
70
70
  this._addLogObserver();
71
71
  }
72
+ setBoardTransparent(isTransparent) {
73
+ throw new Error('Method not implemented.');
74
+ }
72
75
  async getSnapshotImage() {
73
76
  this._preCheck({
74
77
  wm: false
@@ -1,32 +1,15 @@
1
1
  import { FcrConnectionState } from '../..';
2
- import { FcrUserInfo } from '../../type';
3
2
  import { FcrBoardRegion, FcrBoardShape, FcrBoardToolType, FcrSharePermissionState } from './enums';
4
3
  import { AgoraRteRenderView, FcrImageData, FcrWhiteboardView } from '../../imports';
5
4
  import { ColorSchema } from '../../schema';
6
- export type FcrWhiteboardObserver = {
5
+ export type FcrBaseWhiteboardObserver = {
7
6
  /**
8
7
  * Callback to receive the connection state change.
9
8
  * @param state
10
9
  */
11
10
  onConnectionStateUpdated?(state: FcrConnectionState): void;
12
- /**
13
- * Callback to receive the background color of the whiteboard change.
14
- * @param info
15
- */
16
- onBackgroundColorUpdated?(color: string, operatorUser?: FcrUserInfo): void;
17
- /**
18
- * Callback to receive the whiteboard active event.
19
- * @param info
20
- */
21
- onActive?(ownerId: string, operatorUser: FcrUserInfo): void;
22
- /**
23
- * Callback to receive the whiteboard inactive event.
24
- * @param reason
25
- * @param operatorUser
26
- */
27
- onInactive?(reason: FcrBoardInactiveReason, operatorUser?: FcrUserInfo): void;
28
11
  };
29
- export type FcrBoardWindowObserver = {
12
+ export type FcrBoardMainWindowObserver = {
30
13
  /**
31
14
  * Callback to receive the page info change.
32
15
  * @param info
@@ -119,7 +102,7 @@ export type FcrBoardWindowOptions = SlideOptions & {
119
102
  export type FcrBoardRoomOptions = SlideOptions & {
120
103
  debug: boolean;
121
104
  };
122
- export interface FcrWhiteboardControl {
105
+ export interface FcrBaseWhiteboardControl {
123
106
  /**
124
107
  * Opens the whiteboard and creates a main window.
125
108
  */
@@ -128,14 +111,6 @@ export interface FcrWhiteboardControl {
128
111
  * Closes the whiteboard and releases the main window.
129
112
  */
130
113
  close(): Promise<void>;
131
- /**
132
- * Activates the whiteboard.
133
- */
134
- active(): Promise<void>;
135
- /**
136
- * Inactivates the whiteboard.
137
- */
138
- inactive(): Promise<void>;
139
114
  /**
140
115
  * Gets the connection state of the whiteboard.
141
116
  */
@@ -145,38 +120,34 @@ export interface FcrWhiteboardControl {
145
120
  */
146
121
  getMainWindow(): FcrBoardMainWindow | undefined;
147
122
  /**
148
- * Gets the active info of the whiteboard.
149
- */
150
- getBoardActiveInfo(): FcrBoardActiveInfo;
151
- /**
152
- * Sets the background color of the whiteboard.
153
- * @param color
123
+ * Adds an observer to the whiteboard.
124
+ * @param observer
154
125
  */
155
- setBackgroundColor(color: string): Promise<void>;
126
+ addObserver(observer: FcrBaseWhiteboardObserver): void;
156
127
  /**
157
- * Gets the background color of the whiteboard.
128
+ * Removes the observer from the whiteboard.
129
+ * @param observer
158
130
  */
159
- getBackgroundColor(): string | undefined;
131
+ removeObserver(observer: FcrBaseWhiteboardObserver): void;
132
+ }
133
+ export interface FcrBoardMainWindow {
160
134
  /**
161
- * Gets the whiteboard activity info.
135
+ * Gets the content view.
162
136
  */
163
- getActivity(): boolean;
137
+ getContentView(): FcrWhiteboardView;
164
138
  /**
165
- * Gets the whiteboard owner ID.
139
+ * Gets the snapshot image of the whiteboard.
166
140
  */
167
- getOwnerId(): string;
141
+ getSnapshotImage(): Promise<FcrImageData>;
168
142
  /**
169
- * Adds an observer to the whiteboard.
170
- * @param observer
143
+ * Sets the container size ratio.
144
+ * @param ratio
171
145
  */
172
- addObserver(observer: FcrWhiteboardObserver): void;
146
+ setContainerSizeRatio(ratio: number): Promise<void>;
173
147
  /**
174
- * Removes the observer from the whiteboard.
175
- * @param observer
148
+ * Gets page info.
176
149
  */
177
- removeObserver(observer: FcrWhiteboardObserver): void;
178
- }
179
- export interface FcrBoardMainWindow {
150
+ getPageInfo(): FcrBoardPageInfo;
180
151
  /**
181
152
  * Adds a page.
182
153
  */
@@ -185,6 +156,14 @@ export interface FcrBoardMainWindow {
185
156
  * Removes a page.
186
157
  */
187
158
  removePage(): Promise<void>;
159
+ /**
160
+ * Navigates to the previous page.
161
+ */
162
+ prevPage(): Promise<void>;
163
+ /**
164
+ * Navigate to the next page.
165
+ */
166
+ nextPage(): Promise<void>;
188
167
  /**
189
168
  * Undoes the operation.
190
169
  */
@@ -197,27 +176,6 @@ export interface FcrBoardMainWindow {
197
176
  * Cleans the whiteboard.
198
177
  */
199
178
  clean(): Promise<void>;
200
- /**
201
- * Gets the snapshot image of the whiteboard.
202
- */
203
- getSnapshotImage(): Promise<FcrImageData>;
204
- /**
205
- * Sets the background color of the whiteboard.
206
- * @param color
207
- */
208
- setBackgroundColor(color: string): Promise<void>;
209
- /**
210
- * Gets page info.
211
- */
212
- getPageInfo(): FcrBoardPageInfo;
213
- /**
214
- * Navigates to the previous page.
215
- */
216
- prevPage(): Promise<void>;
217
- /**
218
- * Navigate to the next page.
219
- */
220
- nextPage(): Promise<void>;
221
179
  /**
222
180
  * Sets the tool type.
223
181
  * @param type
@@ -243,6 +201,15 @@ export interface FcrBoardMainWindow {
243
201
  * @param textSize
244
202
  */
245
203
  setTextSize(textSize: number): Promise<void>;
204
+ /**
205
+ * Sets the background color of the whiteboard.
206
+ * @param color
207
+ */
208
+ setBackgroundColor(color: string): Promise<void>;
209
+ /**
210
+ * Sets the board background to transparent.
211
+ */
212
+ setBoardTransparent(isTransparent: boolean): Promise<void>;
246
213
  /**
247
214
  * Inserts an image.
248
215
  * @param resourceUrl
@@ -265,12 +232,12 @@ export interface FcrBoardMainWindow {
265
232
  * Adds an observer to the main window.
266
233
  * @param observer
267
234
  */
268
- addObserver(observer: FcrBoardWindowObserver): void;
235
+ addObserver(observer: FcrBoardMainWindowObserver): void;
269
236
  /**
270
237
  * Removes the observer from the main window.
271
238
  * @param observer
272
239
  */
273
- removeObserver(observer: FcrBoardWindowObserver): void;
240
+ removeObserver(observer: FcrBoardMainWindowObserver): void;
274
241
  }
275
242
  export type FcrBoardInfo = {
276
243
  state: FcrSharePermissionState;
@@ -0,0 +1,33 @@
1
+ import { AgoraRteScene } from 'agora-rte-sdk';
2
+ import { FcrPrivilegeControl } from '../../privilege-control/type';
3
+ import { FcrBoardMainWindow } from '../../whiteboard-control/types';
4
+ import { FcrAnnotationControl } from './type';
5
+ import { AgoraRteEngine } from 'agora-rte-sdk/lib/imports';
6
+ import { FcrConnectionState } from '../../..';
7
+ import { FcrWhiteboardObserver } from '../whiteboard-control/type';
8
+ import { FcrCoreServiceApi } from '../../../service/api';
9
+ import { FcrSharedCache } from '../../shared-cache';
10
+ export declare class FcrAnnotationControlImpl implements FcrAnnotationControl {
11
+ private _scene;
12
+ private _api;
13
+ private _engine;
14
+ private _privilegeControl;
15
+ private _sharedCache;
16
+ protected logger: import("agora-rte-sdk/lib/imports").Logger;
17
+ private _FCR_ANNOTATION_APP_ID;
18
+ private _boardView;
19
+ private _boardRoom;
20
+ private _observable;
21
+ private _connectState;
22
+ private _joined;
23
+ constructor(_scene: AgoraRteScene, _api: FcrCoreServiceApi, _engine: AgoraRteEngine, _privilegeControl: FcrPrivilegeControl, _sharedCache: FcrSharedCache);
24
+ open(): Promise<FcrBoardMainWindow>;
25
+ close(): Promise<void>;
26
+ getConnectionState(): FcrConnectionState;
27
+ getMainWindow(): FcrBoardMainWindow | undefined;
28
+ addObserver(observer: FcrWhiteboardObserver): void;
29
+ removeObserver(observer: FcrWhiteboardObserver): void;
30
+ private _getBoardConfigInfoWithScene;
31
+ private _updateConnnectionState;
32
+ private _addLogObserver;
33
+ }