fcr-core 3.10.2 → 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.
Files changed (37) hide show
  1. package/lib/imports.d.ts +7 -1
  2. package/lib/imports.js +27 -1
  3. package/lib/index.d.ts +2 -0
  4. package/lib/index.js +14 -2
  5. package/lib/room-control/helpers/constants.d.ts +8 -0
  6. package/lib/room-control/helpers/constants.js +8 -0
  7. package/lib/room-control/index.js +145 -1
  8. package/lib/room-control/infinity-room-control/index.js +3 -4
  9. package/lib/room-control/mainroom-control/index.js +3 -4
  10. package/lib/room-control/privilege-control/index.js +22 -3
  11. package/lib/room-control/privilege-control/type.d.ts +20 -0
  12. package/lib/room-control/privilege-control/type.js +11 -1
  13. package/lib/room-control/type.d.ts +44 -0
  14. package/lib/room-control/user-control/index.js +32 -0
  15. package/lib/room-control/user-control/type.d.ts +24 -0
  16. package/lib/room-control/whiteboard-control-v2/base/index.js +9 -12
  17. package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +6 -0
  18. package/lib/room-control/whiteboard-control-v2/base/main-window.js +13 -3
  19. package/lib/room-control/whiteboard-control-v2/type.d.ts +5 -0
  20. package/lib/service/api.d.ts +15 -1
  21. package/lib/service/api.js +48 -0
  22. package/lib/utilities/parameters.js +17 -4
  23. package/lib-es/imports.js +6 -0
  24. package/lib-es/index.js +4 -0
  25. package/lib-es/media-control/desktop.js +1 -0
  26. package/lib-es/room-control/helpers/constants.js +8 -0
  27. package/lib-es/room-control/index.js +146 -2
  28. package/lib-es/room-control/infinity-room-control/index.js +3 -4
  29. package/lib-es/room-control/mainroom-control/index.js +3 -4
  30. package/lib-es/room-control/privilege-control/index.js +23 -4
  31. package/lib-es/room-control/privilege-control/type.js +10 -0
  32. package/lib-es/room-control/user-control/index.js +32 -0
  33. package/lib-es/room-control/whiteboard-control-v2/base/index.js +9 -12
  34. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +13 -3
  35. package/lib-es/service/api.js +48 -0
  36. package/lib-es/utilities/parameters.js +17 -4
  37. package/package.json +10 -8
@@ -54,6 +54,7 @@ export class FcrInfinityRoomControlImpl extends FcrBaseRoomControlImpl {
54
54
  this._interpreterControl = new FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
55
55
  this._addLogObserver();
56
56
  addBoardInitInfoObserver(this._scene, this._api, this.logger);
57
+ this._registerClientRecordingObserver();
57
58
  this.logger.info(`initialized, room id: ${this._scene.sceneId}`);
58
59
  }
