fcr-ui-scene-mobile 3.7.2 → 3.7.3

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/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { FcrUISceneCreator } from './creator';
2
2
  export { FcrUIExitReason, FcrUserRole, FcrRegion, FcrStreamLatencyLevel } from './type';
3
+ import './plugins/browser-runtime-plugin';
3
4
  import './plugins/css-preset-plugin';
4
5
  import './plugins/multi-lang-plugin';
5
6
  import './plugins/rtm-plugin';
package/lib/index.js CHANGED
@@ -40,6 +40,7 @@ var _dayjs = _interopRequireDefault(require("dayjs"));
40
40
  var _duration = _interopRequireDefault(require("dayjs/plugin/duration"));
41
41
  var _creator = require("./creator");
42
42
  var _type = require("./type");
43
+ require("./plugins/browser-runtime-plugin");
43
44
  require("./plugins/css-preset-plugin");
44
45
  require("./plugins/multi-lang-plugin");
45
46
  require("./plugins/rtm-plugin");
@@ -7,7 +7,7 @@ import { FcrParticipantStore } from '../../common/participant-store';
7
7
  import { FcrUIEventStore } from '../../common/event-store';
8
8
  import { FcrDeviceStreamStore } from '../../common/device-stream-store';
9
9
  import { AgoraRtcVideoStreamType } from 'fcr-core/lib/imports';
