fcr-ui-scene-mobile 3.4.0
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/assets/ground_glass_bg.png +0 -0
- package/lib/base.d.ts +11 -0
- package/lib/base.js +39 -0
- package/lib/common/device-store.d.ts +86 -0
- package/lib/common/device-store.js +642 -0
- package/lib/common/device-stream-store.d.ts +26 -0
- package/lib/common/device-stream-store.js +298 -0
- package/lib/common/event-store.d.ts +124 -0
- package/lib/common/event-store.js +249 -0
- package/lib/common/global-context.d.ts +11 -0
- package/lib/common/global-context.js +9 -0
- package/lib/common/member-list-data-source.d.ts +28 -0
- package/lib/common/member-list-data-source.js +305 -0
- package/lib/common/participant-store.d.ts +195 -0
- package/lib/common/participant-store.js +1577 -0
- package/lib/common/security-store.d.ts +119 -0
- package/lib/common/security-store.js +948 -0
- package/lib/common/setting-store.d.ts +181 -0
- package/lib/common/setting-store.js +797 -0
- package/lib/common/type.d.ts +73 -0
- package/lib/common/type.js +22 -0
- package/lib/config/default-config.d.ts +32 -0
- package/lib/config/default-config.js +39 -0
- package/lib/config/setting-config.d.ts +16 -0
- package/lib/config/setting-config.js +17 -0
- package/lib/creator.d.ts +10 -0
- package/lib/creator.js +49 -0
- package/lib/global.d.ts +8 -0
- package/lib/hooks/meeting-time.d.ts +15 -0
- package/lib/hooks/meeting-time.js +92 -0
- package/lib/hooks/useIsNodePresent.d.ts +4 -0
- package/lib/hooks/useIsNodePresent.js +53 -0
- package/lib/hooks/useOnRefMount.d.ts +2 -0
- package/lib/hooks/useOnRefMount.js +27 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +50 -0
- package/lib/mobile-global.css +28 -0
- package/lib/modules/action-bar/bottom-icons.d.ts +17 -0
- package/lib/modules/action-bar/bottom-icons.js +160 -0
- package/lib/modules/action-bar/context.d.ts +2 -0
- package/lib/modules/action-bar/context.js +9 -0
- package/lib/modules/action-bar/index.css +33 -0
- package/lib/modules/action-bar/index.d.ts +27 -0
- package/lib/modules/action-bar/index.js +46 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.css +130 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.d.ts +19 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.js +252 -0
- package/lib/modules/action-bar/member-list-popup/attendee/list.d.ts +1 -0
- package/lib/modules/action-bar/member-list-popup/attendee/list.js +82 -0
- package/lib/modules/action-bar/member-list-popup/index.css +35 -0
- package/lib/modules/action-bar/member-list-popup/index.d.ts +7 -0
- package/lib/modules/action-bar/member-list-popup/index.js +40 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.css +0 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.d.ts +12 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.js +58 -0
- package/lib/modules/action-bar/more-popup/index.css +71 -0
- package/lib/modules/action-bar/more-popup/index.d.ts +2 -0
- package/lib/modules/action-bar/more-popup/index.js +126 -0
- package/lib/modules/action-bar/store.d.ts +196 -0
- package/lib/modules/action-bar/store.js +1425 -0
- package/lib/modules/action-bar/type.d.ts +6 -0
- package/lib/modules/action-bar/type.js +13 -0
- package/lib/modules/action-bar/view.d.ts +2 -0
- package/lib/modules/action-bar/view.js +75 -0
- package/lib/modules/audio-stream/ index.d.ts +19 -0
- package/lib/modules/audio-stream/ index.js +109 -0
- package/lib/modules/audio-stream/index.d.ts +25 -0
- package/lib/modules/audio-stream/index.js +135 -0
- package/lib/modules/chat/chat-bar/index.css +97 -0
- package/lib/modules/chat/chat-bar/index.d.ts +12 -0
- package/lib/modules/chat/chat-bar/index.js +129 -0
- package/lib/modules/chat/chat-notification/index.css +71 -0
- package/lib/modules/chat/chat-notification/index.d.ts +3 -0
- package/lib/modules/chat/chat-notification/index.js +75 -0
- package/lib/modules/chat/chat-select/index.css +183 -0
- package/lib/modules/chat/chat-select/index.d.ts +12 -0
- package/lib/modules/chat/chat-select/index.js +223 -0
- package/lib/modules/chat/contex.d.ts +2 -0
- package/lib/modules/chat/contex.js +9 -0
- package/lib/modules/chat/demo-wrapper.d.ts +1 -0
- package/lib/modules/chat/demo-wrapper.js +42 -0
- package/lib/modules/chat/index.css +108 -0
- package/lib/modules/chat/index.d.ts +28 -0
- package/lib/modules/chat/index.dev.d.ts +1 -0
- package/lib/modules/chat/index.dev.js +58 -0
- package/lib/modules/chat/index.js +208 -0
- package/lib/modules/chat/message-list.d.ts +22 -0
- package/lib/modules/chat/message-list.js +617 -0
- package/lib/modules/chat/mock.d.ts +2 -0
- package/lib/modules/chat/mock.js +283 -0
- package/lib/modules/chat/store.d.ts +183 -0
- package/lib/modules/chat/store.js +1101 -0
- package/lib/modules/chat/util.d.ts +6 -0
- package/lib/modules/chat/util.js +69 -0
- package/lib/modules/chat/view.d.ts +11 -0
- package/lib/modules/chat/view.js +414 -0
- package/lib/modules/layout/bottom-drawer/index.css +34 -0
- package/lib/modules/layout/bottom-drawer/index.d.ts +3 -0
- package/lib/modules/layout/bottom-drawer/index.js +129 -0
- package/lib/modules/layout/components/Layout.d.ts +1 -0
- package/lib/modules/layout/components/Layout.js +98 -0
- package/lib/modules/layout/components/equip-request-popup/index.css +30 -0
- package/lib/modules/layout/components/equip-request-popup/index.d.ts +3 -0
- package/lib/modules/layout/components/equip-request-popup/index.js +78 -0
- package/lib/modules/layout/components/index.css +78 -0
- package/lib/modules/layout/components/index.d.ts +2 -0
- package/lib/modules/layout/components/index.js +25 -0
- package/lib/modules/layout/context.d.ts +2 -0
- package/lib/modules/layout/context.js +9 -0
- package/lib/modules/layout/drawer-header/index.css +27 -0
- package/lib/modules/layout/drawer-header/index.d.ts +10 -0
- package/lib/modules/layout/drawer-header/index.js +54 -0
- package/lib/modules/layout/index.css +22 -0
- package/lib/modules/layout/index.d.ts +8 -0
- package/lib/modules/layout/index.js +47 -0
- package/lib/modules/layout/store.d.ts +59 -0
- package/lib/modules/layout/store.js +379 -0
- package/lib/modules/layout/type.d.ts +65 -0
- package/lib/modules/layout/type.js +52 -0
- package/lib/modules/layout/view.d.ts +2 -0
- package/lib/modules/layout/view.js +10 -0
- package/lib/modules/member-layout/context.d.ts +2 -0
- package/lib/modules/member-layout/context.js +9 -0
- package/lib/modules/member-layout/data.d.ts +2 -0
- package/lib/modules/member-layout/data.js +304 -0
- package/lib/modules/member-layout/grid/index.css +98 -0
- package/lib/modules/member-layout/grid/index.d.ts +21 -0
- package/lib/modules/member-layout/grid/index.js +316 -0
- package/lib/modules/member-layout/index.css +88 -0
- package/lib/modules/member-layout/index.d.ts +8 -0
- package/lib/modules/member-layout/index.js +45 -0
- package/lib/modules/member-layout/share-toast/index.css +30 -0
- package/lib/modules/member-layout/share-toast/index.d.ts +5 -0
- package/lib/modules/member-layout/share-toast/index.js +43 -0
- package/lib/modules/member-layout/speaker/index.css +30 -0
- package/lib/modules/member-layout/speaker/index.d.ts +9 -0
- package/lib/modules/member-layout/speaker/index.js +28 -0
- package/lib/modules/member-layout/store.d.ts +70 -0
- package/lib/modules/member-layout/store.js +479 -0
- package/lib/modules/member-layout/user/index.css +121 -0
- package/lib/modules/member-layout/user/index.d.ts +34 -0
- package/lib/modules/member-layout/user/index.js +355 -0
- package/lib/modules/member-layout/user/types.d.ts +16 -0
- package/lib/modules/member-layout/user/types.js +6 -0
- package/lib/modules/member-layout/view.d.ts +2 -0
- package/lib/modules/member-layout/view.js +225 -0
- package/lib/modules/state-bar/context.d.ts +2 -0
- package/lib/modules/state-bar/context.js +9 -0
- package/lib/modules/state-bar/index.css +79 -0
- package/lib/modules/state-bar/index.d.ts +17 -0
- package/lib/modules/state-bar/index.js +55 -0
- package/lib/modules/state-bar/leaving-room/index.css +14 -0
- package/lib/modules/state-bar/leaving-room/index.d.ts +7 -0
- package/lib/modules/state-bar/leaving-room/index.js +38 -0
- package/lib/modules/state-bar/meeting-detail/index.css +72 -0
- package/lib/modules/state-bar/meeting-detail/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/index.js +59 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/copy.d.ts +4 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/copy.js +81 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.css +92 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.js +188 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.css +27 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.js +87 -0
- package/lib/modules/state-bar/store.d.ts +76 -0
- package/lib/modules/state-bar/store.js +561 -0
- package/lib/modules/state-bar/view.d.ts +7 -0
- package/lib/modules/state-bar/view.js +215 -0
- package/lib/modules/whiteboard/app.d.ts +2 -0
- package/lib/modules/whiteboard/app.js +41 -0
- package/lib/modules/whiteboard/components/control-bar/index.css +53 -0
- package/lib/modules/whiteboard/components/control-bar/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/control-bar/index.js +156 -0
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +35 -0
- package/lib/modules/whiteboard/components/control-bar/store.js +288 -0
- package/lib/modules/whiteboard/components/loading/index.css +76 -0
- package/lib/modules/whiteboard/components/loading/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/loading/index.js +68 -0
- package/lib/modules/whiteboard/components/loading/loading.png +0 -0
- package/lib/modules/whiteboard/components/multi-window/index.css +65 -0
- package/lib/modules/whiteboard/components/multi-window/index.d.ts +5 -0
- package/lib/modules/whiteboard/components/multi-window/index.js +39 -0
- package/lib/modules/whiteboard/components/pagination/index.css +228 -0
- package/lib/modules/whiteboard/components/pagination/index.d.ts +15 -0
- package/lib/modules/whiteboard/components/pagination/index.js +163 -0
- package/lib/modules/whiteboard/components/pagination/store.d.ts +18 -0
- package/lib/modules/whiteboard/components/pagination/store.js +17 -0
- package/lib/modules/whiteboard/components/progress/index.d.ts +5 -0
- package/lib/modules/whiteboard/components/progress/index.js +43 -0
- package/lib/modules/whiteboard/components/progress/style.css +52 -0
- package/lib/modules/whiteboard/components/scene-pagination.d.ts +1 -0
- package/lib/modules/whiteboard/components/scene-pagination.js +30 -0
- package/lib/modules/whiteboard/components/switch-theme/index.css +98 -0
- package/lib/modules/whiteboard/components/switch-theme/index.d.ts +3 -0
- package/lib/modules/whiteboard/components/switch-theme/index.js +89 -0
- package/lib/modules/whiteboard/components/switch-theme/item.d.ts +9 -0
- package/lib/modules/whiteboard/components/switch-theme/item.js +53 -0
- package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +4 -0
- package/lib/modules/whiteboard/components/switch-theme/libs.js +29 -0
- package/lib/modules/whiteboard/components/toolbar/ style.css +588 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.d.ts +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.js +38 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +107 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +59 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +44 -0
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +89 -0
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +63 -0
- package/lib/modules/whiteboard/components/toolbar/components/history.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.js +39 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.js +66 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.d.ts +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +134 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +106 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +168 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +211 -0
- package/lib/modules/whiteboard/components/toolbar/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/index.js +183 -0
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +51 -0
- package/lib/modules/whiteboard/components/toolbar/store.js +248 -0
- package/lib/modules/whiteboard/context.d.ts +69 -0
- package/lib/modules/whiteboard/context.js +36 -0
- package/lib/modules/whiteboard/index.d.ts +119 -0
- package/lib/modules/whiteboard/index.js +1134 -0
- package/lib/modules/whiteboard/style.css +143 -0
- package/lib/modules/whiteboard/type.d.ts +94 -0
- package/lib/modules/whiteboard/type.js +89 -0
- package/lib/modules/whiteboard/utils.d.ts +12 -0
- package/lib/modules/whiteboard/utils.js +36 -0
- package/lib/plugins/css-preset-plugin.d.ts +1 -0
- package/lib/plugins/css-preset-plugin.js +29 -0
- package/lib/plugins/module-dev-plugin.d.ts +12 -0
- package/lib/plugins/module-dev-plugin.js +183 -0
- package/lib/plugins/multi-lang-plugin.d.ts +1 -0
- package/lib/plugins/multi-lang-plugin.js +19 -0
- package/lib/plugins/rtm-plugin.d.ts +1 -0
- package/lib/plugins/rtm-plugin.js +5 -0
- package/lib/plugins/web-rtc-plugin.d.ts +1 -0
- package/lib/plugins/web-rtc-plugin.js +5 -0
- package/lib/translations/enUS.d.ts +1855 -0
- package/lib/translations/enUS.js +1895 -0
- package/lib/translations/zhCN.d.ts +1852 -0
- package/lib/translations/zhCN.js +1892 -0
- package/lib/type.d.ts +121 -0
- package/lib/type.js +46 -0
- package/lib/ui-manager.d.ts +32 -0
- package/lib/ui-manager.js +426 -0
- package/lib/ui-scene.d.ts +14 -0
- package/lib/ui-scene.js +141 -0
- package/lib/utilities/board-context.d.ts +4 -0
- package/lib/utilities/board-context.js +12 -0
- package/lib/utilities/constant.d.ts +286 -0
- package/lib/utilities/constant.js +271 -0
- package/lib/utilities/copyText.d.ts +2 -0
- package/lib/utilities/copyText.js +43 -0
- package/lib/utilities/extract.d.ts +5 -0
- package/lib/utilities/extract.js +117 -0
- package/lib/utilities/hooks.d.ts +14 -0
- package/lib/utilities/hooks.js +101 -0
- package/lib/utilities/mute-action.d.ts +4 -0
- package/lib/utilities/mute-action.js +48 -0
- package/lib/utilities/parameters.d.ts +7 -0
- package/lib/utilities/parameters.js +20 -0
- package/lib/utilities/regex.d.ts +1 -0
- package/lib/utilities/regex.js +14 -0
- package/lib/utilities/tools.d.ts +27 -0
- package/lib/utilities/tools.js +169 -0
- package/lib/utilities/useNamespace.d.ts +15 -0
- package/lib/utilities/useNamespace.js +66 -0
- package/package.json +63 -0
package/lib/type.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { GenerateI18nKey } from 'agora-ui-foundation/lib/i18n';
|
|
2
|
+
import { FcrBaseRoomControl, FcrError, FcrUserRole as FcrUIUserRole, FcrUserRole } from 'fcr-core';
|
|
3
|
+
export { FcrUserRole, FcrRegion, FcrStreamLatencyLevel } from 'fcr-core';
|
|
4
|
+
/**
|
|
5
|
+
* FcrUIExitReason enum represents the reason for exiting a UI scene.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum FcrUIExitReason {
|
|
8
|
+
/**
|
|
9
|
+
* The user leaves the room.
|
|
10
|
+
*/
|
|
11
|
+
LEAVE_ROOM = "LEAVE_ROOM",
|
|
12
|
+
/**
|
|
13
|
+
* The user leaves the room due to the room being closed.
|
|
14
|
+
*/
|
|
15
|
+
CLOSE_ROOM = "CLOSE_ROOM",
|
|
16
|
+
/**
|
|
17
|
+
* The user is kicked out of the room.
|
|
18
|
+
*/
|
|
19
|
+
KICKED_OUT = "KICKED_OUT",
|
|
20
|
+
/**
|
|
21
|
+
* The user failed to join the room due to various reasons such as User ID conflict.
|
|
22
|
+
*/
|
|
23
|
+
ABORTED = "ABORTED"
|
|
24
|
+
}
|
|
25
|
+
export interface FcrUIResource {
|
|
26
|
+
virtualBackgroundImages?: string[];
|
|
27
|
+
virtualBackgroundVideos?: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface FcrUISceneCreatorConfig {
|
|
30
|
+
/**
|
|
31
|
+
* The App ID.
|
|
32
|
+
*/
|
|
33
|
+
appId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The ID of the user.
|
|
36
|
+
*/
|
|
37
|
+
userId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Additional parameters.
|
|
40
|
+
*/
|
|
41
|
+
parameters?: Record<string, string | number | object>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* FcrUISceneConfig interface represents the configuration for a UI scene.
|
|
45
|
+
*/
|
|
46
|
+
export interface FcrUISceneConfig {
|
|
47
|
+
/**
|
|
48
|
+
* The token for authentication.
|
|
49
|
+
*/
|
|
50
|
+
roomToken: string;
|
|
51
|
+
/**
|
|
52
|
+
* The ID of the room.
|
|
53
|
+
*/
|
|
54
|
+
roomId: string;
|
|
55
|
+
/**
|
|
56
|
+
* The name of the user.
|
|
57
|
+
*/
|
|
58
|
+
userName: string;
|
|
59
|
+
/**
|
|
60
|
+
* The role of the user.
|
|
61
|
+
*/
|
|
62
|
+
userRole: FcrUIUserRole;
|
|
63
|
+
/**
|
|
64
|
+
* The language of the user interface. Supported languages are: 'en', 'zh'.
|
|
65
|
+
*/
|
|
66
|
+
language: string;
|
|
67
|
+
/**
|
|
68
|
+
* Link to share the room.
|
|
69
|
+
*/
|
|
70
|
+
inviteLink: string;
|
|
71
|
+
/**
|
|
72
|
+
* Flexible properties of the user.
|
|
73
|
+
*/
|
|
74
|
+
userProperties?: Record<string, unknown>;
|
|
75
|
+
/**
|
|
76
|
+
* UI Resources such as virtual background images and videos.
|
|
77
|
+
*/
|
|
78
|
+
resource?: FcrUIResource;
|
|
79
|
+
/**
|
|
80
|
+
* The password for the room.
|
|
81
|
+
*/
|
|
82
|
+
password?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* FcrUISceneObserver interface represents an observer for a UI scene.
|
|
86
|
+
*/
|
|
87
|
+
export interface FcrUISceneObserver {
|
|
88
|
+
/**
|
|
89
|
+
* Called when the room is exited.
|
|
90
|
+
*
|
|
91
|
+
* @param roomId - The ID of the room.
|
|
92
|
+
* @param reason - The reason for exiting.
|
|
93
|
+
*/
|
|
94
|
+
onExited?: FcrUISceneExitCallback;
|
|
95
|
+
/**
|
|
96
|
+
* Called when joining the room is successful.
|
|
97
|
+
*
|
|
98
|
+
* @param roomId - The ID of the room.
|
|
99
|
+
*/
|
|
100
|
+
onLaunchSuccess?: FcrUISceneSuccessCallback;
|
|
101
|
+
/**
|
|
102
|
+
* Called when joining the room fails.
|
|
103
|
+
*
|
|
104
|
+
* @param roomId - The ID of the room.
|
|
105
|
+
* @param error - The error that occurred.
|
|
106
|
+
*/
|
|
107
|
+
onLaunchFailure?: FcrUISceneFailureCallback;
|
|
108
|
+
}
|
|
109
|
+
export type FcrUISceneCancelCallback = (roomId: string) => void;
|
|
110
|
+
export type FcrUISceneSuccessCallback = (roomId: string) => void;
|
|
111
|
+
export type FcrUISceneFailureCallback = (roomId: string, error: FcrError) => void;
|
|
112
|
+
export type FcrUISceneExitCallback = (roomId: string, reason: FcrUIExitReason, roomControl?: FcrBaseRoomControl) => void;
|
|
113
|
+
export declare const userRoleI18nKey: Record<FcrUserRole, GenerateI18nKey<I18nResouceTypes>>;
|
|
114
|
+
export interface FcrUIMediaConfig {
|
|
115
|
+
autoConnectAudio: boolean;
|
|
116
|
+
microphoneExpectedOff: boolean;
|
|
117
|
+
cameraExpectedOff: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface FcrUISettingConfig {
|
|
120
|
+
media: FcrUIMediaConfig;
|
|
121
|
+
}
|
package/lib/type.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "FcrRegion", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _fcrCore.FcrRegion;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "FcrStreamLatencyLevel", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _fcrCore.FcrStreamLatencyLevel;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
exports.FcrUIExitReason = void 0;
|
|
21
|
+
Object.defineProperty(exports, "FcrUserRole", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _fcrCore.FcrUserRole;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.userRoleI18nKey = void 0;
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
var _fcrCore = require("fcr-core");
|
|
30
|
+
/**
|
|
31
|
+
* FcrUIExitReason enum represents the reason for exiting a UI scene.
|
|
32
|
+
*/
|
|
33
|
+
var FcrUIExitReason = exports.FcrUIExitReason = /*#__PURE__*/function (FcrUIExitReason) {
|
|
34
|
+
FcrUIExitReason["LEAVE_ROOM"] = "LEAVE_ROOM";
|
|
35
|
+
FcrUIExitReason["CLOSE_ROOM"] = "CLOSE_ROOM";
|
|
36
|
+
FcrUIExitReason["KICKED_OUT"] = "KICKED_OUT";
|
|
37
|
+
FcrUIExitReason["ABORTED"] = "ABORTED";
|
|
38
|
+
return FcrUIExitReason;
|
|
39
|
+
}({});
|
|
40
|
+
/**
|
|
41
|
+
* FcrUISceneConfig interface represents the configuration for a UI scene.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* FcrUISceneObserver interface represents an observer for a UI scene.
|
|
45
|
+
*/
|
|
46
|
+
var userRoleI18nKey = exports.userRoleI18nKey = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, _fcrCore.FcrUserRole.HOST, 'fmt_role_host'), _fcrCore.FcrUserRole.COHOST, 'fmt_role_cohost'), _fcrCore.FcrUserRole.PARTICIPANT, 'fmt_role_participant'), _fcrCore.FcrUserRole.AUDIENCE, 'fmt_role_participant'), _fcrCore.FcrUserRole.OBSERVER, 'fmt_role_participant'), _fcrCore.FcrUserRole.ROBOT, 'fmt_role_participant');
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FcrCoreEngine } from 'fcr-core';
|
|
2
|
+
import { FcrUISceneConfig, FcrUISceneObserver } from './type';
|
|
3
|
+
import { AgoraObservable } from 'agora-foundation/lib/utilities/observable';
|
|
4
|
+
import { FcrMobileStateBarUIModule } from './modules/state-bar';
|
|
5
|
+
import { MediaPlayerUIModule } from './modules/member-layout';
|
|
6
|
+
import './mobile-global.css';
|
|
7
|
+
export declare class DefaultSceneUIManager {
|
|
8
|
+
private _sceneConfig;
|
|
9
|
+
private _engine;
|
|
10
|
+
private _observable;
|
|
11
|
+
private _actionBarUIModule?;
|
|
12
|
+
private _audioStreamUIModule?;
|
|
13
|
+
private _layoutModule?;
|
|
14
|
+
private _settingStore?;
|
|
15
|
+
private _participantStore?;
|
|
16
|
+
private _mainRoomControl?;
|
|
17
|
+
private _waitingRoomControl?;
|
|
18
|
+
private _chatModule?;
|
|
19
|
+
_participantsModule: any;
|
|
20
|
+
_stateBarUIModule?: FcrMobileStateBarUIModule;
|
|
21
|
+
_mediaPlayerModule?: MediaPlayerUIModule;
|
|
22
|
+
_dialogModule: any;
|
|
23
|
+
_eventToastUIModule: any;
|
|
24
|
+
constructor(_sceneConfig: FcrUISceneConfig, _engine: FcrCoreEngine, _observable: AgoraObservable<FcrUISceneObserver>);
|
|
25
|
+
private _initWhiteBoardUIModule;
|
|
26
|
+
private _initChatUIModule;
|
|
27
|
+
render(dom: HTMLElement): void;
|
|
28
|
+
private renderMainMobile;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private _createRoomControl;
|
|
31
|
+
private _handleJoinRoom;
|
|
32
|
+
}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
6
|
+
require("core-js/modules/es.array.is-array.js");
|
|
7
|
+
require("core-js/modules/es.array.iterator.js");
|
|
8
|
+
require("core-js/modules/es.array.push.js");
|
|
9
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
10
|
+
require("core-js/modules/es.function.bind.js");
|
|
11
|
+
require("core-js/modules/es.function.name.js");
|
|
12
|
+
require("core-js/modules/es.map.js");
|
|
13
|
+
require("core-js/modules/es.number.constructor.js");
|
|
14
|
+
require("core-js/modules/es.object.create.js");
|
|
15
|
+
require("core-js/modules/es.object.define-property.js");
|
|
16
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
17
|
+
require("core-js/modules/es.string.iterator.js");
|
|
18
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
19
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
20
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
21
|
+
require("core-js/modules/esnext.map.every.js");
|
|
22
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
23
|
+
require("core-js/modules/esnext.map.find.js");
|
|
24
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
25
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
26
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
27
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
28
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
29
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
30
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
31
|
+
require("core-js/modules/esnext.map.some.js");
|
|
32
|
+
require("core-js/modules/esnext.map.update.js");
|
|
33
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
34
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
35
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
36
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
37
|
+
Object.defineProperty(exports, "__esModule", {
|
|
38
|
+
value: true
|
|
39
|
+
});
|
|
40
|
+
exports.DefaultSceneUIManager = void 0;
|
|
41
|
+
require("core-js/modules/es.error.cause.js");
|
|
42
|
+
require("core-js/modules/es.error.to-string.js");
|
|
43
|
+
require("core-js/modules/es.object.to-string.js");
|
|
44
|
+
require("core-js/modules/es.promise.js");
|
|
45
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
46
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
47
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
48
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
49
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
50
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
51
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
52
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
53
|
+
var _fcrCore = require("fcr-core");
|
|
54
|
+
var _type = require("./type");
|
|
55
|
+
var _globalContext = require("./common/global-context");
|
|
56
|
+
var _layout = require("./modules/layout");
|
|
57
|
+
var _actionBar = require("./modules/action-bar");
|
|
58
|
+
var _type2 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
59
|
+
var _type3 = require("agora-rte-sdk/lib/core/scene/type");
|
|
60
|
+
var _type4 = require("agora-rte-sdk/lib/type");
|
|
61
|
+
var _deviceStreamStore = require("./common/device-stream-store");
|
|
62
|
+
var _eventStore = require("./common/event-store");
|
|
63
|
+
var _securityStore = require("./common/security-store");
|
|
64
|
+
var _deviceStore = require("./common/device-store");
|
|
65
|
+
var _type5 = require("fcr-core/lib/room-control/type");
|
|
66
|
+
var _stateBar = require("./modules/state-bar");
|
|
67
|
+
var _settingStore = require("./common/setting-store");
|
|
68
|
+
var _chat = require("./modules/chat");
|
|
69
|
+
var _memberLayout = require("./modules/member-layout");
|
|
70
|
+
var _constant = require("./utilities/constant");
|
|
71
|
+
var _whiteboard = require("./modules/whiteboard");
|
|
72
|
+
var _participantStore = require("./common/participant-store");
|
|
73
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
74
|
+
require("./mobile-global.css");
|
|
75
|
+
var _audioStream = require("./modules/audio-stream");
|
|
76
|
+
var _type6 = require("fcr-core/lib/type");
|
|
77
|
+
var _toast = require("agora-ui-foundation/lib/components/toast");
|
|
78
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
79
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
80
|
+
var _DefaultSceneUIManager;
|
|
81
|
+
var _initProto;
|
|
82
|
+
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 set(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 k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(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 s(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)]; } }; }
|
|
83
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
84
|
+
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); }
|
|
85
|
+
function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
86
|
+
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; }
|
|
87
|
+
var DefaultSceneUIManager = exports.DefaultSceneUIManager = /*#__PURE__*/function () {
|
|
88
|
+
function DefaultSceneUIManager(_sceneConfig, _engine, _observable) {
|
|
89
|
+
(0, _classCallCheck2["default"])(this, DefaultSceneUIManager);
|
|
90
|
+
// @internal
|
|
91
|
+
(0, _defineProperty2["default"])(this, "logger", (_initProto(this), (0, _logger.getLogger)()));
|
|
92
|
+
// @internal
|
|
93
|
+
(0, _defineProperty2["default"])(this, "_roomObserver", {});
|
|
94
|
+
// @internal
|
|
95
|
+
(0, _defineProperty2["default"])(this, "_eventObserver", {});
|
|
96
|
+
this._sceneConfig = _sceneConfig;
|
|
97
|
+
this._engine = _engine;
|
|
98
|
+
this._observable = _observable;
|
|
99
|
+
this._uiEventStore = new _eventStore.FcrUIEventStore();
|
|
100
|
+
this._deviceStore = new _deviceStore.FcrDeviceStore(_sceneConfig.userName, this._engine.getMobileMediaControl());
|
|
101
|
+
}
|
|
102
|
+
return (0, _createClass2["default"])(DefaultSceneUIManager, [{
|
|
103
|
+
key: "_initWhiteBoardUIModule",
|
|
104
|
+
value: function _initWhiteBoardUIModule() {
|
|
105
|
+
if (!this._securityStore || !this._mainRoomControl) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
this._whiteBoradUIModule = new _whiteboard.FcrWhiteboardUIModule({
|
|
109
|
+
roomControl: this._mainRoomControl,
|
|
110
|
+
uiEventStore: this._uiEventStore,
|
|
111
|
+
userControl: this._mainRoomControl.getUserControl(),
|
|
112
|
+
whiteboardControl: this._mainRoomControl.getBoardControl(),
|
|
113
|
+
streamControl: this._mainRoomControl.getStreamControl(),
|
|
114
|
+
securityStore: this._securityStore
|
|
115
|
+
});
|
|
116
|
+
return this._whiteBoradUIModule;
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "_initChatUIModule",
|
|
120
|
+
value: function _initChatUIModule() {
|
|
121
|
+
if (!this._securityStore || !this._mainRoomControl) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
this._chatModule = new _chat.ChatUIModule({
|
|
125
|
+
roomControl: this._mainRoomControl,
|
|
126
|
+
uiEventStore: this._uiEventStore,
|
|
127
|
+
securityStore: this._securityStore
|
|
128
|
+
});
|
|
129
|
+
return this._chatModule;
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "render",
|
|
133
|
+
value: function render(dom) {
|
|
134
|
+
var _this = this;
|
|
135
|
+
this._dom = dom;
|
|
136
|
+
if (!this._dom) {
|
|
137
|
+
this.logger.error('Scene UI cannot be rendered as dom is not exist');
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
var joinRoom = /*#__PURE__*/function () {
|
|
141
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
142
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
143
|
+
while (1) switch (_context.prev = _context.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
return _context.abrupt("return", _this._engine.login().then(function () {
|
|
146
|
+
return _this._handleJoinRoom();
|
|
147
|
+
}).then(function () {
|
|
148
|
+
_this.renderMainMobile();
|
|
149
|
+
})["catch"](function (e) {
|
|
150
|
+
_this._observable.notifyObservers('onLaunchFailure', _this._sceneConfig.roomId, e);
|
|
151
|
+
}));
|
|
152
|
+
case 1:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context.stop();
|
|
155
|
+
}
|
|
156
|
+
}, _callee);
|
|
157
|
+
}));
|
|
158
|
+
return function joinRoom() {
|
|
159
|
+
return _ref.apply(this, arguments);
|
|
160
|
+
};
|
|
161
|
+
}();
|
|
162
|
+
joinRoom();
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "renderMainMobile",
|
|
166
|
+
value: function renderMainMobile() {
|
|
167
|
+
var _this$_initChatUIModu,
|
|
168
|
+
_this2 = this;
|
|
169
|
+
/**
|
|
170
|
+
* Common Stores
|
|
171
|
+
*/
|
|
172
|
+
var deviceStore = this._deviceStore;
|
|
173
|
+
var uiEventStore = this._uiEventStore;
|
|
174
|
+
if (!this._mainRoomControl) {
|
|
175
|
+
this.logger.error('Cannot render room ui without mainroom control');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this._securityStore = new _securityStore.FcrSecurityStore(this._mainRoomControl.getPrivilegeControl(), this._mainRoomControl.getUserControl(), this._mainRoomControl.getStreamControl(), uiEventStore);
|
|
179
|
+
this._settingStore = new _settingStore.SettingStore({
|
|
180
|
+
mediaControl: this._engine.getDesktopMediaControl(),
|
|
181
|
+
config: this._sceneConfig,
|
|
182
|
+
monitorControl: this._engine.getMonitorControl(),
|
|
183
|
+
streamControl: this._mainRoomControl.getStreamControl(),
|
|
184
|
+
roomControl: this._mainRoomControl,
|
|
185
|
+
deviceStore: deviceStore,
|
|
186
|
+
uiEventStore: this._uiEventStore
|
|
187
|
+
});
|
|
188
|
+
this._audioStreamUIModule = new _audioStream.AudioStreamUIModule({
|
|
189
|
+
streamControl: this._mainRoomControl.getStreamControl(),
|
|
190
|
+
userControl: this._mainRoomControl.getUserControl(),
|
|
191
|
+
deviceStore: deviceStore
|
|
192
|
+
});
|
|
193
|
+
this._deviceStreamStore = new _deviceStreamStore.FcrDeviceStreamStore({
|
|
194
|
+
roomControl: this._mainRoomControl,
|
|
195
|
+
securityStore: this._securityStore,
|
|
196
|
+
deviceStore: deviceStore
|
|
197
|
+
});
|
|
198
|
+
this._participantStore = new _participantStore.FcrParticipantStore({
|
|
199
|
+
roomControl: this._mainRoomControl,
|
|
200
|
+
peerSessionControl: this._engine.getPeerSessionControl(),
|
|
201
|
+
securityStore: this._securityStore,
|
|
202
|
+
uiEventStore: uiEventStore,
|
|
203
|
+
deviceStore: deviceStore,
|
|
204
|
+
deviceStreamStore: this._deviceStreamStore
|
|
205
|
+
});
|
|
206
|
+
this._actionBarUIModule = new _actionBar.FcrMobileActionBarUIModule({
|
|
207
|
+
roomControl: this._mainRoomControl,
|
|
208
|
+
userControl: this._mainRoomControl.getUserControl(),
|
|
209
|
+
uiEventStore: uiEventStore,
|
|
210
|
+
securityStore: this._securityStore,
|
|
211
|
+
streamControl: this._mainRoomControl.getStreamControl(),
|
|
212
|
+
deviceStore: deviceStore,
|
|
213
|
+
deviceStreamStore: this._deviceStreamStore,
|
|
214
|
+
mediaControl: this._engine.getDesktopMediaControl(),
|
|
215
|
+
participantStore: this._participantStore
|
|
216
|
+
});
|
|
217
|
+
this._stateBarUIModule = new _stateBar.FcrMobileStateBarUIModule({
|
|
218
|
+
roomControl: this._mainRoomControl,
|
|
219
|
+
uiEventStore: uiEventStore,
|
|
220
|
+
securityStore: this._securityStore,
|
|
221
|
+
config: this._sceneConfig
|
|
222
|
+
});
|
|
223
|
+
this._mediaPlayerModule = new _memberLayout.MediaPlayerUIModule({
|
|
224
|
+
userControl: this._mainRoomControl.getUserControl(),
|
|
225
|
+
streamControl: this._mainRoomControl.getStreamControl(),
|
|
226
|
+
deviceStreamStore: this._deviceStreamStore,
|
|
227
|
+
deviceStore: this._deviceStore,
|
|
228
|
+
settingStore: this._settingStore,
|
|
229
|
+
whiteBoredControl: this._mainRoomControl.getBoardControl(),
|
|
230
|
+
participantStore: this._participantStore,
|
|
231
|
+
uiEventStore: uiEventStore
|
|
232
|
+
});
|
|
233
|
+
this._layoutModule = new _layout.LayoutUIModule({
|
|
234
|
+
securityStore: this._securityStore,
|
|
235
|
+
uiEventStore: uiEventStore
|
|
236
|
+
});
|
|
237
|
+
var layoutComponent = this._layoutModule.getComponent({
|
|
238
|
+
actionBar: this._actionBarUIModule.getComponent(),
|
|
239
|
+
stateBar: this._stateBarUIModule.getComponent(),
|
|
240
|
+
chat: (_this$_initChatUIModu = this._initChatUIModule()) === null || _this$_initChatUIModu === void 0 ? void 0 : _this$_initChatUIModu.getComponent(),
|
|
241
|
+
memberLayout: this._mediaPlayerModule.getComponent(),
|
|
242
|
+
whiteboard: this._initWhiteBoardUIModule
|
|
243
|
+
});
|
|
244
|
+
this._observable.notifyObservers('onLaunchSuccess', this._sceneConfig.roomId);
|
|
245
|
+
if (!this._deviceStore || !this._settingStore || !this._participantStore || !this._securityStore) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
_reactDom["default"].render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_globalContext.FcrMobileGlobalContext.Provider, {
|
|
249
|
+
value: {
|
|
250
|
+
deviceStore: this._deviceStore,
|
|
251
|
+
settingStore: this._settingStore,
|
|
252
|
+
participantStore: this._participantStore,
|
|
253
|
+
securityStore: this._securityStore
|
|
254
|
+
},
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
256
|
+
style: {
|
|
257
|
+
width: '100vw',
|
|
258
|
+
height: '100vh'
|
|
259
|
+
},
|
|
260
|
+
children: layoutComponent
|
|
261
|
+
})
|
|
262
|
+
}), this._dom);
|
|
263
|
+
this._eventObserver = {
|
|
264
|
+
onEvent: function onEvent(action, payload) {
|
|
265
|
+
if (action === _constant.UIAction.EXIT_ROOM) {
|
|
266
|
+
_this2._observable.notifyObservers('onExited', _this2._sceneConfig.roomId, payload.reason, _this2._mainRoomControl);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
this._roomObserver = {
|
|
271
|
+
onRoomStateUpdated: function onRoomStateUpdated(roomId, state) {
|
|
272
|
+
if (state === _type6.FcrRoomState.Closed) {
|
|
273
|
+
_this2._observable.notifyObservers('onExited', roomId, _type.FcrUIExitReason.CLOSE_ROOM);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
uiEventStore.addObserver(this._eventObserver);
|
|
278
|
+
this._mainRoomControl.addObserver(this._roomObserver);
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "destroy",
|
|
282
|
+
value: function destroy() {
|
|
283
|
+
var _this$_mediaPlayerMod, _this$_whiteBoradUIMo, _this$_actionBarUIMod, _this$_stateBarUIModu, _this$_layoutModule, _this$_settingStore, _this$_participantSto, _this$_securityStore, _this$_deviceStore, _this$_deviceStreamSt, _this$_audioStreamUIM;
|
|
284
|
+
if (this._dom) {
|
|
285
|
+
_reactDom["default"].unmountComponentAtNode(this._dom);
|
|
286
|
+
this._dom = undefined;
|
|
287
|
+
}
|
|
288
|
+
(_this$_mediaPlayerMod = this._mediaPlayerModule) === null || _this$_mediaPlayerMod === void 0 || _this$_mediaPlayerMod.release();
|
|
289
|
+
(_this$_whiteBoradUIMo = this._whiteBoradUIModule) === null || _this$_whiteBoradUIMo === void 0 || _this$_whiteBoradUIMo.release();
|
|
290
|
+
(_this$_actionBarUIMod = this._actionBarUIModule) === null || _this$_actionBarUIMod === void 0 || _this$_actionBarUIMod.release();
|
|
291
|
+
(_this$_stateBarUIModu = this._stateBarUIModule) === null || _this$_stateBarUIModu === void 0 || _this$_stateBarUIModu.release();
|
|
292
|
+
(_this$_layoutModule = this._layoutModule) === null || _this$_layoutModule === void 0 || _this$_layoutModule.release();
|
|
293
|
+
(_this$_settingStore = this._settingStore) === null || _this$_settingStore === void 0 || _this$_settingStore.release();
|
|
294
|
+
(_this$_participantSto = this._participantStore) === null || _this$_participantSto === void 0 || _this$_participantSto.release();
|
|
295
|
+
(_this$_securityStore = this._securityStore) === null || _this$_securityStore === void 0 || _this$_securityStore.release();
|
|
296
|
+
(_this$_deviceStore = this._deviceStore) === null || _this$_deviceStore === void 0 || _this$_deviceStore.release();
|
|
297
|
+
(_this$_deviceStreamSt = this._deviceStreamStore) === null || _this$_deviceStreamSt === void 0 || _this$_deviceStreamSt.release();
|
|
298
|
+
(_this$_audioStreamUIM = this._audioStreamUIModule) === null || _this$_audioStreamUIM === void 0 || _this$_audioStreamUIM.release();
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "_createRoomControl",
|
|
302
|
+
value: function () {
|
|
303
|
+
var _createRoomControl2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(roomId) {
|
|
304
|
+
var _this3 = this;
|
|
305
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
306
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
307
|
+
case 0:
|
|
308
|
+
return _context3.abrupt("return", new Promise(/*#__PURE__*/function () {
|
|
309
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve, reject) {
|
|
310
|
+
var engine, config, streams, room;
|
|
311
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
312
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
313
|
+
case 0:
|
|
314
|
+
engine = _this3._engine;
|
|
315
|
+
config = _this3._sceneConfig;
|
|
316
|
+
if (engine) {
|
|
317
|
+
_context2.next = 4;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
return _context2.abrupt("return");
|
|
321
|
+
case 4:
|
|
322
|
+
streams = [{
|
|
323
|
+
videoSourceState: _type2.AgoraRtcMediaSourceState.CLOSE,
|
|
324
|
+
audioSourceState: _type2.AgoraRtcMediaSourceState.CLOSE,
|
|
325
|
+
videoSourceId: undefined,
|
|
326
|
+
audioSourceId: undefined,
|
|
327
|
+
streamName: '',
|
|
328
|
+
streamType: _type3.AgoraRteMediaStreamType.BOTH,
|
|
329
|
+
videoSourceType: _type4.AgoraRteVideoSourceType.CAMERA,
|
|
330
|
+
audioSourceType: _type4.AgoraRteAudioSourceType.MICROPHONE
|
|
331
|
+
}];
|
|
332
|
+
if (config.userRole === _fcrCore.FcrUserRole.ROBOT) {
|
|
333
|
+
streams = [];
|
|
334
|
+
}
|
|
335
|
+
_context2.prev = 6;
|
|
336
|
+
_context2.next = 9;
|
|
337
|
+
return engine.createRoomControlAndJoin(roomId, {
|
|
338
|
+
userName: config.userName,
|
|
339
|
+
userRole: config.userRole,
|
|
340
|
+
userProperties: config.userProperties,
|
|
341
|
+
streamLatency: _fcrCore.FcrStreamLatencyLevel.ULTRA_LOW,
|
|
342
|
+
createStreamConfigs: streams,
|
|
343
|
+
roomToken: config.roomToken,
|
|
344
|
+
password: config.password
|
|
345
|
+
});
|
|
346
|
+
case 9:
|
|
347
|
+
room = _context2.sent;
|
|
348
|
+
resolve(room);
|
|
349
|
+
_context2.next = 16;
|
|
350
|
+
break;
|
|
351
|
+
case 13:
|
|
352
|
+
_context2.prev = 13;
|
|
353
|
+
_context2.t0 = _context2["catch"](6);
|
|
354
|
+
reject(_context2.t0);
|
|
355
|
+
case 16:
|
|
356
|
+
case "end":
|
|
357
|
+
return _context2.stop();
|
|
358
|
+
}
|
|
359
|
+
}, _callee2, null, [[6, 13]]);
|
|
360
|
+
}));
|
|
361
|
+
return function (_x2, _x3) {
|
|
362
|
+
return _ref2.apply(this, arguments);
|
|
363
|
+
};
|
|
364
|
+
}()));
|
|
365
|
+
case 1:
|
|
366
|
+
case "end":
|
|
367
|
+
return _context3.stop();
|
|
368
|
+
}
|
|
369
|
+
}, _callee3);
|
|
370
|
+
}));
|
|
371
|
+
function _createRoomControl(_x) {
|
|
372
|
+
return _createRoomControl2.apply(this, arguments);
|
|
373
|
+
}
|
|
374
|
+
return _createRoomControl;
|
|
375
|
+
}()
|
|
376
|
+
}, {
|
|
377
|
+
key: "_handleJoinRoom",
|
|
378
|
+
value: function () {
|
|
379
|
+
var _handleJoinRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
380
|
+
var _this4 = this;
|
|
381
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
382
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
383
|
+
case 0:
|
|
384
|
+
return _context4.abrupt("return", this._createRoomControl(this._sceneConfig.roomId).then(function (room) {
|
|
385
|
+
var roomInfo = room.getRoomInfo();
|
|
386
|
+
if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.Mainroom) {
|
|
387
|
+
_this4._mainRoomControl = room;
|
|
388
|
+
_this4._mainRoomControl.addObserver(_this4._roomObserver);
|
|
389
|
+
// @ts-ignore
|
|
390
|
+
window.__mainRoom_control = room;
|
|
391
|
+
return _type5.FcrRoomType.Mainroom;
|
|
392
|
+
} else if ((roomInfo === null || roomInfo === void 0 ? void 0 : roomInfo.roomType) === _type5.FcrRoomType.Waitingroom) {
|
|
393
|
+
_this4._waitingRoomControl = room;
|
|
394
|
+
if (_this4._waitingRoomControl) {
|
|
395
|
+
_this4._waitingRoomControl.leave();
|
|
396
|
+
}
|
|
397
|
+
_toast.FcrToastApi.open({
|
|
398
|
+
toastProps: {
|
|
399
|
+
type: 'error',
|
|
400
|
+
content: (0, _i18n.transI18n)('fmt_h_tips_host_enabled_waiting_room')
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
throw new Error('host_enabled_waiting_room');
|
|
404
|
+
}
|
|
405
|
+
})["catch"](function (e) {
|
|
406
|
+
_this4._observable.notifyObservers('onLaunchFailure', _this4._sceneConfig.roomId, e);
|
|
407
|
+
throw e;
|
|
408
|
+
}));
|
|
409
|
+
case 1:
|
|
410
|
+
case "end":
|
|
411
|
+
return _context4.stop();
|
|
412
|
+
}
|
|
413
|
+
}, _callee4, this);
|
|
414
|
+
}));
|
|
415
|
+
function _handleJoinRoom() {
|
|
416
|
+
return _handleJoinRoom2.apply(this, arguments);
|
|
417
|
+
}
|
|
418
|
+
return _handleJoinRoom;
|
|
419
|
+
}()
|
|
420
|
+
}]);
|
|
421
|
+
}();
|
|
422
|
+
_DefaultSceneUIManager = DefaultSceneUIManager;
|
|
423
|
+
var _applyDecs$e = _applyDecs(_DefaultSceneUIManager, [[_decorator.bound, 2, "_initWhiteBoardUIModule"], [_decorator.bound, 2, "_initChatUIModule"]], []).e;
|
|
424
|
+
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
425
|
+
_initProto = _applyDecs$e2[0];
|
|
426
|
+
_applyDecs$e;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FcrUISceneObserver, FcrUISceneConfig, FcrUISceneCreatorConfig } from './type';
|
|
2
|
+
export declare class FcrUIDefaultScene {
|
|
3
|
+
private _config;
|
|
4
|
+
private _creatorConfig;
|
|
5
|
+
private _dom;
|
|
6
|
+
private _roomControl?;
|
|
7
|
+
constructor(_config: FcrUISceneConfig, _creatorConfig: FcrUISceneCreatorConfig, _dom: HTMLElement);
|
|
8
|
+
exit(): void;
|
|
9
|
+
addObserver(observer: FcrUISceneObserver): void;
|
|
10
|
+
removeObserver(observer: FcrUISceneObserver): void;
|
|
11
|
+
launch(): Promise<void>;
|
|
12
|
+
private _setMobileScopeClass;
|
|
13
|
+
private _release;
|
|
14
|
+
}
|