fcr-core 3.11.0-rc.7 → 3.11.0-rc.9
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/media-control/type.d.ts +6 -0
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +1 -1
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +2 -2
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +7 -0
- package/lib/room-control/whiteboard-control-v2/base/index.js +75 -35
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +75 -35
- package/package.json +4 -4
|
@@ -163,6 +163,12 @@ export interface FcrAudioEffectEnhancer {
|
|
|
163
163
|
* Disables AGC for the audio track.
|
|
164
164
|
*/
|
|
165
165
|
disableAGC(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Sets the Windows system-level audio preprocessing (hardware 3A) mode.
|
|
168
|
+
* Only effective on Electron Windows.
|
|
169
|
+
* @param mode `0` off (default), `1` on, `2` only enabled under speaker routing.
|
|
170
|
+
*/
|
|
171
|
+
setWindowsSystemAudioPreprocessingMode(mode: number): void;
|
|
166
172
|
}
|
|
167
173
|
export interface FcrVideoEffectEnhancer {
|
|
168
174
|
/**
|
|
@@ -7,7 +7,7 @@ import { FcrReturnCode } from '../../type';
|
|
|
7
7
|
import { FcrBoardEraserSize, FcrBoardMainWindow_V1, FcrBoardPage, FcrBoardWindowObserver } from './type';
|
|
8
8
|
import { FcrColor } from '../whiteboard-control/type';
|
|
9
9
|
export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow_V1 {
|
|
10
|
-
protected logger: import("agora-
|
|
10
|
+
protected logger: import("agora-rte-sdk/lib/imports").Logger;
|
|
11
11
|
private _whiteBoardroom;
|
|
12
12
|
private _whiteView;
|
|
13
13
|
private _windowManager?;
|
|
@@ -9,7 +9,7 @@ export declare class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlIm
|
|
|
9
9
|
protected config: FcrAnnotationConfig;
|
|
10
10
|
private _sceneConfig;
|
|
11
11
|
private _api;
|
|
12
|
-
protected logger: import("agora-
|
|
12
|
+
protected logger: import("agora-rte-sdk/lib/imports").Logger;
|
|
13
13
|
constructor(rtmClient: RTMClient, config: FcrAnnotationConfig, forgeInitConfigFetcher: () => Promise<FcrBoardRoomConfig>, _sceneConfig: FcrAnnotationSceneConfig, _api: FcrCoreServiceApi);
|
|
14
14
|
syncScreenShareOwnerAnnotationOpenDone(): Promise<number>;
|
|
15
15
|
syncWhiteboardWriteCount(isWritable: boolean): Promise<number>;
|
|
@@ -21,7 +21,7 @@ export declare class FcrStandaloneAnnotationControlImpl extends FcrBaseWhiteboar
|
|
|
21
21
|
protected rtmClient: RTMClient;
|
|
22
22
|
protected config: FcrAnnotationConfig;
|
|
23
23
|
private _sceneConfig;
|
|
24
|
-
protected logger: import("agora-
|
|
24
|
+
protected logger: import("agora-rte-sdk/lib/imports").Logger;
|
|
25
25
|
constructor(rtmClient: RTMClient, config: FcrAnnotationConfig, forgeInitConfigFetcher: () => Promise<FcrBoardRoomConfig>, _sceneConfig: Omit<FcrAnnotationSceneConfig, 'getBoardPerformance' | 'sceneId'>);
|
|
26
26
|
open(): Promise<FcrBoardMainWindow>;
|
|
27
27
|
protected getApplicationId(): string;
|
|
@@ -7,6 +7,10 @@ import { FcrConnectionState } from '../../../type';
|
|
|
7
7
|
import { FcrCoreServiceApi } from '../../../service/api';
|
|
8
8
|
import { FcrBaseWhiteboardControl, FcrBaseWhiteboardObserver, FcrBoardMainWindow, FcrBoardRoomConfig } from '../type';
|
|
9
9
|
import { FcrBoardConfig } from '../whiteboard-control/type';
|
|
10
|
+
type BoardRoomAttempt = {
|
|
11
|
+
boardRoom: Room;
|
|
12
|
+
getWhiteboard: () => Promise<Whiteboard>;
|
|
13
|
+
};
|
|
10
14
|
export declare class FcrBaseWhiteboardControlImpl<T extends FcrBaseWhiteboardObserver> implements FcrBaseWhiteboardControl<T> {
|
|
11
15
|
protected rtmClient: RTMClient;
|
|
12
16
|
protected config: FcrBoardConfig;
|
|
@@ -34,6 +38,8 @@ export declare class FcrBaseWhiteboardControlImpl<T extends FcrBaseWhiteboardObs
|
|
|
34
38
|
removeObserver(observer: T): void;
|
|
35
39
|
protected internalOpen(isNeedLaunch: boolean): Promise<FcrBoardMainWindow>;
|
|
36
40
|
protected updateConnectionState(state: FcrConnectionState): void;
|
|
41
|
+
protected createBoardRoomAttempt(boardId: string, appId: string, whiteboardOption: WhiteboardOption, isNeedLaunch: boolean): BoardRoomAttempt;
|
|
42
|
+
protected releaseBoardRoomAttempt(boardRoom: Room): Promise<void>;
|
|
37
43
|
protected connect(isNeedLaunch: boolean): Promise<FcrBoardMainWindow>;
|
|
38
44
|
protected getApplicationId(): string;
|
|
39
45
|
protected getWhiteboardOption(): WhiteboardOption;
|
|
@@ -42,3 +48,4 @@ export declare class FcrBaseWhiteboardControlImpl<T extends FcrBaseWhiteboardObs
|
|
|
42
48
|
private _checkForConnect;
|
|
43
49
|
private _clearWaitPromise;
|
|
44
50
|
}
|
|
51
|
+
export {};
|
|
@@ -161,6 +161,42 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
161
161
|
this.logger.info("Connection state updated: ".concat(_type.FcrConnectionState[oldState], " -> ").concat(_type.FcrConnectionState[state]));
|
|
162
162
|
this.observable.notifyObservers('onConnectionStateUpdated', state);
|
|
163
163
|
}
|
|
164
|
+
createBoardRoomAttempt(boardId, appId, whiteboardOption, isNeedLaunch) {
|
|
165
|
+
const rtmProvider = new _forgeRtm.RTMProvider_2_2(this.rtmClient);
|
|
166
|
+
const boardRoom = new _forgeRoom.Room(boardId, rtmProvider);
|
|
167
|
+
this.logger.info('ApplicationManager.registerApplication calling');
|
|
168
|
+
boardRoom.applicationManager.registerApplication(_forgeWhiteboard.WhiteboardApplication);
|
|
169
|
+
if (isNeedLaunch) {
|
|
170
|
+
return {
|
|
171
|
+
boardRoom,
|
|
172
|
+
getWhiteboard: () => {
|
|
173
|
+
this.logger.info("ApplicationManager.launchApplication calling, appId: ".concat(appId, ", option: ").concat((0, _imports.jsonstring)(whiteboardOption)));
|
|
174
|
+
return boardRoom.applicationManager.launchApplication(_forgeWhiteboard.WhiteboardApplication, whiteboardOption, appId);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const launchPromise = new Promise(resolve => {
|
|
179
|
+
this.logger.info('ApplicationManager.once launch event listening');
|
|
180
|
+
boardRoom.applicationManager.once('launch', (applicationId, app) => {
|
|
181
|
+
this.logger.info("ApplicationManager.launch event received, appId: ".concat(applicationId));
|
|
182
|
+
resolve(app);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
return {
|
|
186
|
+
boardRoom,
|
|
187
|
+
getWhiteboard: () => launchPromise
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
async releaseBoardRoomAttempt(boardRoom) {
|
|
191
|
+
try {
|
|
192
|
+
this.logger.info('ApplicationManager.removeAllListeners calling after a failed board attempt');
|
|
193
|
+
boardRoom.applicationManager.removeAllListeners();
|
|
194
|
+
this.logger.info('Room.leaveRoom calling after a failed board attempt');
|
|
195
|
+
await boardRoom.leaveRoom();
|
|
196
|
+
} catch (error) {
|
|
197
|
+
this.logger.error('release failed board room attempt failed', error);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
164
200
|
async connect(isNeedLaunch) {
|
|
165
201
|
if (this.boardView) {
|
|
166
202
|
this.logger.info('board already connected, returning existing board view');
|
|
@@ -169,8 +205,16 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
169
205
|
const abortController = new AbortController();
|
|
170
206
|
this._openAbortController = abortController;
|
|
171
207
|
return new Promise(async (resolve, reject) => {
|
|
172
|
-
|
|
208
|
+
let activeAttempt = null;
|
|
209
|
+
const releaseActiveAttempt = async () => {
|
|
210
|
+
const attempt = activeAttempt;
|
|
211
|
+
activeAttempt = null;
|
|
212
|
+
if (attempt) {
|
|
213
|
+
await this.releaseBoardRoomAttempt(attempt.boardRoom);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
173
216
|
abortController.signal.addEventListener('abort', () => {
|
|
217
|
+
void releaseActiveAttempt();
|
|
174
218
|
reject(new Error('join board aborted'));
|
|
175
219
|
});
|
|
176
220
|
const _this$config = this.config,
|
|
@@ -214,38 +258,17 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
214
258
|
this.logger.error("ipList in config is empty or invalid: ".concat((0, _imports.jsonstring)(ipList), ", ignore ipList config"));
|
|
215
259
|
}
|
|
216
260
|
}
|
|
217
|
-
const rtmProvider = new _forgeRtm.RTMProvider_2_2(this.rtmClient);
|
|
218
|
-
const wbRoom = new _forgeRoom.Room(boardId, rtmProvider);
|
|
219
|
-
this.logger.info('ApplicationManager.registerApplication calling');
|
|
220
|
-
wbRoom.applicationManager.registerApplication(_forgeWhiteboard.WhiteboardApplication);
|
|
221
261
|
try {
|
|
222
262
|
this.updateConnectionState(_type.FcrConnectionState.CONNECTING);
|
|
223
263
|
let error = null;
|
|
224
264
|
let boardView = null;
|
|
225
265
|
let whiteboard = null;
|
|
226
|
-
let boardRoom =
|
|
266
|
+
let boardRoom = null;
|
|
227
267
|
const appId = this.getApplicationId();
|
|
228
|
-
let getWhiteboard;
|
|
229
|
-
|
|
230
|
-
// 第一个开启白板的人需要调用 launch 方法, 其他人监听 launch 事件获取白板实例
|
|
231
|
-
if (isNeedLaunch) {
|
|
232
|
-
getWhiteboard = () => {
|
|
233
|
-
this.logger.info("ApplicationManager.launchApplication calling, appId: ".concat(appId, ", option: ").concat((0, _imports.jsonstring)(whiteboardOption)));
|
|
234
|
-
return wbRoom.applicationManager.launchApplication(_forgeWhiteboard.WhiteboardApplication, whiteboardOption, appId);
|
|
235
|
-
};
|
|
236
|
-
} else {
|
|
237
|
-
const launchPromise = new Promise((launchPromseResolve, launchPromseReject) => {
|
|
238
|
-
this.logger.info('ApplicationManager.once launch event listening');
|
|
239
|
-
wbRoom.applicationManager.once('launch', (appId, app) => {
|
|
240
|
-
this.logger.info("ApplicationManager.launch event received, appId: ".concat(appId));
|
|
241
|
-
launchPromseResolve(app);
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
getWhiteboard = () => {
|
|
245
|
-
return launchPromise;
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
268
|
var _await$to = await (0, _imports.to)((0, _imports.retryAttempt)(async () => {
|
|
269
|
+
await releaseActiveAttempt();
|
|
270
|
+
const attempt = this.createBoardRoomAttempt(boardId, appId, whiteboardOption, isNeedLaunch);
|
|
271
|
+
activeAttempt = attempt;
|
|
249
272
|
const joinRoomParams = {
|
|
250
273
|
userId,
|
|
251
274
|
nickName: userName || userId,
|
|
@@ -261,9 +284,15 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
261
284
|
this.logger.info("Room.joinRoom calling, params: ".concat((0, _imports.jsonstring)(joinRoomParams), ", timeout: ").concat(WHITEBOARD_ROOM_JOIN_TIMEOUT));
|
|
262
285
|
|
|
263
286
|
// 20 秒超时
|
|
264
|
-
await
|
|
265
|
-
|
|
266
|
-
|
|
287
|
+
await attempt.boardRoom.joinRoom(joinRoomParams, WHITEBOARD_ROOM_JOIN_TIMEOUT);
|
|
288
|
+
if (abortController.signal.aborted) {
|
|
289
|
+
throw new Error('join board aborted');
|
|
290
|
+
}
|
|
291
|
+
whiteboard = await attempt.getWhiteboard();
|
|
292
|
+
if (abortController.signal.aborted) {
|
|
293
|
+
throw new Error('join board aborted');
|
|
294
|
+
}
|
|
295
|
+
boardRoom = attempt.boardRoom;
|
|
267
296
|
if (isNeedLaunch) {
|
|
268
297
|
// 在同一个房间内只有第一次调用 launchApplication 时传入的宽高参数会生效, 后续的调用不会生效, 所以需要在这里更新宽高
|
|
269
298
|
// 只有 launch 的用户需要更新宽、高, 白板会自动同步给后加入的用户
|
|
@@ -276,6 +305,7 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
276
305
|
let error = _ref2.error,
|
|
277
306
|
timeFn = _ref2.timeFn,
|
|
278
307
|
currentRetry = _ref2.currentRetry;
|
|
308
|
+
await releaseActiveAttempt();
|
|
279
309
|
if (abortController.signal.aborted) {
|
|
280
310
|
throw new Error('join board aborted');
|
|
281
311
|
}
|
|
@@ -286,22 +316,31 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
286
316
|
var _await$to2 = (0, _slicedToArray2.default)(_await$to, 1);
|
|
287
317
|
error = _await$to2[0];
|
|
288
318
|
if (abortController.signal.aborted) {
|
|
319
|
+
await releaseActiveAttempt();
|
|
289
320
|
throw new Error('join board aborted');
|
|
290
321
|
}
|
|
291
322
|
if (error) {
|
|
323
|
+
await releaseActiveAttempt();
|
|
292
324
|
this.logger.error("join board failed, ".concat(error.message, "-").concat(JSON.stringify(error)));
|
|
293
325
|
throw error;
|
|
294
326
|
}
|
|
327
|
+
const connectedBoardRoom = boardRoom;
|
|
328
|
+
const connectedWhiteboard = whiteboard;
|
|
329
|
+
if (!connectedBoardRoom || !connectedWhiteboard) {
|
|
330
|
+
await releaseActiveAttempt();
|
|
331
|
+
throw new Error('board attempt completed without a room or whiteboard');
|
|
332
|
+
}
|
|
295
333
|
this.logger.info('Whiteboard camera settings: enableCameraByMouse=false, enableCameraByTouch=false');
|
|
296
|
-
|
|
297
|
-
|
|
334
|
+
connectedWhiteboard.enableCameraByMouse = false;
|
|
335
|
+
connectedWhiteboard.enableCameraByTouch = false;
|
|
298
336
|
this.logger.info('Whiteboard.setViewModeToMain calling');
|
|
299
|
-
|
|
300
|
-
boardView = new _mainWindow.FcrBoardMainWindowImpl(
|
|
337
|
+
connectedWhiteboard.setViewModeToMain();
|
|
338
|
+
boardView = new _mainWindow.FcrBoardMainWindowImpl(connectedWhiteboard, connectedBoardRoom, appId, this.config.roomId, this.config.userId, this.api);
|
|
301
339
|
boardView.setBackgroundColor(this.getBackgroundColor());
|
|
302
|
-
this.whiteboard =
|
|
340
|
+
this.whiteboard = connectedWhiteboard;
|
|
303
341
|
this.boardView = boardView;
|
|
304
|
-
this.boardRoom =
|
|
342
|
+
this.boardRoom = connectedBoardRoom;
|
|
343
|
+
activeAttempt = null;
|
|
305
344
|
if (isNeedLaunch) {
|
|
306
345
|
// 所有人开启白板时都默认没有开启写权限, 需要写权限的地方需要自己手动开启
|
|
307
346
|
boardView.internalSetWritable(false);
|
|
@@ -314,6 +353,7 @@ class FcrBaseWhiteboardControlImpl {
|
|
|
314
353
|
this._clearWaitPromise();
|
|
315
354
|
}
|
|
316
355
|
} catch (e) {
|
|
356
|
+
await releaseActiveAttempt();
|
|
317
357
|
this.logger.error("join board failed");
|
|
318
358
|
this.updateConnectionState(_type.FcrConnectionState.DISCONNECTED);
|
|
319
359
|
reject(e);
|
|
@@ -156,6 +156,42 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
156
156
|
this.logger.info("Connection state updated: ".concat(FcrConnectionState[oldState], " -> ").concat(FcrConnectionState[state]));
|
|
157
157
|
this.observable.notifyObservers('onConnectionStateUpdated', state);
|
|
158
158
|
}
|
|
159
|
+
createBoardRoomAttempt(boardId, appId, whiteboardOption, isNeedLaunch) {
|
|
160
|
+
const rtmProvider = new RTMProvider_2_2(this.rtmClient);
|
|
161
|
+
const boardRoom = new Room(boardId, rtmProvider);
|
|
162
|
+
this.logger.info('ApplicationManager.registerApplication calling');
|
|
163
|
+
boardRoom.applicationManager.registerApplication(WhiteboardApplication);
|
|
164
|
+
if (isNeedLaunch) {
|
|
165
|
+
return {
|
|
166
|
+
boardRoom,
|
|
167
|
+
getWhiteboard: () => {
|
|
168
|
+
this.logger.info("ApplicationManager.launchApplication calling, appId: ".concat(appId, ", option: ").concat(jsonstring(whiteboardOption)));
|
|
169
|
+
return boardRoom.applicationManager.launchApplication(WhiteboardApplication, whiteboardOption, appId);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
const launchPromise = new Promise(resolve => {
|
|
174
|
+
this.logger.info('ApplicationManager.once launch event listening');
|
|
175
|
+
boardRoom.applicationManager.once('launch', (applicationId, app) => {
|
|
176
|
+
this.logger.info("ApplicationManager.launch event received, appId: ".concat(applicationId));
|
|
177
|
+
resolve(app);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
return {
|
|
181
|
+
boardRoom,
|
|
182
|
+
getWhiteboard: () => launchPromise
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
async releaseBoardRoomAttempt(boardRoom) {
|
|
186
|
+
try {
|
|
187
|
+
this.logger.info('ApplicationManager.removeAllListeners calling after a failed board attempt');
|
|
188
|
+
boardRoom.applicationManager.removeAllListeners();
|
|
189
|
+
this.logger.info('Room.leaveRoom calling after a failed board attempt');
|
|
190
|
+
await boardRoom.leaveRoom();
|
|
191
|
+
} catch (error) {
|
|
192
|
+
this.logger.error('release failed board room attempt failed', error);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
159
195
|
async connect(isNeedLaunch) {
|
|
160
196
|
if (this.boardView) {
|
|
161
197
|
this.logger.info('board already connected, returning existing board view');
|
|
@@ -164,8 +200,16 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
164
200
|
const abortController = new AbortController();
|
|
165
201
|
this._openAbortController = abortController;
|
|
166
202
|
return new Promise(async (resolve, reject) => {
|
|
167
|
-
|
|
203
|
+
let activeAttempt = null;
|
|
204
|
+
const releaseActiveAttempt = async () => {
|
|
205
|
+
const attempt = activeAttempt;
|
|
206
|
+
activeAttempt = null;
|
|
207
|
+
if (attempt) {
|
|
208
|
+
await this.releaseBoardRoomAttempt(attempt.boardRoom);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
168
211
|
abortController.signal.addEventListener('abort', () => {
|
|
212
|
+
void releaseActiveAttempt();
|
|
169
213
|
reject(new Error('join board aborted'));
|
|
170
214
|
});
|
|
171
215
|
const _this$config = this.config,
|
|
@@ -209,38 +253,17 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
209
253
|
this.logger.error("ipList in config is empty or invalid: ".concat(jsonstring(ipList), ", ignore ipList config"));
|
|
210
254
|
}
|
|
211
255
|
}
|
|
212
|
-
const rtmProvider = new RTMProvider_2_2(this.rtmClient);
|
|
213
|
-
const wbRoom = new Room(boardId, rtmProvider);
|
|
214
|
-
this.logger.info('ApplicationManager.registerApplication calling');
|
|
215
|
-
wbRoom.applicationManager.registerApplication(WhiteboardApplication);
|
|
216
256
|
try {
|
|
217
257
|
this.updateConnectionState(FcrConnectionState.CONNECTING);
|
|
218
258
|
let error = null;
|
|
219
259
|
let boardView = null;
|
|
220
260
|
let whiteboard = null;
|
|
221
|
-
let boardRoom =
|
|
261
|
+
let boardRoom = null;
|
|
222
262
|
const appId = this.getApplicationId();
|
|
223
|
-
let getWhiteboard;
|
|
224
|
-
|
|
225
|
-
// 第一个开启白板的人需要调用 launch 方法, 其他人监听 launch 事件获取白板实例
|
|
226
|
-
if (isNeedLaunch) {
|
|
227
|
-
getWhiteboard = () => {
|
|
228
|
-
this.logger.info("ApplicationManager.launchApplication calling, appId: ".concat(appId, ", option: ").concat(jsonstring(whiteboardOption)));
|
|
229
|
-
return wbRoom.applicationManager.launchApplication(WhiteboardApplication, whiteboardOption, appId);
|
|
230
|
-
};
|
|
231
|
-
} else {
|
|
232
|
-
const launchPromise = new Promise((launchPromseResolve, launchPromseReject) => {
|
|
233
|
-
this.logger.info('ApplicationManager.once launch event listening');
|
|
234
|
-
wbRoom.applicationManager.once('launch', (appId, app) => {
|
|
235
|
-
this.logger.info("ApplicationManager.launch event received, appId: ".concat(appId));
|
|
236
|
-
launchPromseResolve(app);
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
getWhiteboard = () => {
|
|
240
|
-
return launchPromise;
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
263
|
var _await$to = await to(retryAttempt(async () => {
|
|
264
|
+
await releaseActiveAttempt();
|
|
265
|
+
const attempt = this.createBoardRoomAttempt(boardId, appId, whiteboardOption, isNeedLaunch);
|
|
266
|
+
activeAttempt = attempt;
|
|
244
267
|
const joinRoomParams = {
|
|
245
268
|
userId,
|
|
246
269
|
nickName: userName || userId,
|
|
@@ -256,9 +279,15 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
256
279
|
this.logger.info("Room.joinRoom calling, params: ".concat(jsonstring(joinRoomParams), ", timeout: ").concat(WHITEBOARD_ROOM_JOIN_TIMEOUT));
|
|
257
280
|
|
|
258
281
|
// 20 秒超时
|
|
259
|
-
await
|
|
260
|
-
|
|
261
|
-
|
|
282
|
+
await attempt.boardRoom.joinRoom(joinRoomParams, WHITEBOARD_ROOM_JOIN_TIMEOUT);
|
|
283
|
+
if (abortController.signal.aborted) {
|
|
284
|
+
throw new Error('join board aborted');
|
|
285
|
+
}
|
|
286
|
+
whiteboard = await attempt.getWhiteboard();
|
|
287
|
+
if (abortController.signal.aborted) {
|
|
288
|
+
throw new Error('join board aborted');
|
|
289
|
+
}
|
|
290
|
+
boardRoom = attempt.boardRoom;
|
|
262
291
|
if (isNeedLaunch) {
|
|
263
292
|
// 在同一个房间内只有第一次调用 launchApplication 时传入的宽高参数会生效, 后续的调用不会生效, 所以需要在这里更新宽高
|
|
264
293
|
// 只有 launch 的用户需要更新宽、高, 白板会自动同步给后加入的用户
|
|
@@ -271,6 +300,7 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
271
300
|
let error = _ref2.error,
|
|
272
301
|
timeFn = _ref2.timeFn,
|
|
273
302
|
currentRetry = _ref2.currentRetry;
|
|
303
|
+
await releaseActiveAttempt();
|
|
274
304
|
if (abortController.signal.aborted) {
|
|
275
305
|
throw new Error('join board aborted');
|
|
276
306
|
}
|
|
@@ -281,22 +311,31 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
281
311
|
var _await$to2 = _slicedToArray(_await$to, 1);
|
|
282
312
|
error = _await$to2[0];
|
|
283
313
|
if (abortController.signal.aborted) {
|
|
314
|
+
await releaseActiveAttempt();
|
|
284
315
|
throw new Error('join board aborted');
|
|
285
316
|
}
|
|
286
317
|
if (error) {
|
|
318
|
+
await releaseActiveAttempt();
|
|
287
319
|
this.logger.error("join board failed, ".concat(error.message, "-").concat(JSON.stringify(error)));
|
|
288
320
|
throw error;
|
|
289
321
|
}
|
|
322
|
+
const connectedBoardRoom = boardRoom;
|
|
323
|
+
const connectedWhiteboard = whiteboard;
|
|
324
|
+
if (!connectedBoardRoom || !connectedWhiteboard) {
|
|
325
|
+
await releaseActiveAttempt();
|
|
326
|
+
throw new Error('board attempt completed without a room or whiteboard');
|
|
327
|
+
}
|
|
290
328
|
this.logger.info('Whiteboard camera settings: enableCameraByMouse=false, enableCameraByTouch=false');
|
|
291
|
-
|
|
292
|
-
|
|
329
|
+
connectedWhiteboard.enableCameraByMouse = false;
|
|
330
|
+
connectedWhiteboard.enableCameraByTouch = false;
|
|
293
331
|
this.logger.info('Whiteboard.setViewModeToMain calling');
|
|
294
|
-
|
|
295
|
-
boardView = new FcrBoardMainWindowImpl(
|
|
332
|
+
connectedWhiteboard.setViewModeToMain();
|
|
333
|
+
boardView = new FcrBoardMainWindowImpl(connectedWhiteboard, connectedBoardRoom, appId, this.config.roomId, this.config.userId, this.api);
|
|
296
334
|
boardView.setBackgroundColor(this.getBackgroundColor());
|
|
297
|
-
this.whiteboard =
|
|
335
|
+
this.whiteboard = connectedWhiteboard;
|
|
298
336
|
this.boardView = boardView;
|
|
299
|
-
this.boardRoom =
|
|
337
|
+
this.boardRoom = connectedBoardRoom;
|
|
338
|
+
activeAttempt = null;
|
|
300
339
|
if (isNeedLaunch) {
|
|
301
340
|
// 所有人开启白板时都默认没有开启写权限, 需要写权限的地方需要自己手动开启
|
|
302
341
|
boardView.internalSetWritable(false);
|
|
@@ -309,6 +348,7 @@ export class FcrBaseWhiteboardControlImpl {
|
|
|
309
348
|
this._clearWaitPromise();
|
|
310
349
|
}
|
|
311
350
|
} catch (e) {
|
|
351
|
+
await releaseActiveAttempt();
|
|
312
352
|
this.logger.error("join board failed");
|
|
313
353
|
this.updateConnectionState(FcrConnectionState.DISCONNECTED);
|
|
314
354
|
reject(e);
|
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.11.0-rc.
|
|
4
|
+
"version": "3.11.0-rc.9",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/lodash": "^4.14.168",
|
|
43
43
|
"@types/sinon": "^17.0.2",
|
|
44
44
|
"@types/uuid": "^8.3.0",
|
|
45
|
-
"agora-toolchain": "3.11.0-rc.
|
|
45
|
+
"agora-toolchain": "3.11.0-rc.9",
|
|
46
46
|
"core-js": "^3.33.3",
|
|
47
47
|
"decomment": "^0.9.5",
|
|
48
48
|
"husky": "^9.0.11",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@netless/video-js-plugin": "^0.3.8",
|
|
63
63
|
"@netless/white-snapshot": "^0.4.2",
|
|
64
64
|
"@netless/window-manager": "^1.0.7-beta.6",
|
|
65
|
-
"agora-foundation": "3.11.0-rc.
|
|
66
|
-
"agora-rte-sdk": "3.11.0-rc.
|
|
65
|
+
"agora-foundation": "3.11.0-rc.9",
|
|
66
|
+
"agora-rte-sdk": "3.11.0-rc.9",
|
|
67
67
|
"await-to-js": "^3.0.0",
|
|
68
68
|
"dayjs": "^1.10.4",
|
|
69
69
|
"easemob-websdk": "4.13.0",
|