fcr-ui-scene 3.4.0 → 3.4.1
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/ scenes/base.d.ts +10 -0
- package/lib/ scenes/base.js +75 -0
- package/lib/ scenes/main-scene.d.ts +43 -0
- package/lib/ scenes/main-scene.js +368 -0
- package/lib/ scenes/waiting-scene.d.ts +31 -0
- package/lib/ scenes/waiting-scene.js +119 -0
- package/lib/common/device-store.d.ts +1 -2
- package/lib/common/device-store.js +169 -153
- package/lib/common/device-stream-store.d.ts +5 -29
- package/lib/common/device-stream-store.js +47 -93
- package/lib/common/room-store.js +4 -4
- package/lib/common/security-store.d.ts +6 -16
- package/lib/common/security-store.js +16 -17
- package/lib/common/type.d.ts +8 -0
- package/lib/common/type.js +6 -0
- package/lib/creator.js +3 -3
- package/lib/electron/app.js +21 -5
- package/lib/electron/bootstrap-sdk.js +1 -2
- package/lib/electron/injections.d.ts +1 -1
- package/lib/error-fallback.css +62 -0
- package/lib/error-fallback.d.ts +2 -0
- package/lib/error-fallback.js +19 -0
- package/lib/modules/Interpreter/action/delete-btn/index.d.ts +1 -1
- package/lib/modules/Interpreter/action/edit-btn/index.d.ts +0 -1
- package/lib/modules/Interpreter/action/edit-btn/index.js +0 -2
- package/lib/modules/Interpreter/action/switch-btn/index.css +3 -0
- package/lib/modules/Interpreter/action/switch-btn/index.d.ts +2 -4
- package/lib/modules/Interpreter/action/switch-btn/index.js +3 -3
- package/lib/modules/Interpreter/footer/index.css +4 -3
- package/lib/modules/Interpreter/index.d.ts +2 -17
- package/lib/modules/Interpreter/index.js +2 -18
- package/lib/modules/Interpreter/interpreter-list/index.css +5 -1
- package/lib/modules/Interpreter/interpreter-list/index.d.ts +1 -0
- package/lib/modules/Interpreter/interpreter-list/index.js +3 -1
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.css +0 -6
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.d.ts +1 -1
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.css +1 -3
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.d.ts +1 -6
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +55 -81
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/option-Item.d.ts +6 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/option-Item.js +58 -0
- package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.d.ts +1 -1
- package/lib/modules/Interpreter/store.d.ts +36 -29
- package/lib/modules/Interpreter/store.js +575 -606
- package/lib/modules/Interpreter/type.d.ts +41 -0
- package/lib/modules/Interpreter/type.js +20 -0
- package/lib/modules/Interpreter/utils.d.ts +12 -0
- package/lib/modules/Interpreter/utils.js +139 -0
- package/lib/modules/Interpreter/view.d.ts +0 -1
- package/lib/modules/Interpreter/view.js +3 -5
- package/lib/modules/action-bar/action-bar-collapes-items.d.ts +1 -1
- package/lib/modules/action-bar/action-bar-collapes-items.js +11 -11
- package/lib/modules/action-bar/apps/useInterpreter.js +4 -2
- package/lib/modules/action-bar/components/apps/app-item/index.css +35 -0
- package/lib/modules/action-bar/components/apps/app-item/index.d.ts +12 -0
- package/lib/modules/action-bar/components/apps/app-item/index.js +61 -0
- package/lib/modules/action-bar/components/apps/appitems.d.ts +5 -0
- package/lib/modules/action-bar/components/apps/appitems.js +45 -0
- package/lib/modules/action-bar/components/apps/index.css +8 -0
- package/lib/modules/action-bar/components/apps/index.d.ts +4 -0
- package/lib/modules/action-bar/components/apps/index.js +57 -0
- package/lib/modules/action-bar/components/apps/useAppItemOptions.d.ts +9 -0
- package/lib/modules/action-bar/components/apps/useAppItemOptions.js +29 -0
- package/lib/modules/action-bar/components/apps/useBeautyBackground.d.ts +10 -0
- package/lib/modules/action-bar/components/apps/useBeautyBackground.js +36 -0
- package/lib/modules/action-bar/components/apps/useInterpreter.d.ts +14 -0
- package/lib/modules/action-bar/components/apps/useInterpreter.js +37 -0
- package/lib/modules/action-bar/components/apps/useLiveStreaming.d.ts +16 -0
- package/lib/modules/action-bar/components/apps/useLiveStreaming.js +41 -0
- package/lib/modules/action-bar/components/board/index.d.ts +4 -0
- package/lib/modules/action-bar/components/board/index.js +34 -0
- package/lib/modules/action-bar/components/breakout-room/index.d.ts +4 -0
- package/lib/modules/action-bar/components/breakout-room/index.js +32 -0
- package/lib/modules/action-bar/components/chat/index.css +80 -0
- package/lib/modules/action-bar/components/chat/index.d.ts +5 -0
- package/lib/modules/action-bar/components/chat/index.js +154 -0
- package/lib/modules/action-bar/components/device/index.css +162 -0
- package/lib/modules/action-bar/components/device/index.d.ts +8 -0
- package/lib/modules/action-bar/components/device/index.js +611 -0
- package/lib/modules/action-bar/components/interpreter/index.d.ts +6 -0
- package/lib/modules/action-bar/components/interpreter/index.js +41 -0
- package/lib/modules/action-bar/components/item.d.ts +27 -0
- package/lib/modules/action-bar/components/item.js +164 -0
- package/lib/modules/action-bar/components/leave/assign-host.d.ts +10 -0
- package/lib/modules/action-bar/components/leave/assign-host.js +64 -0
- package/lib/modules/action-bar/components/leave/index.css +126 -0
- package/lib/modules/action-bar/components/leave/index.d.ts +3 -0
- package/lib/modules/action-bar/components/leave/index.js +159 -0
- package/lib/modules/action-bar/components/leave/leave-meeting.d.ts +18 -0
- package/lib/modules/action-bar/components/leave/leave-meeting.js +153 -0
- package/lib/modules/action-bar/components/live-streaming/index.d.ts +4 -0
- package/lib/modules/action-bar/components/live-streaming/index.js +39 -0
- package/lib/modules/action-bar/components/more/index.css +114 -0
- package/lib/modules/action-bar/components/more/index.d.ts +5 -0
- package/lib/modules/action-bar/components/more/index.js +83 -0
- package/lib/modules/action-bar/components/more/poppover-content.d.ts +8 -0
- package/lib/modules/action-bar/components/more/poppover-content.js +400 -0
- package/lib/modules/action-bar/components/participants/index.css +21 -0
- package/lib/modules/action-bar/components/participants/index.d.ts +5 -0
- package/lib/modules/action-bar/components/participants/index.js +83 -0
- package/lib/modules/action-bar/components/record/index.css +39 -0
- package/lib/modules/action-bar/components/record/index.d.ts +5 -0
- package/lib/modules/action-bar/components/record/index.js +166 -0
- package/lib/modules/action-bar/components/record/stop-record-dialog.d.ts +5 -0
- package/lib/modules/action-bar/components/record/stop-record-dialog.js +48 -0
- package/lib/modules/action-bar/components/respond/index.d.ts +4 -0
- package/lib/modules/action-bar/components/respond/index.js +32 -0
- package/lib/modules/action-bar/components/screen-share/index.d.ts +4 -0
- package/lib/modules/action-bar/components/screen-share/index.js +106 -0
- package/lib/modules/action-bar/components/screen-share/submenu.d.ts +1 -0
- package/lib/modules/action-bar/components/screen-share/submenu.js +154 -0
- package/lib/modules/action-bar/components/security/index.d.ts +4 -0
- package/lib/modules/action-bar/components/security/index.js +58 -0
- package/lib/modules/action-bar/components/settings/index.d.ts +4 -0
- package/lib/modules/action-bar/components/settings/index.js +42 -0
- package/lib/modules/action-bar/index.css +23 -1
- package/lib/modules/action-bar/index.d.ts +2 -22
- package/lib/modules/action-bar/index.dev.js +37 -16
- package/lib/modules/action-bar/notification-bar/components/interpreter/index.css +58 -0
- package/lib/modules/action-bar/notification-bar/components/interpreter/index.d.ts +8 -0
- package/lib/modules/action-bar/notification-bar/components/interpreter/index.js +100 -0
- package/lib/modules/action-bar/notification-bar/components/virtual-image/index.css +56 -0
- package/lib/modules/action-bar/notification-bar/components/virtual-image/index.d.ts +5 -0
- package/lib/modules/action-bar/notification-bar/components/virtual-image/index.js +33 -0
- package/lib/modules/action-bar/notification-bar/dome.png +0 -0
- package/lib/modules/action-bar/notification-bar/fcr_translateswitch.png +0 -0
- package/lib/modules/action-bar/notification-bar/index.css +74 -0
- package/lib/modules/action-bar/notification-bar/index.d.ts +2 -0
- package/lib/modules/action-bar/notification-bar/index.js +99 -0
- package/lib/modules/action-bar/screen-share/index.js +5 -0
- package/lib/modules/action-bar/security/index.js +1 -0
- package/lib/modules/action-bar/smaller.js +2 -2
- package/lib/modules/action-bar/store.d.ts +6 -7
- package/lib/modules/action-bar/store.js +114 -128
- package/lib/modules/action-bar/trigger-input-language-room/fcr_translateswitch.png +0 -0
- package/lib/modules/action-bar/trigger-input-language-room/index.css +86 -0
- package/lib/modules/action-bar/trigger-input-language-room/index.d.ts +15 -0
- package/lib/modules/action-bar/trigger-input-language-room/index.js +220 -0
- package/lib/modules/action-bar/trigger-output-language-room/constant.d.ts +10 -0
- package/lib/modules/action-bar/trigger-output-language-room/constant.js +8 -0
- package/lib/modules/action-bar/trigger-output-language-room/guide-tooltip/index.css +22 -0
- package/lib/modules/action-bar/trigger-output-language-room/guide-tooltip/index.d.ts +14 -0
- package/lib/modules/action-bar/trigger-output-language-room/guide-tooltip/index.js +75 -0
- package/lib/modules/action-bar/trigger-output-language-room/index.d.ts +4 -0
- package/lib/modules/action-bar/trigger-output-language-room/index.js +98 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-language-room.d.ts +5 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-language-room.js +66 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-main-room.d.ts +5 -0
- package/lib/modules/action-bar/trigger-output-language-room/trigger-main-room.js +36 -0
- package/lib/modules/action-bar/trigger-output-language-room/useChangeOutputRoomTool.d.ts +12 -0
- package/lib/modules/action-bar/trigger-output-language-room/useChangeOutputRoomTool.js +138 -0
- package/lib/modules/action-bar/view.js +6 -6
- package/lib/modules/audio-stream/index.d.ts +2 -15
- package/lib/modules/audio-stream/index.js +1 -3
- package/lib/modules/chat/chat-bar/index.css +5 -0
- package/lib/modules/chat/chat-bar/index.js +16 -14
- package/lib/modules/chat/chat-select/index.css +6 -3
- package/lib/modules/chat/chat.js +7 -6
- package/lib/modules/chat/index.css +10 -0
- package/lib/modules/chat/index.d.ts +2 -12
- package/lib/modules/chat/index.dev.js +14 -3
- package/lib/modules/chat/index.js +7 -20
- package/lib/modules/chat/message-list.js +1 -0
- package/lib/modules/chat/store.js +1 -1
- package/lib/modules/components/device-control/components/audio-menu/index.js +4 -4
- package/lib/modules/components/device-control/index.css +3 -0
- package/lib/modules/components/dialog-container/component/body.d.ts +7 -0
- package/lib/modules/components/dialog-container/component/body.js +46 -0
- package/lib/modules/components/dialog-container/index.css +78 -0
- package/lib/modules/components/dialog-container/index.d.ts +11 -0
- package/lib/modules/components/dialog-container/index.js +110 -0
- package/lib/modules/components/member-window/index.css +419 -0
- package/lib/modules/components/member-window/index.d.ts +76 -0
- package/lib/modules/components/member-window/index.js +888 -0
- package/lib/modules/components/security-menu/index.css +9 -0
- package/lib/modules/components/security-menu/index.js +74 -23
- package/lib/modules/components/tab-frame/index.css +40 -0
- package/lib/modules/components/tab-frame/index.d.ts +12 -0
- package/lib/modules/components/tab-frame/index.js +57 -0
- package/lib/modules/connection-gateway/components/computer/index.css +1 -0
- package/lib/modules/connection-gateway/components/phone/index.css +1 -1
- package/lib/modules/connection-gateway/index.d.ts +2 -9
- package/lib/modules/connection-gateway/store.d.ts +3 -11
- package/lib/modules/connection-gateway/store.js +1 -17
- package/lib/modules/connection-gateway/view.js +21 -4
- package/lib/modules/control-bar/components/cloud-recording-buttons.js +1 -1
- package/lib/modules/control-bar/index.d.ts +2 -16
- package/lib/modules/control-bar/index.js +10 -19
- package/lib/modules/control-bar/store.d.ts +3 -16
- package/lib/modules/control-bar/store.js +23 -5
- package/lib/modules/control-bar/view.js +17 -10
- package/lib/modules/device-pretest/settings/virtual-background-setting.js +1 -1
- package/lib/modules/dialog/components/Interpreter/electron.js +3 -25
- package/lib/modules/dialog/components/Interpreter/index.js +14 -43
- package/lib/modules/dialog/components/chat/electron.d.ts +1 -1
- package/lib/modules/dialog/components/chat/electron.js +6 -13
- package/lib/modules/dialog/components/chat/index.d.ts +1 -4
- package/lib/modules/dialog/components/chat/index.js +35 -41
- package/lib/modules/dialog/components/confirm/index.js +6 -7
- package/lib/modules/dialog/components/connection-gateway/electron.d.ts +1 -1
- package/lib/modules/dialog/components/connection-gateway/electron.js +9 -28
- package/lib/modules/dialog/components/connection-gateway/index.d.ts +0 -1
- package/lib/modules/dialog/components/connection-gateway/index.js +11 -56
- package/lib/modules/dialog/components/control-bar/index.js +6 -7
- package/lib/modules/dialog/components/device-setting/electron.js +4 -26
- package/lib/modules/dialog/components/device-setting/index.js +13 -41
- package/lib/modules/dialog/components/invite/index.js +16 -35
- package/lib/modules/dialog/components/live-streaming/index.js +18 -53
- package/lib/modules/dialog/components/participant/electron.js +4 -17
- package/lib/modules/dialog/components/participant/index.js +35 -26
- package/lib/modules/dialog/components/remove-admit-waiting-room/electron.js +3 -6
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.d.ts +1 -1
- package/lib/modules/dialog/components/remove-admit-waiting-room/index.js +4 -14
- package/lib/modules/dialog/components/share-screen-selection/index.js +20 -5
- package/lib/modules/dialog/components/system-preference/electron.js +5 -8
- package/lib/modules/dialog/components/system-preference/index.js +4 -15
- package/lib/modules/dialog/components/toast/index.js +8 -12
- package/lib/modules/dialog/dialogs.js +2 -1
- package/lib/modules/dialog/hooks/useElectron.d.ts +6 -0
- package/lib/modules/dialog/hooks/useElectron.js +51 -9
- package/lib/modules/dialog/index.css +0 -2
- package/lib/modules/dialog/index.d.ts +2 -17
- package/lib/modules/dialog/store.d.ts +7 -39
- package/lib/modules/dialog/store.js +53 -152
- package/lib/modules/dialog/types/index.d.ts +59 -0
- package/lib/modules/event-confirm/view.js +4 -1
- package/lib/modules/invite/view.d.ts +4 -0
- package/lib/modules/invite/view.js +18 -22
- package/lib/modules/invite/voip-invite.js +3 -3
- package/lib/modules/layout/components/Aside.js +11 -1
- package/lib/modules/layout/components/Carousel.js +1 -1
- package/lib/modules/layout/components/Layout.js +7 -4
- package/lib/modules/layout/components/index.css +6 -1
- package/lib/modules/layout/index.js +8 -7
- package/lib/modules/layout/member-window/index.css +22 -9
- package/lib/modules/layout/member-window/index.js +16 -3
- package/lib/modules/layout/store.d.ts +1 -1
- package/lib/modules/layout/store.js +1 -7
- package/lib/modules/layout/video-window-datasource.js +11 -3
- package/lib/modules/notification/index.css +1 -0
- package/lib/modules/participant/attendee/index.css +1 -0
- package/lib/modules/participant/attendee/index.js +2 -1
- package/lib/modules/participant/components/drop-menu/index.css +1 -0
- package/lib/modules/participant/components/drop-menu/index.js +9 -9
- package/lib/modules/participant/index.css +5 -0
- package/lib/modules/participant/index.d.ts +2 -17
- package/lib/modules/participant/index.dev.js +38 -27
- package/lib/modules/participant/store.d.ts +4 -17
- package/lib/modules/participant/store.js +13 -13
- package/lib/modules/setting/audio-settings/audio-settings.js +13 -10
- package/lib/modules/setting/audio-settings/index.css +26 -1
- package/lib/modules/setting/general-settings/index.css +1 -1
- package/lib/modules/setting/index.css +2 -1
- package/lib/modules/setting/index.d.ts +2 -15
- package/lib/modules/setting/index.dev.js +19 -10
- package/lib/modules/setting/store.d.ts +5 -18
- package/lib/modules/setting/store.js +48 -20
- package/lib/modules/setting/translate-settings/index.css +3 -1
- package/lib/modules/setting/video-settings/index.css +5 -2
- package/lib/modules/share-screen/index.dev.js +20 -19
- package/lib/modules/share-screen/selection/index.css +2 -0
- package/lib/modules/share-screen/selection/index.js +83 -97
- package/lib/modules/share-screen/store.js +16 -36
- package/lib/modules/sound-effect/index.d.ts +2 -13
- package/lib/modules/sound-effect/index.js +1 -2
- package/lib/modules/state-bar/index.css +13 -2
- package/lib/modules/state-bar/index.d.ts +1 -5
- package/lib/modules/state-bar/index.dev.js +1 -1
- package/lib/modules/state-bar/index.js +0 -27
- package/lib/modules/state-bar/layout-config.js +1 -1
- package/lib/modules/state-bar/meeting-network-state.css +1 -1
- package/lib/modules/state-bar/recording.js +7 -4
- package/lib/modules/state-bar/view.js +1 -1
- package/lib/modules/video-window/index.d.ts +2 -2
- package/lib/modules/video-window/store.d.ts +2 -1
- package/lib/modules/video-window/store.js +2 -2
- package/lib/modules/waiting-room-layout/index.css +1 -3
- package/lib/modules/waiting-room-layout/index.d.ts +3 -1
- package/lib/modules/waiting-room-layout/index.js +10 -3
- package/lib/modules/whiteboard/index.d.ts +2 -13
- package/lib/modules/whiteboard/index.js +4 -5
- package/lib/providers/device-privilege-provider.d.ts +30 -0
- package/lib/providers/device-privilege-provider.js +386 -0
- package/lib/providers/device-provider.d.ts +246 -0
- package/lib/providers/device-provider.js +1741 -0
- package/lib/providers/device-stream-provider.d.ts +36 -0
- package/lib/providers/device-stream-provider.js +460 -0
- package/lib/providers/event-provider.d.ts +108 -0
- package/lib/providers/event-provider.js +288 -0
- package/lib/providers/interpreter-provider.d.ts +25 -0
- package/lib/providers/interpreter-provider.js +151 -0
- package/lib/providers/local-storage-provider.d.ts +8 -0
- package/lib/providers/local-storage-provider.js +31 -0
- package/lib/providers/monitor-provider.d.ts +15 -0
- package/lib/providers/monitor-provider.js +29 -0
- package/lib/providers/privilege-provider.d.ts +216 -0
- package/lib/providers/privilege-provider.js +966 -0
- package/lib/providers/renderer-provider.d.ts +43 -0
- package/lib/providers/renderer-provider.js +245 -0
- package/lib/providers/room-provider.d.ts +79 -0
- package/lib/providers/room-provider.js +439 -0
- package/lib/providers/session-provider.d.ts +26 -0
- package/lib/providers/session-provider.js +49 -0
- package/lib/runtime.d.ts +1 -1
- package/lib/scenes/base.d.ts +10 -0
- package/lib/scenes/base.js +75 -0
- package/lib/scenes/main-scene.d.ts +48 -0
- package/lib/scenes/main-scene.js +390 -0
- package/lib/scenes/waiting-scene.d.ts +31 -0
- package/lib/scenes/waiting-scene.js +129 -0
- package/lib/shared-data-source/config.d.ts +16 -0
- package/lib/shared-data-source/config.js +21 -0
- package/lib/type.d.ts +26 -1
- package/lib/ui-manager.d.ts +3 -0
- package/lib/ui-manager.js +154 -233
- package/lib/ui-node.d.ts +25 -0
- package/lib/ui-node.js +156 -0
- package/lib/utilities/constant.d.ts +15 -15
- package/lib/utilities/constant.js +15 -15
- package/lib/utilities/tools.d.ts +2 -0
- package/lib/utilities/tools.js +42 -10
- package/package.json +12 -11
- package/public/assets/fcr_leave2.svg +58 -0
- package/public/index.html +150 -13
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FcrBaseRoomControl } from 'fcr-core/lib/room-control/type';
|
|
2
|
+
import { FcrUIDeviceProvider } from '../providers/device-provider';
|
|
3
|
+
import { FcrUIPrivilegeProvider } from '../providers/privilege-provider';
|
|
4
|
+
import { FcrUIEventProvider } from '../providers/event-provider';
|
|
5
|
+
export interface FcrUIDeviceStreamProvider {
|
|
6
|
+
enableCameraWithStream(enable: boolean): void;
|
|
7
|
+
enableMicrophoneWithStream(enable: boolean, confirmAudioShareWhileMicOff?: boolean): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class FcrUIDeviceStreamProviderImpl implements FcrUIDeviceStreamProvider {
|
|
10
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
11
|
+
private _roomControl;
|
|
12
|
+
private _deviceProvider;
|
|
13
|
+
private _privilegeProvider;
|
|
14
|
+
private _eventProvider;
|
|
15
|
+
private _cameraDeviceId;
|
|
16
|
+
private _microphoneDeviceId;
|
|
17
|
+
private _interpreterControl;
|
|
18
|
+
private get _localUser();
|
|
19
|
+
private get _localCameraStream();
|
|
20
|
+
private get _localLoopbackStream();
|
|
21
|
+
private get _canStartLocalVideo();
|
|
22
|
+
private get _canStartLocalAudio();
|
|
23
|
+
private _firstGetMicrophonePrivilege;
|
|
24
|
+
constructor(roomControl: FcrBaseRoomControl, privilegeProvider: FcrUIPrivilegeProvider, deviceProvider: FcrUIDeviceProvider, eventProvider: FcrUIEventProvider);
|
|
25
|
+
checkoutDevicePermission(mediaType: 'camera' | 'microphone'): Promise<boolean>;
|
|
26
|
+
enableCameraWithStream(enable: boolean): Promise<void>;
|
|
27
|
+
enableMicrophoneWithStream(enable: boolean, confirmAudioShareWhileMicOff?: boolean): Promise<void>;
|
|
28
|
+
release(): void;
|
|
29
|
+
private _initLocalStream;
|
|
30
|
+
private _handleCameraChanged;
|
|
31
|
+
private _handleMicrophoneChanged;
|
|
32
|
+
private _bindLocalAudioStream;
|
|
33
|
+
private _bindLocalVideoStream;
|
|
34
|
+
private _handleProcessEvent;
|
|
35
|
+
_getInterpreterInfo(): import("fcr-core/lib/room-control/interpreter-control/types").FcrInterpreterUserInfo | null | undefined;
|
|
36
|
+
}
|
|
@@ -0,0 +1,460 @@
|
|
|
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.iterator.js");
|
|
10
|
+
require("core-js/modules/es.array.push.js");
|
|
11
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
12
|
+
require("core-js/modules/es.function.bind.js");
|
|
13
|
+
require("core-js/modules/es.function.name.js");
|
|
14
|
+
require("core-js/modules/es.map.js");
|
|
15
|
+
require("core-js/modules/es.number.constructor.js");
|
|
16
|
+
require("core-js/modules/es.object.create.js");
|
|
17
|
+
require("core-js/modules/es.object.define-property.js");
|
|
18
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
19
|
+
require("core-js/modules/es.string.iterator.js");
|
|
20
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
21
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
22
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
23
|
+
require("core-js/modules/esnext.map.every.js");
|
|
24
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
25
|
+
require("core-js/modules/esnext.map.find.js");
|
|
26
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
27
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
28
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
29
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
30
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
31
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
32
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
33
|
+
require("core-js/modules/esnext.map.some.js");
|
|
34
|
+
require("core-js/modules/esnext.map.update.js");
|
|
35
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
36
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
37
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
38
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
39
|
+
Object.defineProperty(exports, "__esModule", {
|
|
40
|
+
value: true
|
|
41
|
+
});
|
|
42
|
+
exports.FcrUIDeviceStreamProviderImpl = void 0;
|
|
43
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
44
|
+
require("core-js/modules/es.array.find.js");
|
|
45
|
+
require("core-js/modules/es.object.to-string.js");
|
|
46
|
+
require("core-js/modules/esnext.async-iterator.find.js");
|
|
47
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
48
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
49
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
50
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
51
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
52
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
53
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
54
|
+
var _fcrCore = require("fcr-core");
|
|
55
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
56
|
+
var _mobx = require("mobx");
|
|
57
|
+
var _type = require("agora-rte-sdk/lib/core/scene/type");
|
|
58
|
+
var _type2 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
59
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
60
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
61
|
+
var _rendererEvent = require("../utilities/renderer-event");
|
|
62
|
+
var _type3 = require("fcr-core/lib/room-control/type");
|
|
63
|
+
var _env = require("agora-foundation/lib/utilities/env");
|
|
64
|
+
var _constant = require("../utilities/constant");
|
|
65
|
+
var _base = require("../base");
|
|
66
|
+
var _FcrUIDeviceStreamProviderImpl;
|
|
67
|
+
var _initProto, _checkoutDevicePermissionDecs, _enableCameraWithStreamDecs, _enableMicrophoneWithStreamDecs, _getInterpreterInfoDecs, _ref;
|
|
68
|
+
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)]; } }; }
|
|
69
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
70
|
+
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); }
|
|
71
|
+
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; }
|
|
72
|
+
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; }
|
|
73
|
+
_ref = (_checkoutDevicePermissionDecs = [_mobx.action, _mobx.action.bound], _enableCameraWithStreamDecs = [_mobx.action, _mobx.action.bound], _enableMicrophoneWithStreamDecs = [_mobx.action, _mobx.action.bound], _getInterpreterInfoDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
74
|
+
var FcrUIDeviceStreamProviderImpl = exports.FcrUIDeviceStreamProviderImpl = /*#__PURE__*/function () {
|
|
75
|
+
function FcrUIDeviceStreamProviderImpl(roomControl, privilegeProvider, deviceProvider, eventProvider) {
|
|
76
|
+
var _roomControl$getRoomI,
|
|
77
|
+
_this = this;
|
|
78
|
+
(0, _classCallCheck2["default"])(this, FcrUIDeviceStreamProviderImpl);
|
|
79
|
+
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.getLogger)()));
|
|
80
|
+
(0, _defineProperty2["default"])(this, "_cameraDeviceId", '');
|
|
81
|
+
(0, _defineProperty2["default"])(this, "_microphoneDeviceId", '');
|
|
82
|
+
(0, _defineProperty2["default"])(this, "_interpreterControl", null);
|
|
83
|
+
(0, _defineProperty2["default"])(this, "_firstGetMicrophonePrivilege", true);
|
|
84
|
+
this._roomControl = roomControl;
|
|
85
|
+
this._privilegeProvider = privilegeProvider;
|
|
86
|
+
this._deviceProvider = deviceProvider;
|
|
87
|
+
this._eventProvider = eventProvider;
|
|
88
|
+
if (((_roomControl$getRoomI = roomControl.getRoomInfo()) === null || _roomControl$getRoomI === void 0 ? void 0 : _roomControl$getRoomI.roomType) === _type3.FcrRoomType.Mainroom) {
|
|
89
|
+
var interpreterControl = roomControl.getInterpreterControl();
|
|
90
|
+
if (interpreterControl) {
|
|
91
|
+
this._interpreterControl = interpreterControl;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this._deviceProvider.addObserver({
|
|
95
|
+
onCameraChanged: this._handleCameraChanged,
|
|
96
|
+
onMicrophoneChanged: this._handleMicrophoneChanged
|
|
97
|
+
});
|
|
98
|
+
var streamControl = this._roomControl.getStreamControl();
|
|
99
|
+
streamControl.addObserver({
|
|
100
|
+
onStreamsAdded: function onStreamsAdded(_, e) {
|
|
101
|
+
var _e$find;
|
|
102
|
+
var localCameraStream = (_e$find = e.find(function (event) {
|
|
103
|
+
return event.modifiedStream.owner.userId === _this._localUser.userId && event.modifiedStream.videoSourceType === _type2.AgoraRtcVideoSourceType.CAMERA;
|
|
104
|
+
})) === null || _e$find === void 0 ? void 0 : _e$find.modifiedStream;
|
|
105
|
+
if (localCameraStream) {
|
|
106
|
+
_this._bindLocalAudioStream();
|
|
107
|
+
_this._bindLocalVideoStream();
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
onStreamsUpdated: function onStreamsUpdated(_, e) {
|
|
111
|
+
var localCamera = e.find(function (event) {
|
|
112
|
+
return event.modifiedStream.owner.userId === _this._localUser.userId && event.modifiedStream.videoSourceType === _type2.AgoraRtcVideoSourceType.CAMERA;
|
|
113
|
+
});
|
|
114
|
+
var localCameraStream = localCamera === null || localCamera === void 0 ? void 0 : localCamera.modifiedStream;
|
|
115
|
+
if (localCameraStream) {
|
|
116
|
+
var _localCamera$operator;
|
|
117
|
+
if (localCameraStream.streamType === _type.AgoraRteMediaStreamType.AUDIO || localCameraStream.streamType === _type.AgoraRteMediaStreamType.NONE) {
|
|
118
|
+
if (_this._deviceProvider.cameraEnabled) {
|
|
119
|
+
_this._deviceProvider.setCameraEnabled(false);
|
|
120
|
+
_this._eventProvider.showToast({
|
|
121
|
+
type: 'error',
|
|
122
|
+
message: (0, _i18n.transI18n)('fmt_uimanager_tips_urturnedoff')
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (_this._getInterpreterInfo() && ((_localCamera$operator = localCamera.operatorUser) === null || _localCamera$operator === void 0 ? void 0 : _localCamera$operator.userId) === _this._localUser.userId) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (localCameraStream.streamType === _type.AgoraRteMediaStreamType.VIDEO || localCameraStream.streamType === _type.AgoraRteMediaStreamType.NONE) {
|
|
130
|
+
if (_this._deviceProvider.microphoneEnabled) {
|
|
131
|
+
_this._deviceProvider.setMicrophoneEnabled(false);
|
|
132
|
+
_this._eventProvider.showToast({
|
|
133
|
+
type: 'error',
|
|
134
|
+
message: (0, _i18n.transI18n)('fmt_uimanager_tips_urmuted')
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
_this._bindLocalAudioStream();
|
|
139
|
+
_this._bindLocalVideoStream();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
var _this$_deviceProvider = this._deviceProvider.currentDeviceId,
|
|
144
|
+
cameraDeviceId = _this$_deviceProvider.cameraDeviceId,
|
|
145
|
+
microphoneDeviceId = _this$_deviceProvider.microphoneDeviceId;
|
|
146
|
+
this._cameraDeviceId = cameraDeviceId;
|
|
147
|
+
this._microphoneDeviceId = microphoneDeviceId;
|
|
148
|
+
this._initLocalStream();
|
|
149
|
+
(0, _rendererEvent.addEventListener)(this._handleProcessEvent);
|
|
150
|
+
}
|
|
151
|
+
return (0, _createClass2["default"])(FcrUIDeviceStreamProviderImpl, [{
|
|
152
|
+
key: "_localUser",
|
|
153
|
+
get: function get() {
|
|
154
|
+
return this._roomControl.getUserControl().getLocalUser();
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "_localCameraStream",
|
|
158
|
+
get: function get() {
|
|
159
|
+
var localStreams = this._roomControl.getStreamControl().getStreamsByUserId(this._localUser.userId);
|
|
160
|
+
return localStreams.find(function (stream) {
|
|
161
|
+
return stream.videoSourceType === _type2.AgoraRtcVideoSourceType.CAMERA;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "_localLoopbackStream",
|
|
166
|
+
get: function get() {
|
|
167
|
+
var localStreams = this._roomControl.getStreamControl().getStreamsByUserId(this._localUser.userId);
|
|
168
|
+
return localStreams.find(function (stream) {
|
|
169
|
+
return stream.audioSourceType === _type2.AgoraRtcAudioSourceType.LOOPBACK;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "_canStartLocalVideo",
|
|
174
|
+
get: function get() {
|
|
175
|
+
return this._privilegeProvider.hasStartVideoPermission(_fcrCore.FcrPrivilegeUserRole.SELF);
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "_canStartLocalAudio",
|
|
179
|
+
get: function get() {
|
|
180
|
+
return this._privilegeProvider.hasUnmutePermission(_fcrCore.FcrPrivilegeUserRole.SELF);
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "checkoutDevicePermission",
|
|
184
|
+
value: function () {
|
|
185
|
+
var _checkoutDevicePermission = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(mediaType) {
|
|
186
|
+
var hasSystemPermission;
|
|
187
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
188
|
+
while (1) switch (_context.prev = _context.next) {
|
|
189
|
+
case 0:
|
|
190
|
+
hasSystemPermission = true;
|
|
191
|
+
if (!(0, _env.isElectron)()) {
|
|
192
|
+
_context.next = 5;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
_context.next = 4;
|
|
196
|
+
return window.runtime.checkMediaPermission(mediaType);
|
|
197
|
+
case 4:
|
|
198
|
+
hasSystemPermission = _context.sent;
|
|
199
|
+
case 5:
|
|
200
|
+
if (!hasSystemPermission) {
|
|
201
|
+
this._eventProvider.openDialog(_constant.FcrUIDialogKey.SYSTEM_PREFERENCE, '', mediaType);
|
|
202
|
+
}
|
|
203
|
+
return _context.abrupt("return", hasSystemPermission);
|
|
204
|
+
case 7:
|
|
205
|
+
case "end":
|
|
206
|
+
return _context.stop();
|
|
207
|
+
}
|
|
208
|
+
}, _callee, this);
|
|
209
|
+
}));
|
|
210
|
+
function checkoutDevicePermission(_x) {
|
|
211
|
+
return _checkoutDevicePermission.apply(this, arguments);
|
|
212
|
+
}
|
|
213
|
+
return checkoutDevicePermission;
|
|
214
|
+
}()
|
|
215
|
+
}, {
|
|
216
|
+
key: "enableCameraWithStream",
|
|
217
|
+
value: function () {
|
|
218
|
+
var _enableCameraWithStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(enable) {
|
|
219
|
+
var _this$_roomControl$ge;
|
|
220
|
+
var hasVideoPublishPrivilege, hasNoSecurityPermission, isMainRoom, hasDeivcePermission;
|
|
221
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
222
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
223
|
+
case 0:
|
|
224
|
+
if (this._deviceProvider.cameraId) {
|
|
225
|
+
_context2.next = 2;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
return _context2.abrupt("return");
|
|
229
|
+
case 2:
|
|
230
|
+
hasVideoPublishPrivilege = this._localCameraStream && (this._localCameraStream.streamType === _fcrCore.FcrStreamType.BOTH || this._localCameraStream.streamType === _fcrCore.FcrStreamType.VIDEO);
|
|
231
|
+
hasNoSecurityPermission = !this._canStartLocalVideo;
|
|
232
|
+
isMainRoom = ((_this$_roomControl$ge = this._roomControl.getRoomInfo()) === null || _this$_roomControl$ge === void 0 ? void 0 : _this$_roomControl$ge.roomType) === _type3.FcrRoomType.Mainroom;
|
|
233
|
+
if (!(hasNoSecurityPermission && isMainRoom && enable)) {
|
|
234
|
+
_context2.next = 11;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
this._eventProvider.showToast({
|
|
238
|
+
type: 'warn',
|
|
239
|
+
message: (0, _i18n.transI18n)('fmt_uimanager_tips_norightsvideo')
|
|
240
|
+
});
|
|
241
|
+
if (!hasVideoPublishPrivilege) {
|
|
242
|
+
_context2.next = 10;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
_context2.next = 10;
|
|
246
|
+
return this._roomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._localCameraStream.streamId, {
|
|
247
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
|
|
248
|
+
audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
249
|
+
}));
|
|
250
|
+
case 10:
|
|
251
|
+
return _context2.abrupt("return");
|
|
252
|
+
case 11:
|
|
253
|
+
if (!(this._localCameraStream && enable && isMainRoom)) {
|
|
254
|
+
_context2.next = 15;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
if (hasVideoPublishPrivilege) {
|
|
258
|
+
_context2.next = 15;
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
_context2.next = 15;
|
|
262
|
+
return this._roomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._localCameraStream.streamId, {
|
|
263
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
|
|
264
|
+
audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
265
|
+
}));
|
|
266
|
+
case 15:
|
|
267
|
+
_context2.next = 17;
|
|
268
|
+
return this.checkoutDevicePermission('camera');
|
|
269
|
+
case 17:
|
|
270
|
+
hasDeivcePermission = _context2.sent;
|
|
271
|
+
if (hasDeivcePermission) {
|
|
272
|
+
this._deviceProvider.setCameraEnabled(enable);
|
|
273
|
+
}
|
|
274
|
+
case 19:
|
|
275
|
+
case "end":
|
|
276
|
+
return _context2.stop();
|
|
277
|
+
}
|
|
278
|
+
}, _callee2, this);
|
|
279
|
+
}));
|
|
280
|
+
function enableCameraWithStream(_x2) {
|
|
281
|
+
return _enableCameraWithStream.apply(this, arguments);
|
|
282
|
+
}
|
|
283
|
+
return enableCameraWithStream;
|
|
284
|
+
}()
|
|
285
|
+
}, {
|
|
286
|
+
key: "enableMicrophoneWithStream",
|
|
287
|
+
value: function () {
|
|
288
|
+
var _enableMicrophoneWithStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(enable) {
|
|
289
|
+
var _this$_roomControl$ge4;
|
|
290
|
+
var confirmAudioShareWhileMicOff,
|
|
291
|
+
hasAudioPublishPrivilege,
|
|
292
|
+
hasNoSecurityPermission,
|
|
293
|
+
isMainRoom,
|
|
294
|
+
hasDeivcePermission,
|
|
295
|
+
_args3 = arguments;
|
|
296
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
297
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
298
|
+
case 0:
|
|
299
|
+
confirmAudioShareWhileMicOff = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false;
|
|
300
|
+
hasAudioPublishPrivilege = this._localCameraStream && (this._localCameraStream.streamType === _fcrCore.FcrStreamType.BOTH || this._localCameraStream.streamType === _fcrCore.FcrStreamType.AUDIO);
|
|
301
|
+
hasNoSecurityPermission = !this._canStartLocalAudio;
|
|
302
|
+
isMainRoom = ((_this$_roomControl$ge4 = this._roomControl.getRoomInfo()) === null || _this$_roomControl$ge4 === void 0 ? void 0 : _this$_roomControl$ge4.roomType) === _type3.FcrRoomType.Mainroom;
|
|
303
|
+
if (!this._firstGetMicrophonePrivilege) {
|
|
304
|
+
_context3.next = 9;
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
this._firstGetMicrophonePrivilege = false;
|
|
308
|
+
if (hasAudioPublishPrivilege) {
|
|
309
|
+
this._deviceProvider.setMicrophoneEnabled(enable);
|
|
310
|
+
}
|
|
311
|
+
_context3.next = 25;
|
|
312
|
+
break;
|
|
313
|
+
case 9:
|
|
314
|
+
if (!(enable && hasNoSecurityPermission && isMainRoom && !this._getInterpreterInfo())) {
|
|
315
|
+
_context3.next = 15;
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
this._eventProvider.showToast({
|
|
319
|
+
type: 'warn',
|
|
320
|
+
message: (0, _i18n.transI18n)('fmt_uimanager_tips_norightsaudio')
|
|
321
|
+
});
|
|
322
|
+
if (!hasAudioPublishPrivilege) {
|
|
323
|
+
_context3.next = 14;
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
_context3.next = 14;
|
|
327
|
+
return this._roomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._localCameraStream.streamId, {
|
|
328
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION,
|
|
329
|
+
audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE
|
|
330
|
+
}));
|
|
331
|
+
case 14:
|
|
332
|
+
return _context3.abrupt("return");
|
|
333
|
+
case 15:
|
|
334
|
+
if (!(isMainRoom && this._localCameraStream)) {
|
|
335
|
+
_context3.next = 21;
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
if (hasAudioPublishPrivilege) {
|
|
339
|
+
_context3.next = 21;
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
if (!enable) {
|
|
343
|
+
_context3.next = 21;
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
if (this._getInterpreterInfo()) {
|
|
347
|
+
_context3.next = 21;
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
_context3.next = 21;
|
|
351
|
+
return this._roomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._localCameraStream.streamId, {
|
|
352
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION,
|
|
353
|
+
audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE
|
|
354
|
+
}));
|
|
355
|
+
case 21:
|
|
356
|
+
_context3.next = 23;
|
|
357
|
+
return this.checkoutDevicePermission('microphone');
|
|
358
|
+
case 23:
|
|
359
|
+
hasDeivcePermission = _context3.sent;
|
|
360
|
+
if (hasDeivcePermission) {
|
|
361
|
+
this._deviceProvider.setMicrophoneEnabled(enable);
|
|
362
|
+
}
|
|
363
|
+
case 25:
|
|
364
|
+
case "end":
|
|
365
|
+
return _context3.stop();
|
|
366
|
+
}
|
|
367
|
+
}, _callee3, this);
|
|
368
|
+
}));
|
|
369
|
+
function enableMicrophoneWithStream(_x3) {
|
|
370
|
+
return _enableMicrophoneWithStream.apply(this, arguments);
|
|
371
|
+
}
|
|
372
|
+
return enableMicrophoneWithStream;
|
|
373
|
+
}()
|
|
374
|
+
}, {
|
|
375
|
+
key: "release",
|
|
376
|
+
value: function release() {
|
|
377
|
+
(0, _rendererEvent.removeEventListener)(this._handleProcessEvent);
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "_initLocalStream",
|
|
381
|
+
value: function _initLocalStream() {
|
|
382
|
+
if (this._localCameraStream) {
|
|
383
|
+
this._bindLocalVideoStream();
|
|
384
|
+
this._bindLocalAudioStream();
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}, {
|
|
388
|
+
key: "_handleCameraChanged",
|
|
389
|
+
value: function _handleCameraChanged(cameraDeviceId) {
|
|
390
|
+
this._cameraDeviceId = cameraDeviceId;
|
|
391
|
+
this._bindLocalVideoStream();
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "_handleMicrophoneChanged",
|
|
395
|
+
value: function _handleMicrophoneChanged(microphoneDeviceId) {
|
|
396
|
+
this._microphoneDeviceId = microphoneDeviceId;
|
|
397
|
+
this._bindLocalAudioStream();
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
key: "_bindLocalAudioStream",
|
|
401
|
+
value: function _bindLocalAudioStream() {
|
|
402
|
+
var streamControl = this._roomControl.getStreamControl();
|
|
403
|
+
var localCameraStream = this._localCameraStream;
|
|
404
|
+
if (localCameraStream && this._microphoneDeviceId && localCameraStream.audioSourceId !== this._microphoneDeviceId) {
|
|
405
|
+
streamControl.bindLocalStreams([{
|
|
406
|
+
streamId: localCameraStream.streamId,
|
|
407
|
+
audioSourceId: this._microphoneDeviceId
|
|
408
|
+
}]);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}, {
|
|
412
|
+
key: "_bindLocalVideoStream",
|
|
413
|
+
value: function _bindLocalVideoStream() {
|
|
414
|
+
var streamControl = this._roomControl.getStreamControl();
|
|
415
|
+
var localCameraStream = this._localCameraStream;
|
|
416
|
+
if (localCameraStream && this._cameraDeviceId && localCameraStream.videoSourceId !== this._cameraDeviceId) {
|
|
417
|
+
streamControl.bindLocalStreams([{
|
|
418
|
+
streamId: localCameraStream.streamId,
|
|
419
|
+
videoSourceId: this._deviceProvider.cameraId
|
|
420
|
+
}]);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}, {
|
|
424
|
+
key: "_handleProcessEvent",
|
|
425
|
+
value: function _handleProcessEvent(event) {
|
|
426
|
+
switch (event.action) {
|
|
427
|
+
case _constant.FcrUIRendererEventAction.POWER_MONITOR_LOCK_SCREEN:
|
|
428
|
+
if (this._deviceProvider.cameraEnabled) {
|
|
429
|
+
this.enableCameraWithStream(false);
|
|
430
|
+
}
|
|
431
|
+
if (this._deviceProvider.microphoneEnabled) {
|
|
432
|
+
this.enableMicrophoneWithStream(false);
|
|
433
|
+
}
|
|
434
|
+
this.logger.info('close camera and microphone due to lock screen');
|
|
435
|
+
break;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}, {
|
|
439
|
+
key: "_getInterpreterInfo",
|
|
440
|
+
value: function
|
|
441
|
+
// 获取本地用户关联的翻译官信息
|
|
442
|
+
_getInterpreterInfo() {
|
|
443
|
+
var _this2 = this;
|
|
444
|
+
if (this._interpreterControl) {
|
|
445
|
+
var interpreterUsers = this._interpreterControl.getInterpreterUserList(); //翻译官列表
|
|
446
|
+
if (interpreterUsers) {
|
|
447
|
+
var interpreter = interpreterUsers.find(function (ele) {
|
|
448
|
+
return ele.userId === _this2._localUser.userId;
|
|
449
|
+
}); //本地用户关联的翻译官信息
|
|
450
|
+
return interpreter;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
}]);
|
|
456
|
+
}();
|
|
457
|
+
_FcrUIDeviceStreamProviderImpl = FcrUIDeviceStreamProviderImpl;
|
|
458
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIDeviceStreamProviderImpl, [[_checkoutDevicePermissionDecs, 18, "checkoutDevicePermission"], [_enableCameraWithStreamDecs, 18, "enableCameraWithStream"], [_enableMicrophoneWithStreamDecs, 18, "enableMicrophoneWithStream"], [_decorator.bound, 2, "_handleCameraChanged"], [_decorator.bound, 2, "_handleMicrophoneChanged"], [_decorator.bound, 2, "_bindLocalAudioStream"], [_decorator.bound, 2, "_bindLocalVideoStream"], [_decorator.bound, 2, "_handleProcessEvent"], [_getInterpreterInfoDecs, 18, "_getInterpreterInfo"]], []).e, 1);
|
|
459
|
+
_initProto = _applyDecs$e[0];
|
|
460
|
+
(0, _base.registerDependency)('deviceStreamProvider');
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { FcrUIDialogKey, FcrUIAction } from '../utilities/constant';
|
|
2
|
+
import { FcrUserInfo } from 'fcr-core/lib/type';
|
|
3
|
+
import { DeviceSettingDialogConfig, CustomSetting } from '../modules/setting/store';
|
|
4
|
+
import { FcrUICloudRecordingParams, FcrUIExitReason, FcrUILayoutSizeChangedParams, FcrUINewChatMessagesParams, FcrUINotificationContentType, FcrUINotificationParams, FcrUISetMainSpeakerParams, FcrUISpotlightStreamChangedParams, FcrUIToastParams, FcrUIToggleLayoutParams, FcrUIToggleLayoutSizeParams, FcrUIUpdateAsideParams } from '../type';
|
|
5
|
+
import { ConfirmContentProps } from 'agora-ui-foundation/lib/components/confirm-content';
|
|
6
|
+
import { FcrRoomType } from 'fcr-core/lib/room-control/type';
|
|
7
|
+
export interface FcrUIEventObserver {
|
|
8
|
+
onEvent?(action: FcrUIAction, payload?: unknown): void;
|
|
9
|
+
}
|
|
10
|
+
export interface FcrUIEventProvider {
|
|
11
|
+
sendEvent(action: FcrUIAction, payload?: unknown): void;
|
|
12
|
+
showToast(params: FcrUIToastParams): void;
|
|
13
|
+
showNotification(params: FcrUINotificationParams): void;
|
|
14
|
+
closeNotification(key: FcrUINotificationContentType): void;
|
|
15
|
+
showChatToast(params: FcrUIToastParams): void;
|
|
16
|
+
/**
|
|
17
|
+
* 默认同一个 title 或 content 的 confirm 窗口只打开一个实例
|
|
18
|
+
* @param key 可以通过 key 区分相同 title 或 content 的 confirm 窗口
|
|
19
|
+
* @param duration 可以通过 duration 配置自动关闭时间
|
|
20
|
+
* @mulitple 可以通过 mulitple 配置打开多个实例(忽略 key)
|
|
21
|
+
* */
|
|
22
|
+
openConfirmDialog(params: ConfirmContentProps & {
|
|
23
|
+
key?: string;
|
|
24
|
+
duration?: number;
|
|
25
|
+
}, mulitple?: boolean): string;
|
|
26
|
+
openDialog(dialogKey: FcrUIDialogKey, instanceId?: string, params?: unknown): string;
|
|
27
|
+
closeDialog(dialogId: string): void;
|
|
28
|
+
closeConfirm(dialogId: string): void;
|
|
29
|
+
startShareScreen(): void;
|
|
30
|
+
stopShareScreen(): void;
|
|
31
|
+
updateAside(params: FcrUIUpdateAsideParams): void;
|
|
32
|
+
receiveNewChatMessages(params: FcrUINewChatMessagesParams): void;
|
|
33
|
+
toggleLayout(params: FcrUIToggleLayoutParams): void;
|
|
34
|
+
notifyLayoutChanged(params: FcrUIToggleLayoutParams): void;
|
|
35
|
+
toggleLayoutSize(params: FcrUIToggleLayoutSizeParams): void;
|
|
36
|
+
notifyLayoutSizeChanged(params: FcrUILayoutSizeChangedParams): void;
|
|
37
|
+
setMainSpeaker(params: FcrUISetMainSpeakerParams): void;
|
|
38
|
+
setUserPinState(userId: string): void;
|
|
39
|
+
updateShareState(isOpen: boolean): void;
|
|
40
|
+
openDeviceSettingDialog(config: Partial<DeviceSettingDialogConfig>): void;
|
|
41
|
+
closeDeviceSettingDialog(): void;
|
|
42
|
+
openLiveStreamingDialog(): void;
|
|
43
|
+
closeLiveStreamingDialog(): void;
|
|
44
|
+
stopLiveStreaming(): void;
|
|
45
|
+
openInviteDialog(): void;
|
|
46
|
+
closeInviteDialog(): void;
|
|
47
|
+
closeWaitingRoomDialog(): void;
|
|
48
|
+
closeRemoveAdmitWaitingRoomDialog(dialogKey: FcrUIDialogKey): void;
|
|
49
|
+
exitRoom(reason: FcrUIExitReason, roomType: number): void;
|
|
50
|
+
cloudRecording(action: FcrUICloudRecordingParams['action']): void;
|
|
51
|
+
notifySpotlightStreamChanged(params: FcrUISpotlightStreamChangedParams): void;
|
|
52
|
+
notifyCustomSettingsChanged(settings: CustomSetting): void;
|
|
53
|
+
notifyChatUpdateTarget(user: FcrUserInfo, roomType: FcrRoomType): void;
|
|
54
|
+
notifyChatResetTarget(): void;
|
|
55
|
+
addObserver(observer: FcrUIEventObserver): void;
|
|
56
|
+
removeObserver(observer: FcrUIEventObserver): void;
|
|
57
|
+
}
|
|
58
|
+
export declare class FcrUIEventProviderImpl implements FcrUIEventProvider {
|
|
59
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
60
|
+
private _observable;
|
|
61
|
+
sendEvent(action: FcrUIAction, payload?: unknown): void;
|
|
62
|
+
showToast(params: FcrUIToastParams): void;
|
|
63
|
+
showNotification(params: FcrUINotificationParams): void;
|
|
64
|
+
closeNotification(key: FcrUINotificationContentType): void;
|
|
65
|
+
showChatToast(params: FcrUIToastParams): void;
|
|
66
|
+
/**
|
|
67
|
+
* 默认同一个 title 或 content 的 confirm 窗口只打开一个实例
|
|
68
|
+
* @param key 可以通过 key 区分相同 title 或 content 的 confirm 窗口
|
|
69
|
+
* @param duration 可以通过 duration 配置自动关闭时间
|
|
70
|
+
* @mulitple 可以通过 mulitple 配置打开多个实例(忽略 key)
|
|
71
|
+
* */
|
|
72
|
+
openConfirmDialog(params: ConfirmContentProps & {
|
|
73
|
+
key?: string;
|
|
74
|
+
duration?: number;
|
|
75
|
+
}, mulitple?: boolean): string;
|
|
76
|
+
openDialog(dialogKey: FcrUIDialogKey, instanceId?: string, params?: unknown): string;
|
|
77
|
+
closeDialog(dialogId: string): void;
|
|
78
|
+
closeConfirm(dialogId: string): void;
|
|
79
|
+
startShareScreen(): void;
|
|
80
|
+
stopShareScreen(): void;
|
|
81
|
+
updateAside(params: FcrUIUpdateAsideParams): void;
|
|
82
|
+
receiveNewChatMessages(params: FcrUINewChatMessagesParams): void;
|
|
83
|
+
toggleLayout(params: FcrUIToggleLayoutParams): void;
|
|
84
|
+
notifyLayoutChanged(params: FcrUIToggleLayoutParams): void;
|
|
85
|
+
toggleLayoutSize(params: FcrUIToggleLayoutSizeParams): void;
|
|
86
|
+
notifyLayoutSizeChanged(params: FcrUILayoutSizeChangedParams): void;
|
|
87
|
+
setMainSpeaker(params: FcrUISetMainSpeakerParams): void;
|
|
88
|
+
setUserPinState(userId: string): void;
|
|
89
|
+
updateShareState(isOpen: boolean): void;
|
|
90
|
+
openDeviceSettingDialog(config?: Partial<DeviceSettingDialogConfig>): void;
|
|
91
|
+
closeDeviceSettingDialog(): void;
|
|
92
|
+
openLiveStreamingDialog(): void;
|
|
93
|
+
closeLiveStreamingDialog(): void;
|
|
94
|
+
stopLiveStreaming(): void;
|
|
95
|
+
openInviteDialog(): void;
|
|
96
|
+
closeInviteDialog(): void;
|
|
97
|
+
closeWaitingRoomDialog(): void;
|
|
98
|
+
closeRemoveAdmitWaitingRoomDialog(dialogKey: FcrUIDialogKey): void;
|
|
99
|
+
exitRoom(reason: FcrUIExitReason, roomType: number): void;
|
|
100
|
+
cloudRecording(action: FcrUICloudRecordingParams['action']): void;
|
|
101
|
+
notifySpotlightStreamChanged(params: FcrUISpotlightStreamChangedParams): void;
|
|
102
|
+
notifyCustomSettingsChanged(settings: CustomSetting): void;
|
|
103
|
+
addObserver(observer: FcrUIEventObserver): void;
|
|
104
|
+
removeObserver(observer: FcrUIEventObserver): void;
|
|
105
|
+
notifyChatUpdateTarget(user: FcrUserInfo, roomType: FcrRoomType): void;
|
|
106
|
+
notifyChatResetTarget(): void;
|
|
107
|
+
release(): void;
|
|
108
|
+
}
|