10
- import { FcrWhiteboardControl } from 'fcr-core/lib/room-control/whiteboard-control-v2/whiteboard-control/type';
10
+ import { FcrPrivilegedWhiteboardControl } from 'fcr-core/lib/room-control/whiteboard-control-v2/whiteboard-control/type';
11
11
  export interface IMemberProps {
12
12
  streamControl: FcrStreamControl;
13
13
  deviceStore: FcrDeviceStore;
@@ -15,7 +15,7 @@ export interface IMemberProps {
15
15
  userControl: FcrUserControl;
16
16
  settingStore: SettingStore;
17
17
  uiEventStore: FcrUIEventStore;
18
- whiteBoredControl: FcrWhiteboardControl;
18
+ whiteBoredControl: FcrPrivilegedWhiteboardControl;
19
19
  participantStore: FcrParticipantStore;
20
20
  }
21
21
  export default class Store {
@@ -55,7 +55,6 @@ export default class StateBarStore {
55
55
  setScheduleInfo(scheduleInfo: FcrRoomSchedule): void;
56
56
  toggleLayout(layout: 'speaker' | 'gallery'): void;
57
57
  toggleLayoutBarLock(state: boolean): void;
58
- openVideoWindowDialog(): void;
59
58
  refreshLayoutSize(size: 16 | 25): void;
60
59
  release(): void;
61
60
  stopLiveStreamingDialog(): void;
@@ -4,6 +4,7 @@ require("core-js/modules/es.symbol.js");
4
4
  require("core-js/modules/es.symbol.description.js");
5
5
  require("core-js/modules/es.symbol.to-primitive.js");
6
6
  require("core-js/modules/es.error.cause.js");
7
+ require("core-js/modules/es.error.to-string.js");
7
8
  require("core-js/modules/es.array.is-array.js");
8
9
  require("core-js/modules/es.array.push.js");
9
10
  require("core-js/modules/es.date.to-primitive.js");
@@ -35,19 +36,13 @@ Object.defineProperty(exports, "__esModule", {
35
36
  value: true
36
37
  });
37
38
  exports["default"] = exports.GALLERY_MIN_SIZE = void 0;
38
- require("core-js/modules/es.error.to-string.js");
39
- require("core-js/modules/es.array.concat.js");
40
39
  require("core-js/modules/es.array.for-each.js");
41
- require("core-js/modules/es.array.includes.js");
42
40
  require("core-js/modules/es.array.iterator.js");
43
- require("core-js/modules/es.date.to-json.js");
44
41
  require("core-js/modules/es.function.bind.js");
45
- require("core-js/modules/es.json.stringify.js");
46
42
  require("core-js/modules/es.number.to-fixed.js");
47
43
  require("core-js/modules/es.object.assign.js");
48
44
  require("core-js/modules/es.object.to-string.js");
49
45
  require("core-js/modules/es.set.js");
50
- require("core-js/modules/es.string.includes.js");
51
46
  require("core-js/modules/es.string.iterator.js");
52
47
  require("core-js/modules/es.weak-map.js");
53
48
  require("core-js/modules/esnext.iterator.constructor.js");
@@ -77,12 +72,8 @@ require("core-js/modules/esnext.set.union.v2.js");
77
72
  require("core-js/modules/esnext.set.union.js");
78
73
  require("core-js/modules/esnext.weak-map.delete-all.js");
79
74
  require("core-js/modules/esnext.weak-map.emplace.js");
80
- require("core-js/modules/web.btoa.js");
81
75
  require("core-js/modules/web.dom-collections.for-each.js");
82
76
  require("core-js/modules/web.dom-collections.iterator.js");
83
- require("core-js/modules/web.dom-exception.constructor.js");
84
- require("core-js/modules/web.dom-exception.stack.js");
85
- require("core-js/modules/web.dom-exception.to-string-tag.js");
86
77
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
87
78
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
88
79
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -173,7 +164,6 @@ var StateBarStore = exports["default"] = /*#__PURE__*/function () {
173
164
  this._onNetworkQualityUpdated = this._onNetworkQualityUpdated.bind(this);
174
165
  this.toggleLayout = this.toggleLayout.bind(this);
175
166
  this.toggleLayoutBarLock = this.toggleLayoutBarLock.bind(this);
176
- this.openVideoWindowDialog = this.openVideoWindowDialog.bind(this);
177
167
  this._onCloudRecordingStateUpdated(((_this$_roomControl$ge = this._roomControl.getRoomInfo()) === null || _this$_roomControl$ge === void 0 ? void 0 : _this$_roomControl$ge.roomId) || '', this._roomControl.getCloudRecordingState());
178
168
  this._initRoomInfo();
179
169
  }
@@ -395,11 +385,6 @@ var StateBarStore = exports["default"] = /*#__PURE__*/function () {
395
385
  value: function toggleLayoutBarLock(state) {
396
386
  this._uiEventStore.sendEvent(_constant.UIAction.TOGGLE_LAYOUT_BAR_LOCK, state);
397
387
  }
398
- }, {
399
- key: "openVideoWindowDialog",
400
- value: function openVideoWindowDialog() {
401
- this._uiEventStore.openDialog(_constant.DialogKey.VIDEO_WINDOW);
402
- }
403
388
  }, {
404
389
  key: "refreshLayoutSize",
405
390
  value: function refreshLayoutSize(size) {
@@ -442,18 +427,9 @@ var StateBarStore = exports["default"] = /*#__PURE__*/function () {
442
427
  }, {
443
428
  key: "getShareLink",
444
429
  value: function getShareLink() {
445
- var _this$roomInfo, _this$roomInfo2, _this$localUser2;
446
- var info = {
447
- roomId: (_this$roomInfo = this.roomInfo) === null || _this$roomInfo === void 0 ? void 0 : _this$roomInfo.roomId,
448
- roomName: (_this$roomInfo2 = this.roomInfo) === null || _this$roomInfo2 === void 0 ? void 0 : _this$roomInfo2.roomName,
449
- userName: (_this$localUser2 = this.localUser) === null || _this$localUser2 === void 0 ? void 0 : _this$localUser2.userName
450
- };
451
- var strArgs = "info=".concat(btoa(encodeURIComponent(JSON.stringify(info))));
452
- var baseLink = "".concat(this._config.inviteLink);
453
- if (baseLink.includes('?')) {
454
- return "".concat(baseLink, "&").concat(strArgs);
455
- }
456
- return "".concat(baseLink, "?").concat(strArgs);
430
+ var _this$roomInfo;
431
+ var baseLink = "".concat((_this$roomInfo = this.roomInfo) === null || _this$roomInfo === void 0 ? void 0 : _this$roomInfo.inviteLink);
432
+ return baseLink;
457
433
  }
458
434
  }, {
459
435
  key: "toastCopyInfo",
@@ -1,9 +1,9 @@
1
1
  export declare const useVisibleTools: (diraction?: "horizontal") => {
2
- mainTools: ({
2
+ mainTools: {
3
3
  renderItem: ({ offset }?: {
4
4
  offset?: number;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
6
- } | undefined)[];
6
+ }[];
7
7
  additionTools: {
8
8
  renderItem: ({ offset }?: {
9
9
  offset?: number;
@@ -7,7 +7,7 @@ import { FcrStreamControl, FcrUserControl } from 'fcr-core';
7
7
  import { FcrSecurityStore } from '../../common/security-store';
8
8
  import { FcrUIVideoWindowLayoutType } from './type';
9
9
  import { FcrBaseRoomControl } from 'fcr-core/lib/room-control/type';
10
- import { FcrWhiteboardControl } from 'fcr-core/lib/room-control/whiteboard-control-v2/whiteboard-control/type';
10
+ import { FcrPrivilegedWhiteboardControl } from 'fcr-core/lib/room-control/whiteboard-control-v2/whiteboard-control/type';
11
11
  export declare class FcrWhiteboardUIModule extends UIModule {
12
12
  private _disposers;
13
13
  private _uiEventStore;
@@ -60,7 +60,7 @@ export declare class FcrWhiteboardUIModule extends UIModule {
60
60
  uiEventStore: FcrUIEventStore;
61
61
  userControl: FcrUserControl;
62
62
  roomControl: FcrBaseRoomControl;
63
- whiteboardControl: FcrWhiteboardControl;
63
+ whiteboardControl: FcrPrivilegedWhiteboardControl;
64
64
  streamControl: FcrStreamControl;
65
65
  securityStore: FcrSecurityStore;
66
66
  });
File without changes
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
5
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
+ require("core-js/modules/es.object.to-string.js");
7
+ require("core-js/modules/es.promise.js");
8
+ if (!window.runtime) {
9
+ window.runtime = {
10
+ screen: null,
11
+ browserWindow: null,
12
+ sendEvent: function sendEvent(event) {},
13
+ open: function open(entryPath) {},
14
+ close: function close(entryPath) {},
15
+ addEventListener: function addEventListener() {},
16
+ removeEventListener: function removeEventListener() {},
17
+ setFragmentOptions: function setFragmentOptions() {},
18
+ openDirectory: function openDirectory() {
19
+ return Promise.resolve(undefined);
20
+ },
21
+ showItemInFolder: function showItemInFolder() {},
22
+ openRendererWindow: function openRendererWindow() {},
23
+ closeRendererWindow: function closeRendererWindow() {},
24
+ getLaunchOptions: function getLaunchOptions() {
25
+ return null;
26
+ },
27
+ openLinkInDefaultBrowser: function openLinkInDefaultBrowser() {},
28
+ getSystemMemorySize: function getSystemMemorySize() {
29
+ return 0;
30
+ },
31
+ getSystemCpuInfo: function getSystemCpuInfo() {
32
+ return [];
33
+ },
34
+ getNetworkType: function getNetworkType() {
35
+ return Promise.resolve({
36
+ isWifiConnected: false,
37
+ connection: ''
38
+ });
39
+ },
40
+ quitApp: function quitApp() {},
41
+ setFragmentBaseUrl: function setFragmentBaseUrl() {},
42
+ getBrowserWindowById: function getBrowserWindowById(id) {
43
+ return undefined;
44
+ },
45
+ captureScreen: function captureScreen() {},
46
+ getResourceByFileType: function getResourceByFileType() {
47
+ return Promise.resolve([]);
48
+ },
49
+ fileToBlob: function fileToBlob() {
50
+ return new Blob();
51
+ },
52
+ registerListenerReady: function registerListenerReady() {},
53
+ releaseSubAllWindowRefs: function releaseSubAllWindowRefs() {},
54
+ getMediaSourceIdList: function getMediaSourceIdList() {
55
+ return [];
56
+ },
57
+ setInMeetingState: function setInMeetingState() {},
58
+ restartApp: function restartApp() {},
59
+ getBundleType: function getBundleType() {
60
+ return Promise.resolve('JS_BUNDLE');
61
+ },
62
+ checkMediaPermission: function () {
63
+ var _checkMediaPermission = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(mediaType) {
64
+ return _regenerator["default"].wrap(function (_context) {
65
+ while (1) switch (_context.prev = _context.next) {
66
+ case 0:
67
+ return _context.abrupt("return", true);
68
+ case 1:
69
+ case "end":
70
+ return _context.stop();
71
+ }
72
+ }, _callee);
73
+ }));
74
+ function checkMediaPermission(_x) {
75
+ return _checkMediaPermission.apply(this, arguments);
76
+ }
77
+ return checkMediaPermission;
78
+ }(),
79
+ openSystemPreferences: function openSystemPreferences() {},
80
+ getUserSettingData: function getUserSettingData() {
81
+ return {};
82
+ },
83
+ setUserSettingData: function setUserSettingData() {},
84
+ getActiveWindow: function getActiveWindow() {
85
+ return undefined;
86
+ },
87
+ getWindows: function getWindows() {
88
+ return [];
89
+ },
90
+ initSDK: function initSDK() {},
91
+ getIsSDKReady: function getIsSDKReady() {
92
+ return Promise.resolve(false);
93
+ },
94
+ openSetting: function openSetting() {},
95
+ loadBuiltinResources: function loadBuiltinResources() {
96
+ return Promise.resolve({
97
+ virtualBackgroundImages: [],
98
+ virtualBackgroundVideos: [],
99
+ soundEffects: []
100
+ });
101
+ },
102
+ launchSuccess: function launchSuccess(roomId) {},
103
+ launchFailure: function launchFailure(roomId, errorCode) {},
104
+ onSetParameters: function onSetParameters(parameters) {},
105
+ setParameters: function setParameters(parameters) {},
106
+ getIsMeetingLaunched: function getIsMeetingLaunched() {
107
+ return Promise.resolve(false);
108
+ }
109
+ };
110
+ }
@@ -0,0 +1,95 @@
1
+ export {};
2
+ declare global {
3
+ interface Runtime {
4
+ sendEvent: (event: RendererCustomEvent) => void;
5
+ open(entryPath: string, dialogId?: string): void;
6
+ close(entryPath: string, dialogId?: string): void;
7
+ openRendererWindow(
8
+ frameName: string,
9
+ renderFn: (
10
+ dom: Element,
11
+ browserWindow: Electron.BrowserWindow,
12
+ newRendererWindow: Window,
13
+ ) => void,
14
+ windowOptions: import('electron').BrowserWindowConstructorOptions,
15
+ ): void;
16
+ closeRendererWindow(frameName: string): void;
17
+ addEventListener(
18
+ listener: (ipcEvent: import('electron').IpcRendererEvent, event: RendererCustomEvent) => void,
19
+ ): void;
20
+ removeEventListener(
21
+ listener: (ipcEvent: import('electron').IpcRendererEvent, event: RendererCustomEvent) => void,
22
+ ): void;
23
+
24
+ browserWindow: import('electron').BrowserWindow;
25
+ captureScreen(options?: { hideWindow?: boolean; alwaysHide?: boolean }): void;
26
+ setFragmentOptions(
27
+ entryPath: string,
28
+ windowOptions: import('electron').BrowserWindowConstructorOptions,
29
+ webPreferences: import('electron').WebPreferences,
30
+ ): void;
31
+ getLaunchOptions?(): Promise<Record<string, any>>;
32
+ openLinkInDefaultBrowser(url: string): void;
33
+ openDirectory(): Promise<string | undefined>;
34
+ showItemInFolder(path: string): void;
35
+ screen: Electron.Screen;
36
+ launch?(options: any): void;
37
+ quitApp(): void;
38
+ getSystemMemorySize(): number;
39
+ getSystemCpuInfo(): import('os').CpuInfo[];
40
+ getNetworkType(): Promise<NetworkType>;
41
+ setFragmentBaseUrl(isDev: boolean, baseUrl: string): void;
42
+ getBrowserWindowById(id: number): import('electron').BrowserWindow | undefined;
43
+ getResourceByFileType(
44
+ url: string,
45
+ md5Url: string,
46
+ type: 'image' | 'video' | 'audio',
47
+ ): Promise<string[]>;
48
+ fileToBlob(filePath: string, type: 'image' | 'video' | 'audio'): Blob;
49
+ registerListenerReady(): void;
50
+ releaseSubAllWindowRefs(): void;
51
+ getMediaSourceIdList(): { title: string; mediaSourceId: string }[];
52
+ setInMeetingState(state: 0 | 1): void;
53
+ restartApp(): void;
54
+ getBundleType(): Promise<'JS_BUNDLE' | 'NATIVE_BUNDLE'>;
55
+ checkMediaPermission(mediaType: 'microphone' | 'camera' | 'sharing'): Promise<boolean>;
56
+ openSystemPreferences(mediaType: 'microphone' | 'camera' | 'sharing'): void;
57
+ getUserSettingData(): object;
58
+ setUserSettingData(data: object): void;
59
+ getActiveWindow(): WindowManager | undefined;
60
+ getWindows(): WindowManager[];
61
+ onCreatorInit?: (initOptions: any) => void;
62
+ onSettingOpen?: () => void;
63
+ onSettingClose?: () => void;
64
+ onLaunchMeeting?: (launchOptions: any) => void;
65
+ onRenewUserToken?: (token: string) => void;
66
+ initSDK: (options: any) => void;
67
+ openSetting: () => void;
68
+ getIsSDKReady: () => Promise<boolean>;
69
+ onSDKReady?: () => void;
70
+ onLaunchFailure?: (roomId: string, errorCode: string) => void;
71
+ loadBuiltinResources: () => Promise<{
72
+ virtualBackgroundImages: string[];
73
+ virtualBackgroundVideos: string[];
74
+ soundEffects: string[];
75
+ }>;
76
+ launchSuccess: (roomId: string) => void;
77
+ onLaunchSuccess?: (roomId: string) => void;
78
+ launchFailure: (roomId: string, errorCode: number) => void;
79
+ onSetParameters?: (parameters: Record<string, unknown>) => void;
80
+ setParameters: (parameters: string) => void;
81
+ exitUiScene?: () => void;
82
+ onExitUiScene?: () => void;
83
+ exitedMeeting?: (roomId: string, reason: FcrUIExitReason) => void;
84
+ onExitedMeeting?: (roomId: string, reason: number) => void;
85
+ getIsMeetingLaunched: () => Promise<boolean>;
86
+ onWidgetClicked?: (widgetId: string) => void;
87
+ onUserTokenWillExpire?: () => void;
88
+ onRefreshUserToken?: () => void;
89
+ refreshUserToken?: (token: string) => void;
90
+ }
91
+
92
+ interface Window {
93
+ runtime: Runtime;
94
+ }
95
+ }
@@ -1889,4 +1889,5 @@ export declare const enUs: {
1889
1889
  fmt_jbh_title_host_not_in_meeting: string;
1890
1890
  fmt_jbh_title_host_in_meeting: string;
1891
1891
  fmt_jbh_title_meeting_topic: string;
1892
+ fmt_jbh_toast_meeting_not_start: string;
1892
1893
  };
@@ -1895,5 +1895,6 @@ var enUs = exports.enUs = {
1895
1895
  fmt_hostkey_meetingroom_toast_unable_to_claim_host: 'Unable to claim host role because there is already a host in the meeting',
1896
1896
  fmt_jbh_title_host_not_in_meeting: 'The meeting has not started yet',
1897
1897
  fmt_jbh_title_host_in_meeting: 'Please wait.The host will let you into the meeting soon.',
1898
- fmt_jbh_title_meeting_topic: 'Meeting Topic'
1898
+ fmt_jbh_title_meeting_topic: 'Meeting Topic',
1899
+ fmt_jbh_toast_meeting_not_start: "The meeting hasn't started yet. Please try again later."
1899
1900
  };
@@ -1887,4 +1887,5 @@ export declare const zhCn: {
1887
1887
  fmt_jbh_title_host_not_in_meeting: string;
1888
1888
  fmt_jbh_title_host_in_meeting: string;
1889
1889
  fmt_jbh_title_meeting_topic: string;
1890
+ fmt_jbh_toast_meeting_not_start: string;
1890
1891
  };
@@ -1893,5 +1893,6 @@ var zhCn = exports.zhCn = {
1893
1893
  fmt_hostkey_meetingroom_toast_unable_to_claim_host: '会议已有主持人,无法通过密钥获取主持人权限',
1894
1894
  fmt_jbh_title_host_not_in_meeting: '会议未开始,等待主持人进入',
1895
1895
  fmt_jbh_title_host_in_meeting: '请稍等,主持人即将邀请您入会',
1896
- fmt_jbh_title_meeting_topic: '会议主题'
1896
+ fmt_jbh_title_meeting_topic: '会议主题',
1897
+ fmt_jbh_toast_meeting_not_start: '会议暂未开始,请稍后再试'
1897
1898
  };
@@ -16,6 +16,8 @@ export declare class DefaultSceneUIManager {
16
16
  private _mainRoomControl?;
17
17
  private _waitingRoomControl?;
18
18
  private _chatModule?;
19
+ private _roomRouter;
20
+ private _roomRouterObserver;
19
21
  _participantsModule: any;
20
22
  _stateBarUIModule?: FcrMobileStateBarUIModule;
21
23
  _mediaPlayerModule?: MediaPlayerUIModule;
package/lib/ui-manager.js CHANGED
@@ -3,6 +3,8 @@
3
3
  require("core-js/modules/es.symbol.js");
4
4
  require("core-js/modules/es.symbol.description.js");
5
5
  require("core-js/modules/es.symbol.to-primitive.js");
6
+ require("core-js/modules/es.error.cause.js");
7
+ require("core-js/modules/es.error.to-string.js");
6
8
  require("core-js/modules/es.array.is-array.js");
7
9
  require("core-js/modules/es.array.iterator.js");
8
10
  require("core-js/modules/es.array.push.js");
@@ -38,8 +40,6 @@ Object.defineProperty(exports, "__esModule", {
38
40
  value: true
39
41
  });
40
42
  exports.DefaultSceneUIManager = void 0;
41
- require("core-js/modules/es.error.cause.js");
42
- require("core-js/modules/es.error.to-string.js");
43
43
  require("core-js/modules/es.object.to-string.js");
44
44
  require("core-js/modules/es.promise.js");
45
45
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
@@ -88,6 +88,7 @@ function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.descr
88
88
  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; }
89
89
  var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/function () {
90
90
  function DefaultSceneUIManager(_sceneConfig, _engine, _observable) {
91
+ var _this = this;
91
92
  (0, _classCallCheck2["default"])(this, DefaultSceneUIManager);
92
93
  // @internal
93
94
  (0, _defineProperty2["default"])(this, "logger", (_initProto(this), (0, _logger.createLogger)({
@@ -97,11 +98,51 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
97
98
  (0, _defineProperty2["default"])(this, "_roomObserver", {});
98
99
  // @internal
99
100
  (0, _defineProperty2["default"])(this, "_eventObserver", {});
101
+ (0, _defineProperty2["default"])(this, "_roomRouterObserver", {
102
+ onRoomJoined: function onRoomJoined(roomControl) {
103
+ // nextStep: FcrRoomControlType
104
+ var roomInfo = roomControl.getRoomInfo();
105
+ if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.Mainroom) {
106
+ _this._mainRoomControl = roomControl;
107
+ _this._mainRoomControl.addObserver(_this._roomObserver);
108
+ // @ts-ignore
109
+ window.__mainRoom_control = roomControl;
110
+ _this.renderMainMobile();
111
+ return _type5.FcrRoomType.Mainroom;
112
+ } else if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.Waitingroom) {
113
+ _this._waitingRoomControl = roomControl;
114
+ if (_this._waitingRoomControl) {
115
+ _this._waitingRoomControl.leave();
116
+ _this._observable.notifyObservers('onExited', _this._sceneConfig.roomId, _type.FcrUIExitReason.LEAVE_ROOM);
117
+ }
118
+ _toast.FcrToastApi.open({
119
+ toastProps: {
120
+ type: 'error',
121
+ content: (0, _i18n.transI18n)('fmt_h_tips_host_enabled_waiting_room')
122
+ }
123
+ });
124
+ } else if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.JoinBeforeHostWaitingRoom) {
125
+ _this._waitingRoomControl = roomControl;
126
+ if (_this._waitingRoomControl) {
127
+ _this._waitingRoomControl.leave();
128
+ _this._observable.notifyObservers('onExited', _this._sceneConfig.roomId, _type.FcrUIExitReason.LEAVE_ROOM);
129
+ }
130
+ _toast.FcrToastApi.open({
131
+ toastProps: {
132
+ type: 'error',
133
+ content: (0, _i18n.transI18n)('fmt_h_tips_host_enabled_waiting_room')
134
+ }
135
+ });
136
+ }
137
+ }
138
+ });
100
139
  this._sceneConfig = _sceneConfig;
101
140
  this._engine = _engine;
102
141
  this._observable = _observable;
103
142
  this._uiEventStore = new _eventStore.FcrUIEventStore();
104
143
  this._deviceStore = new _deviceStore.FcrDeviceStore(_sceneConfig.userName, this._engine.getMobileMediaControl());
144
+ this._roomRouter = this._engine.createRoomRouter(this._sceneConfig.roomId);
145
+ this._roomRouter.addObserver(this._roomRouterObserver);
105
146
  }
106
147
  return (0, _createClass2["default"])(DefaultSceneUIManager, [{
107
148
  key: "_initWhiteBoardUIModule",
@@ -122,11 +163,11 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
122
163
  }, {
123
164
  key: "_renderWithErrorBoundary",
124
165
  value: function _renderWithErrorBoundary(layoutComponent, spaceName) {
125
- var _this = this;
166
+ var _this2 = this;
126
167
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
127
168
  FallbackComponent: _errorFallback.ErrorFallback,
128
169
  onError: function onError(error, info) {
129
- return _this._logError(error, info, spaceName);
170
+ return _this2._logError(error, info, spaceName);
130
171
  },
131
172
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
132
173
  style: {
@@ -160,7 +201,7 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
160
201
  }, {
161
202
  key: "render",
162
203
  value: function render(dom) {
163
- var _this2 = this;
204
+ var _this3 = this;
164
205
  this._dom = dom;
165
206
  if (!this._dom) {
166
207
  this.logger.error('Scene UI cannot be rendered as dom is not exist');
@@ -171,12 +212,10 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
171
212
  return _regenerator["default"].wrap(function (_context) {
172
213
  while (1) switch (_context.prev = _context.next) {
173
214
  case 0:
174
- return _context.abrupt("return", _this2._engine.login().then(function () {
175
- return _this2._handleJoinRoom();
176
- }).then(function () {
177
- _this2.renderMainMobile();
215
+ return _context.abrupt("return", _this3._engine.login().then(function () {
216
+ return _this3._handleJoinRoom();
178
217
  })["catch"](function (e) {
179
- _this2._observable.notifyObservers('onLaunchFailure', _this2._sceneConfig.roomId, e);
218
+ _this3._observable.notifyObservers('onLaunchFailure', _this3._sceneConfig.roomId, e);
180
219
  }));
181
220
  case 1:
182
221
  case "end":
@@ -194,7 +233,7 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
194
233
  key: "renderMainMobile",
195
234
  value: function renderMainMobile() {
196
235
  var _this$_initChatUIModu,
197
- _this3 = this;
236
+ _this4 = this;
198
237
  /**
199
238
  * Common Stores
200
239
  */
@@ -292,14 +331,14 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
292
331
  this._eventObserver = {
293
332
  onEvent: function onEvent(action, payload) {
294
333
  if (action === _constant.UIAction.EXIT_ROOM) {
295
- _this3._observable.notifyObservers('onExited', _this3._sceneConfig.roomId, payload.reason, _this3._mainRoomControl);
334
+ _this4._observable.notifyObservers('onExited', _this4._sceneConfig.roomId, payload.reason, _this4._mainRoomControl);
296
335
  }
297
336
  }
298
337
  };
299
338
  this._roomObserver = {
300
339
  onRoomStateUpdated: function onRoomStateUpdated(roomId, state) {
301
340
  if (state === _type6.FcrRoomState.Closed) {
302
- _this3._observable.notifyObservers('onExited', roomId, _type.FcrUIExitReason.CLOSE_ROOM);
341
+ _this4._observable.notifyObservers('onExited', roomId, _type.FcrUIExitReason.CLOSE_ROOM);
303
342
  }
304
343
  }
305
344
  };
@@ -330,18 +369,18 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
330
369
  key: "_createRoomControl",
331
370
  value: function () {
332
371
  var _createRoomControl2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(roomId) {
333
- var _this4 = this;
372
+ var _this5 = this;
334
373
  return _regenerator["default"].wrap(function (_context3) {
335
374
  while (1) switch (_context3.prev = _context3.next) {
336
375
  case 0:
337
376
  return _context3.abrupt("return", new Promise(/*#__PURE__*/function () {
338
377
  var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve, reject) {
339
- var engine, config, streams, room, _t;
378
+ var engine, config, streams, _t;
340
379
  return _regenerator["default"].wrap(function (_context2) {
341
380
  while (1) switch (_context2.prev = _context2.next) {
342
381
  case 0:
343
- engine = _this4._engine;
344
- config = _this4._sceneConfig;
382
+ engine = _this5._engine;
383
+ config = _this5._sceneConfig;
345
384
  if (engine) {
346
385
  _context2.next = 1;
347
386
  break;
@@ -363,7 +402,7 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
363
402
  }
364
403
  _context2.prev = 2;
365
404
  _context2.next = 3;
366
- return engine.createRoomControlAndJoin(roomId, {
405
+ return _this5._roomRouter.joinRoom({
367
406
  userName: config.userName,
368
407
  userRole: config.userRole,
369
408
  userProperties: config.userProperties,
@@ -373,8 +412,7 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
373
412
  password: config.password
374
413
  });
375
414
  case 3:
376
- room = _context2.sent;
377
- resolve(room);
415
+ resolve();
378
416
  _context2.next = 5;
379
417
  break;
380
418
  case 4:
@@ -406,33 +444,12 @@ var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/functio
406
444
  key: "_handleJoinRoom",
407
445
  value: function () {
408
446
  var _handleJoinRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
409
- var _this5 = this;
447
+ var _this6 = this;
410
448
  return _regenerator["default"].wrap(function (_context4) {
411
449
  while (1) switch (_context4.prev = _context4.next) {
412
450
  case 0:
413
- return _context4.abrupt("return", this._createRoomControl(this._sceneConfig.roomId).then(function (room) {
414
- var roomInfo = room.getRoomInfo();
415
- if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.Mainroom) {
416
- _this5._mainRoomControl = room;
417
- _this5._mainRoomControl.addObserver(_this5._roomObserver);
418
- // @ts-ignore
419
- window.__mainRoom_control = room;
420
- return _type5.FcrRoomType.Mainroom;
421
- } else if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.Waitingroom) {
422
- _this5._waitingRoomControl = room;
423
- if (_this5._waitingRoomControl) {
424
- _this5._waitingRoomControl.leave();
425
- }
426
- _toast.FcrToastApi.open({
427
- toastProps: {
428
- type: 'error',
429
- content: (0, _i18n.transI18n)('fmt_h_tips_host_enabled_waiting_room')
430
- }
431
- });
432
- throw new Error('host_enabled_waiting_room');
433
- }
434
- })["catch"](function (e) {
435
- _this5._observable.notifyObservers('onLaunchFailure', _this5._sceneConfig.roomId, e);
451
+ return _context4.abrupt("return", this._createRoomControl(this._sceneConfig.roomId)["catch"](function (e) {
452
+ _this6._observable.notifyObservers('onLaunchFailure', _this6._sceneConfig.roomId, e);
436
453
  throw e;
437
454
  }));
438
455
  case 1:
@@ -4,5 +4,4 @@ export declare const createLogger: (opts: {
4
4
  prefix: string;
5
5
  database?: boolean;
6
6
  }) => import("agora-foundation/lib/logger").Logger;
7
- export declare const trace: (originalMethod: any, context: ClassMethodDecoratorContext) => void;
8
7
  export declare const generateLogObserver: <T>(logger: ReturnType<typeof _getLogger>, callbackMethods: (keyof T)[]) => T;
@@ -4,7 +4,7 @@ require("core-js/modules/es.object.define-property.js");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.trace = exports.getLogger = exports.generateLogObserver = exports.createLogger = void 0;
7
+ exports.getLogger = exports.generateLogObserver = exports.createLogger = void 0;
8
8
  require("core-js/modules/es.array.concat.js");
9
9
  require("core-js/modules/es.array.for-each.js");
10
10
  require("core-js/modules/es.object.to-string.js");
@@ -12,7 +12,6 @@ require("core-js/modules/esnext.iterator.constructor.js");
12
12
  require("core-js/modules/esnext.iterator.for-each.js");
13
13
  require("core-js/modules/web.dom-collections.for-each.js");
14
14
  var _logger = require("agora-foundation/lib/logger");
15
- var _decorator = require("agora-foundation/lib/decorator");
16
15
  var _logSerializer = require("agora-foundation/lib/decorator/log/log-serializer");
17
16
  var getLogger = exports.getLogger = function getLogger() {
18
17
  return (0, _logger.getLogger)({
@@ -26,7 +25,6 @@ var createLogger = exports.createLogger = function createLogger(opts) {
26
25
  database: opts.database
27
26
  });
28
27
  };
29
- var trace = exports.trace = _decorator.trace.to('ui-scene-mobile');
30
28
  var generateLogObserver = exports.generateLogObserver = function generateLogObserver(logger, callbackMethods) {
31
29
  var observer = {};
32
30
  callbackMethods.forEach(function (method) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fcr-ui-scene-mobile",
3
- "version": "3.7.2",
3
+ "version": "3.7.3",
4
4
  "main": "lib/index.js",
5
5
  "repository": "ssh://git@git.agoralab.co/aduc/fcr-ui-scene-mobile.git",
6
6
  "author": "agora.io",
@@ -14,12 +14,12 @@
14
14
  "dependencies": {
15
15
  "@react-spring/web": "^9.7.3",
16
16
  "@use-gesture/react": "^10.3.1",
17
- "agora-foundation": "~3.7.2",
18
- "agora-ui-foundation": "~3.7.2",
17
+ "agora-foundation": "~3.7.3",
18
+ "agora-ui-foundation": "~3.7.3",
19
19
  "classnames": "^2.5.1",
20
20
  "core-js": "^3.33.3",
21
21
  "dayjs": "^1.10.4",
22
- "fcr-core": "~3.7.2",
22
+ "fcr-core": "~3.7.3",
23
23
  "js-md5": "^0.8.3",
24
24
  "jszip": "^3.10.1",
25
25
  "lodash": "^4.17.21",
@@ -49,7 +49,7 @@
49
49
  "@types/react-dom": "^17.0.11",
50
50
  "@types/react-virtualized": "^9.21.30",
51
51
  "@types/tinycolor2": "^1.4.6",
52
- "agora-toolchain": "~3.7.2",
52
+ "agora-toolchain": "~3.7.3",
53
53
  "core-js": "^3.33.3",
54
54
  "husky": "^9.0.11",
55
55
  "lint-staged": "^15.2.2",