59
60
  getAnnouncement() {
@@ -108,13 +109,11 @@ export class FcrInfinityRoomControlImpl extends FcrBaseRoomControlImpl {
108
109
  _onLocalUserPermissionInfoDeleted(roomId, event) {
109
110
  if (hasBoardWritePermission(event.permissionInfo)) {
110
111
  this.logger.info(`remove board write permission`);
111
-
112
- // this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
112
+ this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
113
113
  }
114
114
  if (hasAnnotationWritePermission(event.permissionInfo)) {
115
115
  this.logger.info(`remove annotation write permission`);
116
-
117
- // this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
116
+ this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
118
117
  }
119
118
  }
120
119
  _addLogObserver() {
@@ -64,6 +64,7 @@ export class FcrMainRoomControlImpl extends FcrBaseRoomControlImpl {
64
64
  this._interpreterControl = new FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
65
65
  this._addLogObserver();
66
66
  addBoardInitInfoObserver(this._scene, this._api, this.logger);
67
+ this._registerClientRecordingObserver();
67
68
  this.logger.info(`initialized, room id: ${this._scene.sceneId}`);
68
69
  }
69
70
 
@@ -131,13 +132,11 @@ export class FcrMainRoomControlImpl extends FcrBaseRoomControlImpl {
131
132
  _onLocalUserPermissionInfoDeleted(roomId, event) {
132
133
  if (hasBoardWritePermission(event.permissionInfo)) {
133
134
  this.logger.info(`remove board write permission`);
134
-
135
- // this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
135
+ this.getSharingControl().getBoardControl().getMainWindow()?.setWritable(false);
136
136
  }
137
137
  if (hasAnnotationWritePermission(event.permissionInfo)) {
138
138
  this.logger.info(`remove annotation write permission`);
139
-
140
- // this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
139
+ this.getSharingControl().getAnnotationControl().getMainWindow()?.setWritable(false);
141
140
  }
142
141
  }
143
142
  _checkIfUpdateAnnotationMainWindow() {
@@ -15,7 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
15
15
  import "core-js/modules/esnext.map.some.js";
16
16
  import "core-js/modules/esnext.map.update.js";
17
17
  import "core-js/modules/esnext.symbol.metadata.js";
18
- let _initProto, _allowWriteAnnotationDecs, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowWriteBoardByUserIdsDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _allowStartCaptionDecs, _allowStartTranscribingDecs, _allowUpdateSttSourceLanguageDecs, _allowJoinWithPromptSoundDecs, _getRemoteUserPermissionEnableDecs, _allowViewUserCountDecs, _allowHandsUpDecs, _allowSendChatByUserRoleDecs, _allowSendChatByUserIdDecs;
18
+ let _initProto, _allowWriteAnnotationDecs, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowWriteBoardByUserIdsDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _allowStartCaptionDecs, _allowStartTranscribingDecs, _allowUpdateSttSourceLanguageDecs, _allowJoinWithPromptSoundDecs, _allowClientRecordingDecs, _allowClientRecordingByUserIdDecs, _getRemoteUserPermissionEnableDecs, _allowViewUserCountDecs, _allowHandsUpDecs, _allowSendChatByUserRoleDecs, _allowSendChatByUserIdDecs;
19
19
  import "core-js/modules/esnext.iterator.constructor.js";
20
20
  import "core-js/modules/esnext.iterator.for-each.js";
21
21
  import "core-js/modules/esnext.iterator.map.js";
@@ -33,16 +33,16 @@ import { createLogger, generateLogObserver } from '../../utilities/logger';
33
33
  import { checkFcrUserRole, convertRteUserToFcrUser, convertStringPrivilegeRoleToFcrPrivilegeRole } from '../../utilities/user';
34
34
  import validateParams from '../../utilities/validate-params';
35
35
  import { FcrPermission, addLocalUserPermissionObserver, getLocalUserPermissionInfo } from './helper';
36
- import { FcrOperatePermissionType, FcrPrivilegeUserRoleToStringMap, FcrRemotePermissionType, FcrSecurityAction, FcrTargetUserTypeToStringMap } from './type';
36
+ import { FcrClientRecordingPermissionType, FcrOperatePermissionType, FcrPrivilegeUserRole, FcrPrivilegeUserRoleToStringMap, FcrRemotePermissionType, FcrSecurityAction, FcrTargetUserTypeToStringMap } from './type';
37
37
  /**
38
38
  * @internal
39
39
  */
40
40
  export class FcrPrivilegeControlImpl {
41
41
  static {
42
- [_initProto] = _applyDecs(this, [[_allowWriteAnnotationDecs, 2, "allowWriteAnnotation"], [_getSecurityInfoDecs, 2, "getSecurityInfo"], [_getLocalUserPermissionInfoDecs, 2, "getLocalUserPermissionInfo"], [_enableLockedRoomDecs, 2, "enableLockedRoom"], [_allowShareAndWriteDecs, 2, "allowShareAndWrite"], [_allowWriteBoardDecs, 2, "allowWriteBoard"], [_allowWriteBoardByUserIdsDecs, 2, "allowWriteBoardByUserIds"], [_allowSendChatDecs, 2, "allowSendChat"], [_allowStartAudioDecs, 2, "allowStartAudio"], [_allowStartVideoDecs, 2, "allowStartVideo"], [_allowJoinWithMutedAudioDecs, 2, "allowJoinWithMutedAudio"], [_allowJoinWithMutedVideoDecs, 2, "allowJoinWithMutedVideo"], [_allowWatermarkDecs, 2, "allowWatermark"], [_allowChangeUserNameDecs, 2, "allowChangeUserName"], [_allowStartCaptionDecs, 2, "allowStartCaption"], [_allowStartTranscribingDecs, 2, "allowStartTranscribing"], [_allowUpdateSttSourceLanguageDecs, 2, "allowUpdateSttSourceLanguage"], [_allowJoinWithPromptSoundDecs, 2, "allowJoinWithPromptSound"], [_getRemoteUserPermissionEnableDecs, 2, "getRemoteUserPermissionEnable"], [_allowViewUserCountDecs, 2, "allowViewUserCount"], [_allowHandsUpDecs, 2, "allowHandsUp"], [_allowSendChatByUserRoleDecs, 2, "allowSendChatByUserRole"], [_allowSendChatByUserIdDecs, 2, "allowSendChatByUserId"], [trace, 2, "release"]], []).e;
42
+ [_initProto] = _applyDecs(this, [[_allowWriteAnnotationDecs, 2, "allowWriteAnnotation"], [_getSecurityInfoDecs, 2, "getSecurityInfo"], [_getLocalUserPermissionInfoDecs, 2, "getLocalUserPermissionInfo"], [_enableLockedRoomDecs, 2, "enableLockedRoom"], [_allowShareAndWriteDecs, 2, "allowShareAndWrite"], [_allowWriteBoardDecs, 2, "allowWriteBoard"], [_allowWriteBoardByUserIdsDecs, 2, "allowWriteBoardByUserIds"], [_allowSendChatDecs, 2, "allowSendChat"], [_allowStartAudioDecs, 2, "allowStartAudio"], [_allowStartVideoDecs, 2, "allowStartVideo"], [_allowJoinWithMutedAudioDecs, 2, "allowJoinWithMutedAudio"], [_allowJoinWithMutedVideoDecs, 2, "allowJoinWithMutedVideo"], [_allowWatermarkDecs, 2, "allowWatermark"], [_allowChangeUserNameDecs, 2, "allowChangeUserName"], [_allowStartCaptionDecs, 2, "allowStartCaption"], [_allowStartTranscribingDecs, 2, "allowStartTranscribing"], [_allowUpdateSttSourceLanguageDecs, 2, "allowUpdateSttSourceLanguage"], [_allowJoinWithPromptSoundDecs, 2, "allowJoinWithPromptSound"], [_allowClientRecordingDecs, 2, "allowClientRecording"], [_allowClientRecordingByUserIdDecs, 2, "allowClientRecordingByUserId"], [_getRemoteUserPermissionEnableDecs, 2, "getRemoteUserPermissionEnable"], [_allowViewUserCountDecs, 2, "allowViewUserCount"], [_allowHandsUpDecs, 2, "allowHandsUp"], [_allowSendChatByUserRoleDecs, 2, "allowSendChatByUserRole"], [_allowSendChatByUserIdDecs, 2, "allowSendChatByUserId"], [trace, 2, "release"]], []).e;
43
43
  }
44
44
  //@internal
45
- [(_allowWriteAnnotationDecs = trace(['enable', 'targetRoles']), _getSecurityInfoDecs = [trace(['action']), validateParams(fcrSecurityActionSchema)], _getLocalUserPermissionInfoDecs = [trace(['action']), validateParams(fcrPermissionActionSchema)], _enableLockedRoomDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowShareAndWriteDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardByUserIdsDecs = [trace(['enable', 'targetUserIds']), validateParams(booleanSchema, stringArraySchema)], _allowSendChatDecs = [trace(['enable', 'targetRoles', 'payload']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema, fcrSecuritySendChatPayloadSchema)], _allowStartAudioDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowStartVideoDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedAudioDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedVideoDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowWatermarkDecs = [trace(['enable', 'targetRoles', 'lineType']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema, fcrLineTypeSchema.optional())], _allowChangeUserNameDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowStartCaptionDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowStartTranscribingDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowUpdateSttSourceLanguageDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowJoinWithPromptSoundDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _getRemoteUserPermissionEnableDecs = trace(['userId', 'type']), _allowViewUserCountDecs = trace(['enable', 'targetRoles']), _allowHandsUpDecs = trace(['enable', 'targetRoles']), _allowSendChatByUserRoleDecs = trace(['config', 'targetRoles']), _allowSendChatByUserIdDecs = trace(['enable', 'userId']), "logger")] = (_initProto(this), createLogger({
45
+ [(_allowWriteAnnotationDecs = trace(['enable', 'targetRoles']), _getSecurityInfoDecs = [trace(['action']), validateParams(fcrSecurityActionSchema)], _getLocalUserPermissionInfoDecs = [trace(['action']), validateParams(fcrPermissionActionSchema)], _enableLockedRoomDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowShareAndWriteDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardByUserIdsDecs = [trace(['enable', 'targetUserIds']), validateParams(booleanSchema, stringArraySchema)], _allowSendChatDecs = [trace(['enable', 'targetRoles', 'payload']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema, fcrSecuritySendChatPayloadSchema)], _allowStartAudioDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowStartVideoDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedAudioDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedVideoDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowWatermarkDecs = [trace(['enable', 'targetRoles', 'lineType']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema, fcrLineTypeSchema.optional())], _allowChangeUserNameDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowStartCaptionDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowStartTranscribingDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowUpdateSttSourceLanguageDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowJoinWithPromptSoundDecs = [trace(['enable', 'targetRoles']), validateParams(booleanSchema, fcrPrivilegeUserRoleArraySchema)], _allowClientRecordingDecs = trace(['permissionType']), _allowClientRecordingByUserIdDecs = trace(['userId', 'enable']), _getRemoteUserPermissionEnableDecs = trace(['userId', 'type']), _allowViewUserCountDecs = trace(['enable', 'targetRoles']), _allowHandsUpDecs = trace(['enable', 'targetRoles']), _allowSendChatByUserRoleDecs = trace(['config', 'targetRoles']), _allowSendChatByUserIdDecs = trace(['enable', 'userId']), "logger")] = (_initProto(this), createLogger({
46
46
  prefix: 'FcrPrivilegeControlImpl'
47
47
  }));
48
48
  _observable = new AgoraObservable();
@@ -254,6 +254,25 @@ export class FcrPrivilegeControlImpl {
254
254
  }), ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow join with prompt sound failed');
255
255
  return FcrReturnCode.SUCCESS;
256
256
  }
257
+ async allowClientRecording(permissionType) {
258
+ const enable = permissionType === FcrClientRecordingPermissionType.HostOnly ? 0 : 1;
259
+ const targetRoles = permissionType === FcrClientRecordingPermissionType.AllMembers ? [FcrPrivilegeUserRoleToStringMap[FcrPrivilegeUserRole.PARTICIPANT]] : undefined;
260
+ await handleRequestError(() => this._api.allowClientRecording({
261
+ roomId: this._scene.sceneId,
262
+ permissionType,
263
+ enable,
264
+ targetRoles
265
+ }), ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow client recording failed');
266
+ return FcrReturnCode.SUCCESS;
267
+ }
268
+ async allowClientRecordingByUserId(userId, enable) {
269
+ await handleRequestError(() => this._api.allowClientRecordingByUserId({
270
+ roomId: this._scene.sceneId,
271
+ toUserUuids: [userId],
272
+ enable
273
+ }), ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow client recording by user id failed');
274
+ return FcrReturnCode.SUCCESS;
275
+ }
257
276
  getRemoteUserPermissionEnable(userId, type) {
258
277
  if (userId === this._scene.localUser.getLocalUserId()) {
259
278
  return false;
@@ -112,6 +112,9 @@ export let FcrPermissionAction = /*#__PURE__*/function (FcrPermissionAction) {
112
112
  FcrPermissionAction["RecordStopCloudRecording"] = "record:stopCloudRecording";
113
113
  FcrPermissionAction["RecordPauseCloudRecording"] = "record:pauseCloudRecording";
114
114
  FcrPermissionAction["RecordResumeCloudRecording"] = "record:resumeCloudRecording";
115
+ FcrPermissionAction["RecordStartClientRecording"] = "record:startClientRecording";
116
+ FcrPermissionAction["RecordStopClientRecording"] = "record:stopClientRecording";
117
+ FcrPermissionAction["RecordSetClientRecordingPermission"] = "record:setClientRecordingPermission";
115
118
  FcrPermissionAction["CallCallIn"] = "call:callIn";
116
119
  FcrPermissionAction["CallHangUp"] = "call:hangUp";
117
120
  FcrPermissionAction["CallInvite"] = "call:invite";
@@ -177,6 +180,7 @@ export let FcrSecurityAction = /*#__PURE__*/function (FcrSecurityAction) {
177
180
  FcrSecurityAction["SttStartCaption"] = "caption";
178
181
  FcrSecurityAction["SttStartTranscribe"] = "transcribe";
179
182
  FcrSecurityAction["JoinWithPromptSound"] = "joinWithPromptSound";
183
+ FcrSecurityAction["ClientRecording"] = "clientRecording";
180
184
  FcrSecurityAction["HandsUp"] = "handsUp";
181
185
  FcrSecurityAction["ViewUserCount"] = "viewUserCount";
182
186
  return FcrSecurityAction;
@@ -186,6 +190,12 @@ export let FcrWatermarkPermissionState = /*#__PURE__*/function (FcrWatermarkPerm
186
190
  FcrWatermarkPermissionState[FcrWatermarkPermissionState["OFF"] = 0] = "OFF";
187
191
  return FcrWatermarkPermissionState;
188
192
  }({});
193
+ export let FcrClientRecordingPermissionType = /*#__PURE__*/function (FcrClientRecordingPermissionType) {
194
+ FcrClientRecordingPermissionType[FcrClientRecordingPermissionType["HostOnly"] = 1] = "HostOnly";
195
+ FcrClientRecordingPermissionType[FcrClientRecordingPermissionType["AllMembers"] = 2] = "AllMembers";
196
+ FcrClientRecordingPermissionType[FcrClientRecordingPermissionType["SpecifiedMembers"] = 3] = "SpecifiedMembers";
197
+ return FcrClientRecordingPermissionType;
198
+ }({});
189
199
  export let FcrRemotePermissionType = /*#__PURE__*/function (FcrRemotePermissionType) {
190
200
  FcrRemotePermissionType[FcrRemotePermissionType["SendChatToAll"] = 1] = "SendChatToAll";
191
201
  FcrRemotePermissionType[FcrRemotePermissionType["SendChatToCoParticipant"] = 2] = "SendChatToCoParticipant";
@@ -36,6 +36,7 @@ import { createLogger, generateLogObserver } from '../../utilities/logger';
36
36
  import { handleRequestError } from '../../utilities/error';
37
37
  import validateParams from '../../utilities/validate-params';
38
38
  import { fcrUserKickedOutTypeSchema, fcrUserRolesSchema, stringKeyUnknownValueSchema, stringSchema, stringArraySchema, fcrUserRoleSchema, stringKeyNumberValueSchema } from '../../schema';
39
+ import { ROOM_MESSAGE_COMMANDS } from '../helpers/constants';
39
40
  import { ErrorModuleCode } from '../../imports';
40
41
 
41
42
  /**
@@ -169,6 +170,29 @@ export class FcrUserControlImpl {
169
170
  });
170
171
  }
171
172
  }
173
+ if (event.cause?.cmd === ROOM_MESSAGE_COMMANDS.CLIENT_RECORDING_PERMISSION) {
174
+ const {
175
+ changedProperties,
176
+ modifiedUser
177
+ } = event;
178
+ const enable = get(changedProperties, 'security.clientRecording');
179
+ if (Object.keys(changedProperties).length > 0) {
180
+ this._observable.notifyObservers('onUserClientRecordingPermissionUpdated', modifiedUser.userId, !!enable);
181
+ }
182
+ }
183
+ if (event.cause?.cmd === ROOM_MESSAGE_COMMANDS.USER_WIDGET_PROPERTIES_UPDATE) {
184
+ const widgetCauseCmd = event.cause?.data?.widgetCause?.cmd;
185
+ if (widgetCauseCmd === ROOM_MESSAGE_COMMANDS.CLIENT_RECORDING_STATE) {
186
+ const {
187
+ changedProperties,
188
+ modifiedUser
189
+ } = event;
190
+ const enable = get(changedProperties, 'widgets.clientRecording.state');
191
+ if (Object.keys(changedProperties).length > 0) {
192
+ this._observable.notifyObservers('onUserClientRecordingStateUpdated', modifiedUser.userId, !!enable);
193
+ }
194
+ }
195
+ }
172
196
  },
173
197
  onUserPropertiesDeleted: (roomId, event) => {
174
198
  if (event.cause?.cmd === 8) {
@@ -259,6 +283,14 @@ export class FcrUserControlImpl {
259
283
  } = this.getLocalUser();
260
284
  return get(this._scene.getUserPropertiesByUserId(userId), 'security.watermark.content');
261
285
  }
286
+ getUserClientRecordingState(userId) {
287
+ const state = get(this._scene.getUserPropertiesByUserId(userId), 'widgets.clientRecording.state');
288
+ return Boolean(state);
289
+ }
290
+ getUserClientRecordingPermission(userId) {
291
+ const permission = get(this._scene.getUserPropertiesByUserId(userId), 'security.clientRecording');
292
+ return Boolean(permission);
293
+ }
262
294
  async fetchUserList(params) {
263
295
  return await this._scene.fetchUserList(params);
264
296
  }
@@ -173,8 +173,8 @@ export class FcrBaseWhiteboardControlImpl {
173
173
  boardAppId,
174
174
  boardId,
175
175
  boardRegion,
176
- boardToken
177
- // boardPerformance = false,
176
+ boardToken,
177
+ boardPerformance = false
178
178
  } = this.boardRoomConfig || {};
179
179
  if (!boardAppId) {
180
180
  throw generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM_WHITEBOARD, DetailErrorCode.UNDEFINED_ERROR, 'boardAppId is required');
@@ -246,8 +246,8 @@ export class FcrBaseWhiteboardControlImpl {
246
246
  region: endpoint ? 'private' : boardRegion,
247
247
  appIdentifier: boardAppId
248
248
  },
249
- endpoint,
250
- writable: true
249
+ writable: isNeedLaunch,
250
+ endpoint
251
251
  // verboseLog: true,
252
252
  };
253
253
  this.logger.info(`Room.joinRoom calling, params: ${jsonstring(joinRoomParams)}, timeout: ${WHITEBOARD_ROOM_JOIN_TIMEOUT}`);
@@ -293,14 +293,11 @@ export class FcrBaseWhiteboardControlImpl {
293
293
  this.whiteboard = whiteboard;
294
294
  this.boardView = boardView;
295
295
  this.boardRoom = boardRoom;
296
-
297
- // if (isNeedLaunch) {
298
- // // 所有人开启白板时都默认没有开启写权限, 需要写权限的地方需要自己手动开启
299
- // boardView.internalSetWritable(false);
300
- // }
301
-
302
- // boardView.setPerformanceMode(boardPerformance);
303
-
296
+ if (isNeedLaunch) {
297
+ // 所有人开启白板时都默认没有开启写权限, 需要写权限的地方需要自己手动开启
298
+ boardView.internalSetWritable(false);
299
+ }
300
+ boardView.setPerformanceMode(boardPerformance);
304
301
  this.updateConnectionState(FcrConnectionState.CONNECTED);
305
302
  resolve(boardView);
306
303
  if (this._waitPromiseResolve) {
@@ -15,7 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
15
15
  import "core-js/modules/esnext.map.some.js";
16
16
  import "core-js/modules/esnext.map.update.js";
17
17
  import "core-js/modules/esnext.symbol.metadata.js";
18
- let _initProto, _setBackgroundColorDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _insertImageDecs, _setContainerSizeRatioDecs, _setBoardTransparentDecs, _updateWindowSizeDecs, _setAutoCancelDrawDecs, _handleApplicationLaunchDecs, _handleApplicationTerminalDecs, _enableAutoCancelDecs;
18
+ let _initProto, _setPerformanceModeDecs, _setBackgroundColorDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _insertImageDecs, _setContainerSizeRatioDecs, _setBoardTransparentDecs, _updateWindowSizeDecs, _setAutoCancelDrawDecs, _handleApplicationLaunchDecs, _handleApplicationTerminalDecs, _enableAutoCancelDecs;
19
19
  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)]; } }; }
20
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
21
21
  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); }
@@ -34,9 +34,9 @@ import { handleRequestError } from '../../../utilities/error';
34
34
  import { ErrorModuleCode } from '../../../imports';
35
35
  export class FcrBoardMainWindowImpl {
36
36
  static {
37
- [_initProto] = _applyDecs(this, [[trace, 2, "addPage"], [trace, 2, "removePage"], [trace, 2, "undo"], [trace, 2, "redo"], [trace, 2, "clean"], [trace, 2, "getSnapshotImage"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [trace, 2, "getPageInfo"], [trace, 2, "prevPage"], [trace, 2, "nextPage"], [_setToolTypeDecs, 2, "setToolType"], [_setStrokeWidthDecs, 2, "setStrokeWidth"], [_setStrokeColorDecs, 2, "setStrokeColor"], [_setTextColorDecs, 2, "setTextColor"], [_setTextSizeDecs, 2, "setTextSize"], [_insertImageDecs, 2, "insertImage"], [trace, 2, "getContentView"], [_setContainerSizeRatioDecs, 2, "setContainerSizeRatio"], [_setBoardTransparentDecs, 2, "setBoardTransparent"], [_updateWindowSizeDecs, 2, "updateWindowSize"], [_setAutoCancelDrawDecs, 2, "setAutoCancelDraw"], [trace, 2, "getWritable"], [_handleApplicationLaunchDecs, 2, "_handleApplicationLaunch"], [_handleApplicationTerminalDecs, 2, "_handleApplicationTerminal"], [_enableAutoCancelDecs, 2, "_enableAutoCancel"]], []).e;
37
+ [_initProto] = _applyDecs(this, [[trace, 2, "addPage"], [trace, 2, "removePage"], [trace, 2, "undo"], [trace, 2, "redo"], [trace, 2, "clean"], [trace, 2, "getSnapshotImage"], [_setPerformanceModeDecs, 2, "setPerformanceMode"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [trace, 2, "getPageInfo"], [trace, 2, "prevPage"], [trace, 2, "nextPage"], [_setToolTypeDecs, 2, "setToolType"], [_setStrokeWidthDecs, 2, "setStrokeWidth"], [_setStrokeColorDecs, 2, "setStrokeColor"], [_setTextColorDecs, 2, "setTextColor"], [_setTextSizeDecs, 2, "setTextSize"], [_insertImageDecs, 2, "insertImage"], [trace, 2, "getContentView"], [_setContainerSizeRatioDecs, 2, "setContainerSizeRatio"], [_setBoardTransparentDecs, 2, "setBoardTransparent"], [_updateWindowSizeDecs, 2, "updateWindowSize"], [_setAutoCancelDrawDecs, 2, "setAutoCancelDraw"], [trace, 2, "getWritable"], [_handleApplicationLaunchDecs, 2, "_handleApplicationLaunch"], [_handleApplicationTerminalDecs, 2, "_handleApplicationTerminal"], [_enableAutoCancelDecs, 2, "_enableAutoCancel"]], []).e;
38
38
  }
39
- [(_setBackgroundColorDecs = [trace(['color']), validateParams(stringSchema)], _setToolTypeDecs = [trace(['type']), validateParams(fcrBoardToolTypeSchema)], _setStrokeWidthDecs = [trace(['strokeWidth']), validateParams(numberSchema)], _setStrokeColorDecs = [trace(['color']), validateParams(z.union([colorSchema, stringSchema]))], _setTextColorDecs = [trace(['color']), validateParams(colorSchema)], _setTextSizeDecs = [trace(['textSize']), validateParams(numberSchema)], _insertImageDecs = [trace(['resourceUrl', 'x', 'y', 'width', 'height']), validateParams(stringSchema, numberSchema, numberSchema, numberSchema, numberSchema)], _setContainerSizeRatioDecs = [trace(['ratio']), validateParams(numberSchema)], _setBoardTransparentDecs = [trace(['isTransparent']), validateParams(booleanSchema)], _updateWindowSizeDecs = [trace(['size']), validateParams(fcrSizeSchema)], _setAutoCancelDrawDecs = [trace(['enable']), validateParams(booleanSchema)], _handleApplicationLaunchDecs = [bound, trace(['appId', 'app'])], _handleApplicationTerminalDecs = [bound, trace(['appId', 'app'])], _enableAutoCancelDecs = trace(['enable']), "logger")] = (_initProto(this), createLogger({
39
+ [(_setPerformanceModeDecs = trace(['enable']), _setBackgroundColorDecs = [trace(['color']), validateParams(stringSchema)], _setToolTypeDecs = [trace(['type']), validateParams(fcrBoardToolTypeSchema)], _setStrokeWidthDecs = [trace(['strokeWidth']), validateParams(numberSchema)], _setStrokeColorDecs = [trace(['color']), validateParams(z.union([colorSchema, stringSchema]))], _setTextColorDecs = [trace(['color']), validateParams(colorSchema)], _setTextSizeDecs = [trace(['textSize']), validateParams(numberSchema)], _insertImageDecs = [trace(['resourceUrl', 'x', 'y', 'width', 'height']), validateParams(stringSchema, numberSchema, numberSchema, numberSchema, numberSchema)], _setContainerSizeRatioDecs = [trace(['ratio']), validateParams(numberSchema)], _setBoardTransparentDecs = [trace(['isTransparent']), validateParams(booleanSchema)], _updateWindowSizeDecs = [trace(['size']), validateParams(fcrSizeSchema)], _setAutoCancelDrawDecs = [trace(['enable']), validateParams(booleanSchema)], _handleApplicationLaunchDecs = [bound, trace(['appId', 'app'])], _handleApplicationTerminalDecs = [bound, trace(['appId', 'app'])], _enableAutoCancelDecs = trace(['enable']), "logger")] = (_initProto(this), createLogger({
40
40
  prefix: 'FcrBoardMainWindowImpl'
41
41
  }));
42
42
  _observable = new AgoraObservable();
@@ -136,6 +136,16 @@ export class FcrBoardMainWindowImpl {
136
136
  throw new Error('Whiteboard is not initialized');
137
137
  }
138
138
  }
139
+
140
+ /**
141
+ * 设置性能模式状态, enabled 为 true 时开启性能模式, 否则关闭性能模式
142
+ * 性能模式下, 白板会降低渲染质量及同步频率以提升性能, 适用于低性能设备或需要大量绘制元素的场景
143
+ * @param enable 是否开启性能模式
144
+ */
145
+ setPerformanceMode(enable) {
146
+ this._whiteboard.setPerformanceMode(enable);
147
+ return FcrReturnCode.SUCCESS;
148
+ }
139
149
  async setBackgroundColor(color) {
140
150
  this._background = color;
141
151
  this.logger.info(`set canvas background color: ${this._background}`);
@@ -250,6 +250,24 @@ export class FcrCoreServiceApi {
250
250
  method: 'PUT'
251
251
  });
252
252
  }
253
+ async startClientRecording(roomId, userId) {
254
+ return this._client.fetch({
255
+ path: `/v1/rooms/${roomId}/users/${userId}/widgets/clientRecording/1`,
256
+ method: 'PUT'
257
+ });
258
+ }
259
+ async resumeClientRecording(roomId, userId) {
260
+ return this._client.fetch({
261
+ path: `/v1/rooms/${roomId}/users/${userId}/widgets/clientRecording/resume`,
262
+ method: 'PUT'
263
+ });
264
+ }
265
+ async stopClientRecording(roomId, userId) {
266
+ return this._client.fetch({
267
+ path: `/v1/rooms/${roomId}/users/${userId}/widgets/clientRecording/0`,
268
+ method: 'PUT'
269
+ });
270
+ }
253
271
  async setCloudRecordingReady(roomId) {
254
272
  return this._client.fetch({
255
273
  path: `/v1/rooms/${roomId}/records/ready`,
@@ -644,6 +662,36 @@ export class FcrCoreServiceApi {
644
662
  });
645
663
  return res.data;
646
664
  }
665
+ async allowClientRecording({
666
+ roomId,
667
+ enable,
668
+ permissionType,
669
+ targetRoles
670
+ }) {
671
+ const res = await this._client.fetch({
672
+ path: `/v1/rooms/${roomId}/security/clientRecording/${enable}`,
673
+ method: 'PUT',
674
+ data: {
675
+ targetRoles,
676
+ selectType: permissionType
677
+ }
678
+ });
679
+ return res.data;
680
+ }
681
+ async allowClientRecordingByUserId({
682
+ roomId,
683
+ toUserUuids,
684
+ enable
685
+ }) {
686
+ const res = await this._client.fetch({
687
+ path: `/v1/rooms/${roomId}/security/clientRecording/users/${enable ? 1 : 0}`,
688
+ method: 'PUT',
689
+ data: {
690
+ toUserUuids
691
+ }
692
+ });
693
+ return res.data;
694
+ }
647
695
  async allowJoinWithPromptSound({
648
696
  roomId,
649
697
  enable,
@@ -27,16 +27,26 @@ const DEFAULT_LOG_FILE_SIZE = 512;
27
27
  /** RTC preset parameters configuration mapping table */
28
28
  const RTC_PRESET_PARAMS_MAP = {
29
29
  [FcrApplicationPlatform.WINDOWS]: [{
30
- 'rtc.video.default_hw_decoder_thres': 921600
31
- }, {
32
- 'rtc.video.h264_hw_min_res_level': 4
30
+ 'engine.video.hw_decoder_fallback_config': {
31
+ max_instances_thres: -1,
32
+ width_thres: 540,
33
+ height_thres: 540,
34
+ decode_time_delay_thres_broadcaster: -1,
35
+ decode_time_delay_thres_audience: -1
36
+ }
33
37
  }],
34
38
  [FcrApplicationPlatform.MACOS]: [{
35
39
  'che.video.screenCaptureMode': 1
36
40
  }, {
37
41
  'che.video.screen_disable_frame_transparent_check': true
38
42
  }, {
39
- 'rtc.video.h264_hw_min_res_level': 4
43
+ 'engine.video.hw_decoder_fallback_config': {
44
+ max_instances_thres: -1,
45
+ width_thres: 540,
46
+ height_thres: 540,
47
+ decode_time_delay_thres_broadcaster: -1,
48
+ decode_time_delay_thres_audience: -1
49
+ }
40
50
  }],
41
51
  [FcrApplicationPlatform.WEB_DESKTOP]: [{
42
52
  RESTRICTION_SET_PLAYBACK_DEVICE: false
@@ -95,6 +105,9 @@ const ELECTRON_COMMON_PARAMS = [
95
105
  'rtc.video.videoFullrange': 1
96
106
  }, {
97
107
  'rtc.video.matrixCoefficients': 5
108
+ }, {
109
+ 'rtc.stream_sub_remote_stats': false,
110
+ 'rtc.stream_pub_local_stats': false
98
111
  }];
99
112
 
100
113
  /** ELECTRON platforms set */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fcr-core",
3
3
  "description": "Core APIs for building online scenes",
4
- "version": "3.10.2",
4
+ "version": "3.11.0-rc.2",
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "files": [
@@ -18,6 +18,7 @@
18
18
  "author": "agora.io",
19
19
  "license": "MIT",
20
20
  "scripts": {
21
+ "check:ai-kb": "node ./scripts/check-ai-kb.js",
21
22
  "prepare": "husky",
22
23
  "build": "agora-tc-transpile --esm",
23
24
  "build:docs": "run-s build:docs:types build:split:i18n build:link-plugin build:en-docs build:cn-docs build:docs:generate",
@@ -28,7 +29,8 @@
28
29
  "build:en-docs": "typedoc --entryPoints ./build-doc/en-sdk.d.ts --readme ./build-doc/readme-en.md --hideGenerator --name 'Edu Store Typescript API Reference for Web' --tsconfig ./build-doc/en/tsconfig.json --out en-docs --excludeExternals --excludePrivate --excludeInternal --excludeProtected --disableSources --theme typedoc-theme",
29
30
  "build:cn-docs": "typedoc --entryPoints ./build-doc/cn-sdk.d.ts --readme ./build-doc/readme-cn.md --hideGenerator --name 'Edu Store Typescript API Reference for Web' --tsconfig ./build-doc/cn/tsconfig.json --out cn-docs --excludeExternals --excludePrivate --excludeInternal --excludeProtected --disableSources --theme typedoc-theme",
30
31
  "test-browser": "agora-tc-test-karma-browser",
31
- "test-electron": "agora-tc-test-karma-electron"
32
+ "test-electron": "agora-tc-test-karma-electron",
33
+ "preinstall": "node ./scripts/check-ai-kb.js"
32
34
  },
33
35
  "devDependencies": {
34
36
  "@babel/core": "^7.23.5",
@@ -41,7 +43,7 @@
41
43
  "@types/lodash": "^4.14.168",
42
44
  "@types/sinon": "^17.0.2",
43
45
  "@types/uuid": "^8.3.0",
44
- "agora-toolchain": "3.10.2",
46
+ "agora-toolchain": "3.11.0-rc.2",
45
47
  "core-js": "^3.33.3",
46
48
  "decomment": "^0.9.5",
47
49
  "husky": "^9.0.11",
@@ -55,14 +57,14 @@
55
57
  "dependencies": {
56
58
  "@netless/app-slide": "^0.2.81",
57
59
  "@netless/appliance-plugin": "^1.1.21",
58
- "@netless/forge-room": "1.2.0-alpha.1",
59
- "@netless/forge-rtm": "1.2.0-alpha.1",
60
- "@netless/forge-whiteboard": "1.2.0-alpha.1",
60
+ "@netless/forge-room": "1.2.0-beta.3",
61
+ "@netless/forge-rtm": "1.2.0-beta.3",
62
+ "@netless/forge-whiteboard": "1.2.0-beta.3",
61
63
  "@netless/video-js-plugin": "^0.3.8",
62
64
  "@netless/white-snapshot": "^0.4.2",
63
65
  "@netless/window-manager": "^1.0.7-beta.6",
64
- "agora-foundation": "3.10.2",
65
- "agora-rte-sdk": "3.10.2",
66
+ "agora-foundation": "3.11.0-rc.2",
67
+ "agora-rte-sdk": "3.11.0-rc.2",
66
68
  "await-to-js": "^3.0.0",
67
69
  "dayjs": "^1.10.4",
68
70
  "easemob-websdk": "4.13.0",