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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { FcrStreamControl, FcrUserControl, FcrVideoStreamType } from 'fcr-core';
|
|
2
|
+
import { FcrUserRole, FcrVideoRenderConfig } from 'fcr-core/lib/type';
|
|
3
|
+
import { ParticipantUser } from '../../common/type';
|
|
4
|
+
import { FcrDeviceStore } from '../../common/device-store';
|
|
5
|
+
import { SettingStore } from '../../common/setting-store';
|
|
6
|
+
import { FcrWhiteboardControl } from 'fcr-core/lib/room-control/whiteboard-control/types';
|
|
7
|
+
import { FcrParticipantStore } from '../../common/participant-store';
|
|
8
|
+
import { FcrUIEventStore } from '../../common/event-store';
|
|
9
|
+
import { FcrDeviceStreamStore } from '../../common/device-stream-store';
|
|
10
|
+
export interface IMemberProps {
|
|
11
|
+
streamControl: FcrStreamControl;
|
|
12
|
+
deviceStore: FcrDeviceStore;
|
|
13
|
+
deviceStreamStore: FcrDeviceStreamStore;
|
|
14
|
+
userControl: FcrUserControl;
|
|
15
|
+
settingStore: SettingStore;
|
|
16
|
+
uiEventStore: FcrUIEventStore;
|
|
17
|
+
whiteBoredControl: FcrWhiteboardControl;
|
|
18
|
+
participantStore: FcrParticipantStore;
|
|
19
|
+
}
|
|
20
|
+
export default class Store {
|
|
21
|
+
private _deviceStore;
|
|
22
|
+
private _deviceStreamStore;
|
|
23
|
+
private _participantStore;
|
|
24
|
+
private _userControl;
|
|
25
|
+
private _settingStore;
|
|
26
|
+
private _streamControl;
|
|
27
|
+
private _hightlightTimber;
|
|
28
|
+
private _userVolumeMap;
|
|
29
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
30
|
+
accessor localUserRole: FcrUserRole;
|
|
31
|
+
accessor spotlightStreamId: string;
|
|
32
|
+
accessor microphoneVolumeLevel: number;
|
|
33
|
+
accessor audioVolumeMap: Map<string, {
|
|
34
|
+
volume: number;
|
|
35
|
+
streamId: string;
|
|
36
|
+
}>;
|
|
37
|
+
accessor highlightUsersMap: Map<string, number[]>;
|
|
38
|
+
accessor highlightUser: ParticipantUser | null;
|
|
39
|
+
private _streamsObserver;
|
|
40
|
+
private _whiteboardObserver;
|
|
41
|
+
private _whiteBoredControl;
|
|
42
|
+
accessor boardOwnerUserId: string | undefined;
|
|
43
|
+
constructor({ streamControl, userControl, deviceStore, deviceStreamStore, settingStore, whiteBoredControl, participantStore, }: IMemberProps);
|
|
44
|
+
get localAudioStreamId(): string | undefined;
|
|
45
|
+
get highlightUserId(): string;
|
|
46
|
+
get localUserId(): string;
|
|
47
|
+
get userListSource(): import("../../common/member-list-data-source").FcrUIMemberDataImpl[];
|
|
48
|
+
get cameraEnabled(): boolean;
|
|
49
|
+
get cameraId(): string;
|
|
50
|
+
get localMicVolume(): number;
|
|
51
|
+
private _setAudioVolumeMap;
|
|
52
|
+
private _deleteInfoInAudioVolumeMapByUserId;
|
|
53
|
+
private _handleHighLightUserTransaction;
|
|
54
|
+
private setHighLightUsersMap;
|
|
55
|
+
private setHighLightUser;
|
|
56
|
+
private _getMaxVolumeUserId;
|
|
57
|
+
get videoCount(): number;
|
|
58
|
+
get spotlightEnabled(): boolean;
|
|
59
|
+
get speakerLayOutDefaultUser(): ParticipantUser | null;
|
|
60
|
+
get shareScreenUser(): ParticipantUser;
|
|
61
|
+
private _onWhiteboardActive;
|
|
62
|
+
private _onWhiteboardInactive;
|
|
63
|
+
get boardUser(): ParticipantUser | null | undefined;
|
|
64
|
+
private _onAudioVolumeUpdated;
|
|
65
|
+
startPlayLocalVideo(view: HTMLElement): void;
|
|
66
|
+
stopPlayLocalVideo(view: HTMLElement): void;
|
|
67
|
+
startRenderRemoteVideoStream(streamId: string, type: FcrVideoStreamType, config: FcrVideoRenderConfig, view: HTMLElement): void;
|
|
68
|
+
stopRenderRemoteVideoStream(streamId: string, view: HTMLElement): void;
|
|
69
|
+
release(): void;
|
|
70
|
+
}
|
|
@@ -0,0 +1,479 @@
|
|
|
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.error.cause.js");
|
|
7
|
+
require("core-js/modules/es.error.to-string.js");
|
|
8
|
+
require("core-js/modules/es.array.is-array.js");
|
|
9
|
+
require("core-js/modules/es.array.push.js");
|
|
10
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
11
|
+
require("core-js/modules/es.function.name.js");
|
|
12
|
+
require("core-js/modules/es.number.constructor.js");
|
|
13
|
+
require("core-js/modules/es.object.create.js");
|
|
14
|
+
require("core-js/modules/es.object.define-properties.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.object.get-own-property-descriptors.js");
|
|
18
|
+
require("core-js/modules/es.object.keys.js");
|
|
19
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
20
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
21
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
22
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
23
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
exports["default"] = void 0;
|
|
27
|
+
require("core-js/modules/es.array.concat.js");
|
|
28
|
+
require("core-js/modules/es.array.filter.js");
|
|
29
|
+
require("core-js/modules/es.array.find.js");
|
|
30
|
+
require("core-js/modules/es.array.for-each.js");
|
|
31
|
+
require("core-js/modules/es.array.iterator.js");
|
|
32
|
+
require("core-js/modules/es.array.slice.js");
|
|
33
|
+
require("core-js/modules/es.array.some.js");
|
|
34
|
+
require("core-js/modules/es.function.bind.js");
|
|
35
|
+
require("core-js/modules/es.map.js");
|
|
36
|
+
require("core-js/modules/es.object.to-string.js");
|
|
37
|
+
require("core-js/modules/es.string.iterator.js");
|
|
38
|
+
require("core-js/modules/es.weak-map.js");
|
|
39
|
+
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
40
|
+
require("core-js/modules/esnext.async-iterator.find.js");
|
|
41
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
42
|
+
require("core-js/modules/esnext.async-iterator.some.js");
|
|
43
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
44
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
45
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
46
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
47
|
+
require("core-js/modules/esnext.iterator.some.js");
|
|
48
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
49
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
50
|
+
require("core-js/modules/esnext.map.every.js");
|
|
51
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
52
|
+
require("core-js/modules/esnext.map.find.js");
|
|
53
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
54
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
55
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
56
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
57
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
58
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
59
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
60
|
+
require("core-js/modules/esnext.map.some.js");
|
|
61
|
+
require("core-js/modules/esnext.map.update.js");
|
|
62
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
63
|
+
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
64
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
65
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
66
|
+
require("core-js/modules/web.timers.js");
|
|
67
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
68
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
69
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
70
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
71
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
72
|
+
var _fcrCore = require("fcr-core");
|
|
73
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
74
|
+
var _mobx = require("mobx");
|
|
75
|
+
var _type = require("fcr-core/lib/type");
|
|
76
|
+
var _type2 = require("agora-rte-sdk/lib/type");
|
|
77
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
78
|
+
var _Store;
|
|
79
|
+
var _initProto, _init_localUserRole, _init_spotlightStreamId, _init_microphoneVolumeLevel, _init_audioVolumeMap, _init_highlightUsersMap, _init_highlightUser, _init_boardOwnerUserId, _setAudioVolumeMapDecs, _deleteInfoInAudioVolumeMapByUserIdDecs, _handleHighLightUserTransactionDecs, _setHighLightUsersMapDecs, _setHighLightUserDecs, _onWhiteboardActiveDecs, _onWhiteboardInactiveDecs, _onAudioVolumeUpdatedDecs, _ref;
|
|
80
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
81
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
82
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
83
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
84
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
85
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
86
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
87
|
+
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)]; } }; }
|
|
88
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
89
|
+
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); }
|
|
90
|
+
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; }
|
|
91
|
+
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; }
|
|
92
|
+
var MIN_SPOTLIGHT_NUMBER = 2;
|
|
93
|
+
var checkFirstNGreaterThanTarget = function checkFirstNGreaterThanTarget(arr, n, max) {
|
|
94
|
+
if (n > arr.length) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
var count = 0;
|
|
98
|
+
for (var i = 0; i < n; i++) {
|
|
99
|
+
var volume = arr[i];
|
|
100
|
+
if (volume && volume > max) {
|
|
101
|
+
count++;
|
|
102
|
+
break; // 只要找到一个大于max的数就可以直接返回true了,这里可以提前结束循环
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return count > 0;
|
|
106
|
+
};
|
|
107
|
+
var _A = /*#__PURE__*/new WeakMap();
|
|
108
|
+
var _B = /*#__PURE__*/new WeakMap();
|
|
109
|
+
var _C = /*#__PURE__*/new WeakMap();
|
|
110
|
+
var _D = /*#__PURE__*/new WeakMap();
|
|
111
|
+
var _E = /*#__PURE__*/new WeakMap();
|
|
112
|
+
var _F = /*#__PURE__*/new WeakMap();
|
|
113
|
+
var _G = /*#__PURE__*/new WeakMap();
|
|
114
|
+
_ref = (_setAudioVolumeMapDecs = [_mobx.action, _mobx.action.bound], _deleteInfoInAudioVolumeMapByUserIdDecs = [_mobx.action, _mobx.action.bound], _handleHighLightUserTransactionDecs = [_mobx.action, _mobx.action.bound], _setHighLightUsersMapDecs = [_mobx.action, _mobx.action.bound], _setHighLightUserDecs = [_mobx.action, _mobx.action.bound], _onWhiteboardActiveDecs = [_mobx.action, _mobx.action.bound], _onWhiteboardInactiveDecs = [_mobx.action, _mobx.action.bound], _onAudioVolumeUpdatedDecs = [_mobx.action, _mobx.action.bound], "_deviceStore");
|
|
115
|
+
var Store = exports["default"] = /*#__PURE__*/function () {
|
|
116
|
+
function Store(_ref2) {
|
|
117
|
+
var streamControl = _ref2.streamControl,
|
|
118
|
+
userControl = _ref2.userControl,
|
|
119
|
+
deviceStore = _ref2.deviceStore,
|
|
120
|
+
deviceStreamStore = _ref2.deviceStreamStore,
|
|
121
|
+
settingStore = _ref2.settingStore,
|
|
122
|
+
whiteBoredControl = _ref2.whiteBoredControl,
|
|
123
|
+
participantStore = _ref2.participantStore;
|
|
124
|
+
(0, _classCallCheck2["default"])(this, Store);
|
|
125
|
+
(0, _defineProperty2["default"])(this, _ref, void _initProto(this));
|
|
126
|
+
(0, _defineProperty2["default"])(this, "_userVolumeMap", new Map());
|
|
127
|
+
(0, _defineProperty2["default"])(this, "logger", (0, _logger.getLogger)());
|
|
128
|
+
_classPrivateFieldInitSpec(this, _A, _init_localUserRole(this, _type.FcrUserRole.PARTICIPANT));
|
|
129
|
+
_classPrivateFieldInitSpec(this, _B, _init_spotlightStreamId(this, ''));
|
|
130
|
+
_classPrivateFieldInitSpec(this, _C, _init_microphoneVolumeLevel(this, 0));
|
|
131
|
+
_classPrivateFieldInitSpec(this, _D, _init_audioVolumeMap(this, new Map()));
|
|
132
|
+
_classPrivateFieldInitSpec(this, _E, _init_highlightUsersMap(this, new Map()));
|
|
133
|
+
_classPrivateFieldInitSpec(this, _F, _init_highlightUser(this, null));
|
|
134
|
+
(0, _defineProperty2["default"])(this, "_streamsObserver", {
|
|
135
|
+
onStreamVolumeIndicationUpdated: this._onAudioVolumeUpdated
|
|
136
|
+
});
|
|
137
|
+
(0, _defineProperty2["default"])(this, "_whiteboardObserver", {
|
|
138
|
+
onActive: this._onWhiteboardActive.bind(this),
|
|
139
|
+
onInactive: this._onWhiteboardInactive.bind(this)
|
|
140
|
+
});
|
|
141
|
+
_classPrivateFieldInitSpec(this, _G, _init_boardOwnerUserId(this, undefined));
|
|
142
|
+
this._userControl = userControl;
|
|
143
|
+
this._streamControl = streamControl;
|
|
144
|
+
this._deviceStore = deviceStore;
|
|
145
|
+
this._deviceStreamStore = deviceStreamStore;
|
|
146
|
+
this._settingStore = settingStore;
|
|
147
|
+
this._participantStore = participantStore;
|
|
148
|
+
this._whiteBoredControl = whiteBoredControl;
|
|
149
|
+
this._streamControl.addObserver(this._streamsObserver);
|
|
150
|
+
this._whiteBoredControl.addObserver(this._whiteboardObserver);
|
|
151
|
+
var getBoardActivity = this._whiteBoredControl.getActivity();
|
|
152
|
+
if (getBoardActivity) {
|
|
153
|
+
this.boardOwnerUserId = this._whiteBoredControl.getOwnerId();
|
|
154
|
+
}
|
|
155
|
+
this._handleHighLightUserTransaction();
|
|
156
|
+
}
|
|
157
|
+
return (0, _createClass2["default"])(Store, [{
|
|
158
|
+
key: "localUserRole",
|
|
159
|
+
get: function get() {
|
|
160
|
+
return _classPrivateFieldGet(_A, this);
|
|
161
|
+
},
|
|
162
|
+
set: function set(v) {
|
|
163
|
+
_classPrivateFieldSet(_A, this, v);
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "spotlightStreamId",
|
|
167
|
+
get: function get() {
|
|
168
|
+
return _classPrivateFieldGet(_B, this);
|
|
169
|
+
},
|
|
170
|
+
set: function set(v) {
|
|
171
|
+
_classPrivateFieldSet(_B, this, v);
|
|
172
|
+
}
|
|
173
|
+
}, {
|
|
174
|
+
key: "microphoneVolumeLevel",
|
|
175
|
+
get: function get() {
|
|
176
|
+
return _classPrivateFieldGet(_C, this);
|
|
177
|
+
},
|
|
178
|
+
set: function set(v) {
|
|
179
|
+
_classPrivateFieldSet(_C, this, v);
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "audioVolumeMap",
|
|
183
|
+
get: function get() {
|
|
184
|
+
return _classPrivateFieldGet(_D, this);
|
|
185
|
+
},
|
|
186
|
+
set: function set(v) {
|
|
187
|
+
_classPrivateFieldSet(_D, this, v);
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
key: "highlightUsersMap",
|
|
191
|
+
get: function get() {
|
|
192
|
+
return _classPrivateFieldGet(_E, this);
|
|
193
|
+
},
|
|
194
|
+
set: function set(v) {
|
|
195
|
+
_classPrivateFieldSet(_E, this, v);
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "highlightUser",
|
|
199
|
+
get: function get() {
|
|
200
|
+
return _classPrivateFieldGet(_F, this);
|
|
201
|
+
},
|
|
202
|
+
set: function set(v) {
|
|
203
|
+
_classPrivateFieldSet(_F, this, v);
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "boardOwnerUserId",
|
|
207
|
+
get: function get() {
|
|
208
|
+
return _classPrivateFieldGet(_G, this);
|
|
209
|
+
},
|
|
210
|
+
set: function set(v) {
|
|
211
|
+
_classPrivateFieldSet(_G, this, v);
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
key: "localAudioStreamId",
|
|
215
|
+
get: function get() {
|
|
216
|
+
var _this$_deviceStreamSt;
|
|
217
|
+
return (_this$_deviceStreamSt = this._deviceStreamStore.localAudioStream) === null || _this$_deviceStreamSt === void 0 ? void 0 : _this$_deviceStreamSt.streamId;
|
|
218
|
+
}
|
|
219
|
+
}, {
|
|
220
|
+
key: "highlightUserId",
|
|
221
|
+
get: function get() {
|
|
222
|
+
var _this$highlightUser;
|
|
223
|
+
return ((_this$highlightUser = this.highlightUser) === null || _this$highlightUser === void 0 ? void 0 : _this$highlightUser.userId) || '';
|
|
224
|
+
}
|
|
225
|
+
}, {
|
|
226
|
+
key: "localUserId",
|
|
227
|
+
get: function get() {
|
|
228
|
+
return this._userControl.getLocalUser().userId;
|
|
229
|
+
}
|
|
230
|
+
}, {
|
|
231
|
+
key: "userListSource",
|
|
232
|
+
get: function get() {
|
|
233
|
+
return this._participantStore.userListSource;
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
key: "cameraEnabled",
|
|
237
|
+
get: function get() {
|
|
238
|
+
return this._deviceStore.cameraEnabled;
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
key: "cameraId",
|
|
242
|
+
get: function get() {
|
|
243
|
+
return this._deviceStore.cameraId;
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
key: "localMicVolume",
|
|
247
|
+
get: function get() {
|
|
248
|
+
return this._deviceStore.microphoneVolumeLevel;
|
|
249
|
+
}
|
|
250
|
+
}, {
|
|
251
|
+
key: "_setAudioVolumeMap",
|
|
252
|
+
value: function _setAudioVolumeMap(userId, info) {
|
|
253
|
+
this.audioVolumeMap.set(userId, info);
|
|
254
|
+
}
|
|
255
|
+
}, {
|
|
256
|
+
key: "_deleteInfoInAudioVolumeMapByUserId",
|
|
257
|
+
value: function _deleteInfoInAudioVolumeMapByUserId(userId) {
|
|
258
|
+
this.audioVolumeMap["delete"](userId);
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
key: "_handleHighLightUserTransaction",
|
|
262
|
+
value: function _handleHighLightUserTransaction() {
|
|
263
|
+
var _this = this;
|
|
264
|
+
this._hightlightTimber = setInterval(function () {
|
|
265
|
+
// 1秒轮询一次
|
|
266
|
+
// 说话音量超过20,且持续说话时间超过1s,被认为是语音激励对象
|
|
267
|
+
// 停止说话超过2s,结束语音激励,视频窗口显示最后1次发言人
|
|
268
|
+
|
|
269
|
+
// 固定每秒更新本地用户的音量值
|
|
270
|
+
var localUserVolume = _this._deviceStore.microphoneVolumeLevel;
|
|
271
|
+
if (localUserVolume > 0) {
|
|
272
|
+
_this._setAudioVolumeMap(_this._participantStore.localUser.userId, {
|
|
273
|
+
volume: localUserVolume,
|
|
274
|
+
streamId: _this.localAudioStreamId || ''
|
|
275
|
+
});
|
|
276
|
+
} else {
|
|
277
|
+
_this._deleteInfoInAudioVolumeMapByUserId(_this._participantStore.localUser.userId);
|
|
278
|
+
_this._userVolumeMap["delete"](_this._participantStore.localUser.userId);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// 语音激励关闭,参与激励的用户少于两人,清除highligh user,并接受轮询
|
|
282
|
+
if (_this._participantStore.participantCount <= MIN_SPOTLIGHT_NUMBER || !_this.spotlightEnabled || _this.audioVolumeMap.size === 0) {
|
|
283
|
+
_this.setHighLightUser(null);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// 语音激励者突然离会,清除他的相关信息
|
|
288
|
+
var isHightUserStillInDataSource = _this.userListSource.find(function (user) {
|
|
289
|
+
return user.userId === _this.highlightUserId;
|
|
290
|
+
});
|
|
291
|
+
if (!isHightUserStillInDataSource) {
|
|
292
|
+
_this.setHighLightUser(null);
|
|
293
|
+
_this._userVolumeMap["delete"](_this.highlightUserId);
|
|
294
|
+
}
|
|
295
|
+
var temp = new Map();
|
|
296
|
+
_this.audioVolumeMap.forEach(function (volumeObj, userId) {
|
|
297
|
+
var volume = volumeObj.volume,
|
|
298
|
+
streamId = volumeObj.streamId;
|
|
299
|
+
var streamInfo = _this._streamControl.getStreamByStreamId(streamId);
|
|
300
|
+
var inputVolume = (streamInfo === null || streamInfo === void 0 ? void 0 : streamInfo.audioSourceState) === _fcrCore.FcrMediaSourceState.CLOSE || (streamInfo === null || streamInfo === void 0 ? void 0 : streamInfo.audioSourceState) === _fcrCore.FcrMediaSourceState.ERROR ? 0 : volume;
|
|
301
|
+
var volumes = _this._userVolumeMap.get(userId);
|
|
302
|
+
var newVolumes = [inputVolume].concat((0, _toConsumableArray2["default"])(volumes || [])).slice(0, 3);
|
|
303
|
+
_this._userVolumeMap.set(userId, newVolumes);
|
|
304
|
+
});
|
|
305
|
+
_this._userVolumeMap.forEach(function (volumes, userId) {
|
|
306
|
+
var flag = checkFirstNGreaterThanTarget(volumes, 2, 20);
|
|
307
|
+
if (flag) {
|
|
308
|
+
temp.set(userId, volumes);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
_this.setHighLightUsersMap(temp);
|
|
312
|
+
// // 没有计算出
|
|
313
|
+
if (_this.highlightUsersMap.size > 0) {
|
|
314
|
+
// 当前没有highlightUser 或者 上一次的hightlightUser最近两秒没有再成为highlightUser
|
|
315
|
+
if (!_this.highlightUser || _this.highlightUser && !_this.highlightUsersMap.get(_this.highlightUser.userId)) {
|
|
316
|
+
var _this$highlightUser2;
|
|
317
|
+
// 设置hightUsers中音量最大的那一个为highlightUser
|
|
318
|
+
var currentMaxVolumeUserId = _this._getMaxVolumeUserId();
|
|
319
|
+
_this.setHighLightUser(_this._participantStore.participantList.find(function (user) {
|
|
320
|
+
return user.userId === currentMaxVolumeUserId;
|
|
321
|
+
}) || null);
|
|
322
|
+
_this._participantStore.setSpotlightUserId(((_this$highlightUser2 = _this.highlightUser) === null || _this$highlightUser2 === void 0 ? void 0 : _this$highlightUser2.userId) || '');
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
// 两秒之内没有任何一个人的音量超过20,则清除激励对象
|
|
326
|
+
_this.setHighLightUser(null);
|
|
327
|
+
}
|
|
328
|
+
}, 1000);
|
|
329
|
+
}
|
|
330
|
+
}, {
|
|
331
|
+
key: "setHighLightUsersMap",
|
|
332
|
+
value: function setHighLightUsersMap(temp) {
|
|
333
|
+
this.highlightUsersMap = temp;
|
|
334
|
+
}
|
|
335
|
+
}, {
|
|
336
|
+
key: "setHighLightUser",
|
|
337
|
+
value: function setHighLightUser(user) {
|
|
338
|
+
this.highlightUser = user;
|
|
339
|
+
}
|
|
340
|
+
}, {
|
|
341
|
+
key: "_getMaxVolumeUserId",
|
|
342
|
+
value: function _getMaxVolumeUserId() {
|
|
343
|
+
var _this2 = this;
|
|
344
|
+
if (!this.spotlightEnabled) {
|
|
345
|
+
return '';
|
|
346
|
+
}
|
|
347
|
+
var maxVolume = -1;
|
|
348
|
+
var maxVolumeUserId = '';
|
|
349
|
+
this.highlightUsersMap.forEach(function (volumes, userId) {
|
|
350
|
+
var newestVolume = volumes[0];
|
|
351
|
+
if (newestVolume) {
|
|
352
|
+
if (newestVolume > maxVolume) {
|
|
353
|
+
maxVolume = newestVolume;
|
|
354
|
+
maxVolumeUserId = userId;
|
|
355
|
+
}
|
|
356
|
+
if (maxVolume < _this2.localMicVolume) {
|
|
357
|
+
maxVolume = _this2.localMicVolume;
|
|
358
|
+
maxVolumeUserId = _this2.localUserId;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return maxVolumeUserId;
|
|
363
|
+
}
|
|
364
|
+
}, {
|
|
365
|
+
key: "videoCount",
|
|
366
|
+
get: function get() {
|
|
367
|
+
return this._participantStore.participantList.filter(function (user) {
|
|
368
|
+
return user.hasVideo;
|
|
369
|
+
}).length;
|
|
370
|
+
}
|
|
371
|
+
}, {
|
|
372
|
+
key: "spotlightEnabled",
|
|
373
|
+
get: function get() {
|
|
374
|
+
return this._settingStore.setting.spotlightEnabled;
|
|
375
|
+
}
|
|
376
|
+
}, {
|
|
377
|
+
key: "speakerLayOutDefaultUser",
|
|
378
|
+
get: function get() {
|
|
379
|
+
var _this$boardUser;
|
|
380
|
+
// 如果设置了隐藏非视频参与者,且当前没有视频参与者,则不展示内容
|
|
381
|
+
if (this._settingStore.setting.shouldHideNonVideoParticipants) {
|
|
382
|
+
return this.shareScreenUser.hasVideo ? this.shareScreenUser : null;
|
|
383
|
+
}
|
|
384
|
+
if (this.shareScreenUser.userId) {
|
|
385
|
+
return this.shareScreenUser;
|
|
386
|
+
}
|
|
387
|
+
if ((_this$boardUser = this.boardUser) !== null && _this$boardUser !== void 0 && _this$boardUser.userId) {
|
|
388
|
+
return this.boardUser;
|
|
389
|
+
}
|
|
390
|
+
return null;
|
|
391
|
+
}
|
|
392
|
+
}, {
|
|
393
|
+
key: "shareScreenUser",
|
|
394
|
+
get: function get() {
|
|
395
|
+
var shareScreenOwner = this._participantStore.userListSource.find(function (user) {
|
|
396
|
+
return user.streams.some(function (stream) {
|
|
397
|
+
return stream.videoSourceType === _type2.AgoraRteVideoSourceType.SCREEN;
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
var shareUser = shareScreenOwner ? this._participantStore.formatUser(shareScreenOwner) : undefined;
|
|
401
|
+
return _objectSpread({}, shareUser);
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
key: "_onWhiteboardActive",
|
|
405
|
+
value: function _onWhiteboardActive(ownerId, _) {
|
|
406
|
+
this.boardOwnerUserId = ownerId;
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
key: "_onWhiteboardInactive",
|
|
410
|
+
value: function _onWhiteboardInactive(_reason, _) {
|
|
411
|
+
this.boardOwnerUserId = undefined;
|
|
412
|
+
}
|
|
413
|
+
}, {
|
|
414
|
+
key: "boardUser",
|
|
415
|
+
get: function get() {
|
|
416
|
+
var _this3 = this;
|
|
417
|
+
if (this.boardOwnerUserId) {
|
|
418
|
+
return this._participantStore.participantList.find(function (user) {
|
|
419
|
+
return user.userId === _this3.boardOwnerUserId;
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "_onAudioVolumeUpdated",
|
|
426
|
+
value: function _onAudioVolumeUpdated(_roomId, streamId, volume) {
|
|
427
|
+
var stream = this._streamControl.getStreamByStreamId(streamId);
|
|
428
|
+
if (!stream) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (volume <= 0) {
|
|
432
|
+
this.logger.info('[FcrMobileMemberLayout] h5 onStreamVolumeIndicationUpdated volume <= 0');
|
|
433
|
+
}
|
|
434
|
+
var ownerId = stream.owner.userId;
|
|
435
|
+
var computVolume = Math.floor(volume / 255 * 100);
|
|
436
|
+
this.audioVolumeMap.set(ownerId, {
|
|
437
|
+
volume: computVolume,
|
|
438
|
+
streamId: streamId
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}, {
|
|
442
|
+
key: "startPlayLocalVideo",
|
|
443
|
+
value: function startPlayLocalVideo(view) {
|
|
444
|
+
this._deviceStore.startPlayLocalVideo(view, this._deviceStore.isLocalMirrorEnabled);
|
|
445
|
+
}
|
|
446
|
+
}, {
|
|
447
|
+
key: "stopPlayLocalVideo",
|
|
448
|
+
value: function stopPlayLocalVideo(view) {
|
|
449
|
+
this._deviceStore.stopPlayLocalVideo(view);
|
|
450
|
+
}
|
|
451
|
+
}, {
|
|
452
|
+
key: "startRenderRemoteVideoStream",
|
|
453
|
+
value: function startRenderRemoteVideoStream(streamId, type, config, view) {
|
|
454
|
+
this._streamControl.startRenderRemoteVideoStream(streamId, type, config, view);
|
|
455
|
+
}
|
|
456
|
+
}, {
|
|
457
|
+
key: "stopRenderRemoteVideoStream",
|
|
458
|
+
value: function stopRenderRemoteVideoStream(streamId, view) {
|
|
459
|
+
this._streamControl.stopRenderRemoteVideoStream(streamId, view);
|
|
460
|
+
}
|
|
461
|
+
}, {
|
|
462
|
+
key: "release",
|
|
463
|
+
value: function release() {
|
|
464
|
+
this._streamControl.removeObserver(this._streamsObserver);
|
|
465
|
+
this._whiteBoredControl.removeObserver(this._whiteboardObserver);
|
|
466
|
+
clearInterval(this._hightlightTimber);
|
|
467
|
+
}
|
|
468
|
+
}]);
|
|
469
|
+
}();
|
|
470
|
+
_Store = Store;
|
|
471
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_Store, [[_mobx.observable, 1, "localUserRole"], [_mobx.observable, 1, "spotlightStreamId"], [_mobx.observable, 1, "microphoneVolumeLevel"], [_mobx.observable, 1, "audioVolumeMap"], [_mobx.observable, 1, "highlightUsersMap"], [_mobx.observable, 1, "highlightUser"], [_mobx.observable, 1, "boardOwnerUserId"], [_mobx.computed, 3, "localAudioStreamId"], [_mobx.computed, 3, "highlightUserId"], [_mobx.computed, 3, "localUserId"], [_mobx.computed, 3, "userListSource"], [_mobx.computed, 3, "localMicVolume"], [_setAudioVolumeMapDecs, 18, "_setAudioVolumeMap"], [_deleteInfoInAudioVolumeMapByUserIdDecs, 18, "_deleteInfoInAudioVolumeMapByUserId"], [_handleHighLightUserTransactionDecs, 18, "_handleHighLightUserTransaction"], [_setHighLightUsersMapDecs, 18, "setHighLightUsersMap"], [_setHighLightUserDecs, 18, "setHighLightUser"], [_mobx.computed, 3, "videoCount"], [_onWhiteboardActiveDecs, 18, "_onWhiteboardActive"], [_onWhiteboardInactiveDecs, 18, "_onWhiteboardInactive"], [_onAudioVolumeUpdatedDecs, 18, "_onAudioVolumeUpdated"], [_decorator.bound, 2, "startPlayLocalVideo"], [_decorator.bound, 2, "stopPlayLocalVideo"], [_decorator.bound, 2, "startRenderRemoteVideoStream"], [_decorator.bound, 2, "stopRenderRemoteVideoStream"]], []).e, 8);
|
|
472
|
+
_init_localUserRole = _applyDecs$e[0];
|
|
473
|
+
_init_spotlightStreamId = _applyDecs$e[1];
|
|
474
|
+
_init_microphoneVolumeLevel = _applyDecs$e[2];
|
|
475
|
+
_init_audioVolumeMap = _applyDecs$e[3];
|
|
476
|
+
_init_highlightUsersMap = _applyDecs$e[4];
|
|
477
|
+
_init_highlightUser = _applyDecs$e[5];
|
|
478
|
+
_init_boardOwnerUserId = _applyDecs$e[6];
|
|
479
|
+
_initProto = _applyDecs$e[7];
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
.fcr-user-window {
|
|
2
|
+
display: flex;
|
|
3
|
+
background-color: var(--fcr_ui_scene_video);
|
|
4
|
+
position: relative;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.fcr-user-info {
|
|
14
|
+
position: absolute;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
left: 8px;
|
|
18
|
+
bottom: 8px;
|
|
19
|
+
height: 20px;
|
|
20
|
+
gap:4px;
|
|
21
|
+
max-width: 94%;
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
.fcr-user-name{
|
|
25
|
+
font-size: 10px;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
color: var(--fcr_ui_scene_icontext5, #444B71);
|
|
30
|
+
margin-left: 5px;
|
|
31
|
+
}
|
|
32
|
+
.fcr-member-window-body{
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
font-size: 0;
|
|
38
|
+
}
|
|
39
|
+
.frc-user-icon-group,
|
|
40
|
+
.fcr-user-info-group{
|
|
41
|
+
background: var(--fcr_ui_scene_view_toast, #FFFFFF8C);
|
|
42
|
+
border-radius: var(--fcr_cornerradius_xxxs);
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: flex-start;
|
|
46
|
+
}
|
|
47
|
+
.fcr-user-info-group {
|
|
48
|
+
padding: 5px 5px 5px 0px;
|
|
49
|
+
flex: 1;
|
|
50
|
+
min-width: 0;
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.fcr-cohost {
|
|
55
|
+
border-radius: var(--fcr_cornerradius_xxxs);
|
|
56
|
+
|
|
57
|
+
background-color: var(--fcr_ui_scene_ramp_lightgreen6);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.fcr-host,
|
|
61
|
+
.fcr-sip-device {
|
|
62
|
+
background-color: var(--fcr_ui_scene_ramp_purple6);
|
|
63
|
+
border-radius: var(--fcr_cornerradius_xxxs);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.fcr-user-info-share-icon {
|
|
67
|
+
border-radius: var(--fcr_cornerradius_xxxs);
|
|
68
|
+
background-color: var(--fcr_ui_scene_ramp_green6);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.icon-background{
|
|
72
|
+
background-color: var(--fcr_ui_scene_ramp_green6);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.with-colorful-background {
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
background-color: var(--fcr_ui_scene_ramp_purple6);
|
|
79
|
+
border-radius: 50%;
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
align-items: center;
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
.with-green-background {
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
border-radius: 50%;
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
background-color: var(--fcr_ui_scene_ramp_green6);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.with-gray-background {
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
background-color: var(--fcr_ui_scene_btn3);
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
align-items: center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.fcr-member-window-ask-layer{
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
position: absolute;
|
|
109
|
+
left:0px;
|
|
110
|
+
top:0px;
|
|
111
|
+
background-color: #000000;
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
align-items: center;
|
|
115
|
+
z-index: 800;
|
|
116
|
+
border-radius: var(--fcr_cornerradius_s);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.fcr-member-window-ask-layer-text{
|
|
120
|
+
color:#ffffff;
|
|
121
|
+
}
|