fcr-ui-scene 3.7.2 → 3.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/creator.js +23 -44
- package/lib/electron/app.js +7 -0
- package/lib/electron/injections.d.ts +1 -1
- package/lib/electron/injections.js +5 -3
- package/lib/electron/main.js +3 -1
- package/lib/fragments/annotation/index.d.ts +1 -0
- package/lib/fragments/annotation/index.js +13 -7
- package/lib/fragments/annotation/store.d.ts +8 -4
- package/lib/fragments/annotation/store.js +351 -267
- package/lib/fragments/annotation/toolbar/components/color-tool/index.js +4 -0
- package/lib/fragments/annotation/toolbar/components/graphic-tool/index.js +4 -0
- package/lib/fragments/annotation/toolbar/components/item/item.d.ts +2 -0
- package/lib/fragments/annotation/toolbar/components/item/item.js +2 -4
- package/lib/fragments/annotation/toolbar/components/item/style.css +4 -2
- package/lib/fragments/annotation/toolbar/components/pen-tool/index.js +4 -0
- package/lib/fragments/annotation/utils.d.ts +1 -0
- package/lib/fragments/annotation/utils.js +27 -0
- package/lib/fragments/annotation/view.js +1 -6
- package/lib/fragments/base.js +5 -3
- package/lib/fragments/whiteboard/cursor.css +77 -0
- package/lib/fragments/whiteboard/index.d.ts +11 -0
- package/lib/fragments/whiteboard/index.js +91 -0
- package/lib/fragments/whiteboard/store.d.ts +31 -0
- package/lib/fragments/whiteboard/store.js +475 -0
- package/lib/fragments/whiteboard/style.css +4 -0
- package/lib/fragments/whiteboard/view.d.ts +4 -0
- package/lib/fragments/whiteboard/view.js +31 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/modules/action-bar/components/apps/index.js +15 -5
- package/lib/modules/action-bar/components/leave/index.js +4 -11
- package/lib/modules/action-bar/view.d.ts +1 -0
- package/lib/modules/action-bar/view.js +3 -2
- package/lib/modules/annotation/annotation-toolbar-store.d.ts +4 -11
- package/lib/modules/annotation/annotation-toolbar-store.js +46 -88
- package/lib/modules/annotation/index.d.ts +2 -0
- package/lib/modules/annotation/index.js +2 -2
- package/lib/modules/annotation/store.d.ts +11 -49
- package/lib/modules/annotation/store.js +135 -418
- package/lib/modules/annotation/view.js +3 -6
- package/lib/modules/components/control-bar/components/loading/index.css +76 -0
- package/lib/modules/components/control-bar/components/loading/index.d.ts +8 -0
- package/lib/modules/components/control-bar/components/loading/index.js +64 -0
- package/lib/modules/components/control-bar/components/loading/loading.png +0 -0
- package/lib/modules/components/control-bar/components/progress/index.d.ts +5 -0
- package/lib/modules/components/control-bar/components/progress/index.js +43 -0
- package/lib/modules/components/control-bar/components/progress/style.css +51 -0
- package/lib/modules/components/control-bar/components/switch-theme/index.css +99 -0
- package/lib/modules/components/control-bar/components/switch-theme/index.d.ts +9 -0
- package/lib/modules/components/control-bar/components/switch-theme/index.js +94 -0
- package/lib/modules/components/control-bar/components/switch-theme/item.d.ts +9 -0
- package/lib/modules/components/control-bar/components/switch-theme/item.js +54 -0
- package/lib/modules/components/control-bar/components/switch-theme/libs.d.ts +4 -0
- package/lib/modules/components/control-bar/components/switch-theme/libs.js +31 -0
- package/lib/modules/components/control-bar/index.css +87 -0
- package/lib/modules/components/control-bar/index.d.ts +20 -0
- package/lib/modules/components/control-bar/index.js +276 -0
- package/lib/modules/components/leave-meeting/components/index.css +0 -9
- package/lib/modules/components/leave-meeting/index.d.ts +2 -1
- package/lib/modules/components/leave-meeting/index.js +15 -7
- package/lib/modules/components/leave-meeting/portal.d.ts +6 -0
- package/lib/modules/components/leave-meeting/portal.js +29 -0
- package/lib/modules/components/leave-meeting/style.css +9 -0
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +5 -2
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +19 -9
- package/lib/modules/components/member-window/components/member-actions/components/share-status.js +4 -4
- package/lib/modules/components/member-window/components/member-actions/index.js +13 -6
- package/lib/modules/components/member-window/components/member-actions/provider.d.ts +1 -0
- package/lib/modules/components/member-window/components/member-actions/provider.js +4 -3
- package/lib/modules/components/member-window/components/member-actions/store.d.ts +2 -1
- package/lib/modules/components/member-window/components/member-actions/store.js +5 -1
- package/lib/modules/components/member-window/index.css +4 -0
- package/lib/modules/components/member-window/types.d.ts +6 -2
- package/lib/modules/components/toolbar/components/capture-tool/index.d.ts +9 -0
- package/lib/modules/components/toolbar/components/capture-tool/index.js +68 -0
- package/lib/modules/components/toolbar/components/clean-tool/index.d.ts +11 -0
- package/lib/modules/components/toolbar/components/clean-tool/index.js +71 -0
- package/lib/modules/components/toolbar/components/color-tool/color-panel/index.d.ts +11 -0
- package/lib/modules/components/toolbar/components/color-tool/color-panel/index.js +77 -0
- package/lib/modules/components/toolbar/components/color-tool/index.d.ts +14 -0
- package/lib/modules/components/toolbar/components/color-tool/index.js +66 -0
- package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/index.d.ts +11 -0
- package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/index.js +64 -0
- package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +12 -0
- package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/libs.js +65 -0
- package/lib/modules/components/toolbar/components/graphic-tool/index.d.ts +15 -0
- package/lib/modules/components/toolbar/components/graphic-tool/index.js +82 -0
- package/lib/modules/components/toolbar/components/group-tool/index.d.ts +5 -0
- package/lib/modules/components/toolbar/components/group-tool/index.js +43 -0
- package/lib/modules/components/toolbar/components/icons/fold-icon.d.ts +2 -0
- package/lib/modules/components/toolbar/components/icons/fold-icon.js +41 -0
- package/lib/modules/components/toolbar/components/icons/move-icon.d.ts +1 -0
- package/lib/modules/components/toolbar/components/icons/move-icon.js +66 -0
- package/lib/modules/components/toolbar/components/item/index.d.ts +25 -0
- package/lib/modules/components/toolbar/components/item/index.js +165 -0
- package/lib/modules/components/toolbar/components/item/style.css +94 -0
- package/lib/modules/components/toolbar/components/multiple-color-tool/index.d.ts +12 -0
- package/lib/modules/components/toolbar/components/multiple-color-tool/index.js +75 -0
- package/lib/modules/components/toolbar/components/panel/index.d.ts +9 -0
- package/lib/modules/components/toolbar/components/panel/index.js +28 -0
- package/lib/modules/components/toolbar/components/panel/style.css +86 -0
- package/lib/modules/components/toolbar/components/pen-tool/index.d.ts +13 -0
- package/lib/modules/components/toolbar/components/pen-tool/index.js +62 -0
- package/lib/modules/components/toolbar/components/pen-tool/pen-panel/index.d.ts +8 -0
- package/lib/modules/components/toolbar/components/pen-tool/pen-panel/index.js +39 -0
- package/lib/modules/components/toolbar/components/save-draft/index.d.ts +7 -0
- package/lib/modules/components/toolbar/components/save-draft/index.js +59 -0
- package/lib/modules/components/toolbar/components/vertical-frame/index.d.ts +8 -0
- package/lib/modules/components/toolbar/components/vertical-frame/index.js +179 -0
- package/lib/modules/components/toolbar/hooks/use-resize-visible.d.ts +4 -0
- package/lib/modules/components/toolbar/hooks/use-resize-visible.js +59 -0
- package/lib/modules/components/toolbar/index.d.ts +29 -0
- package/lib/modules/components/toolbar/index.js +258 -0
- package/lib/modules/components/toolbar/style.css +85 -0
- package/lib/modules/components/toolbar/types.d.ts +13 -0
- package/lib/modules/components/toolbar/types.js +6 -0
- package/lib/modules/control-bar/components/more-actions/index.js +0 -6
- package/lib/modules/control-bar/components/share-state-nav/index.js +3 -2
- package/lib/modules/control-bar/index.js +2 -1
- package/lib/modules/control-bar/store.d.ts +7 -6
- package/lib/modules/control-bar/store.js +28 -21
- package/lib/modules/control-bar/view.js +7 -55
- package/lib/modules/dialog/dialogs/control-bar/index.d.ts +1 -0
- package/lib/modules/dialog/dialogs/control-bar/index.js +17 -3
- package/lib/modules/dialog/dialogs/participant/components/title.js +1 -1
- package/lib/modules/dialog/dialogs/sub-window/index.d.ts +2 -0
- package/lib/modules/dialog/dialogs/sub-window/index.js +98 -0
- package/lib/modules/dialog/dialogs/video-window/index.d.ts +1 -0
- package/lib/modules/dialog/dialogs/video-window/index.js +3 -2
- package/lib/modules/dialog/dialogs/whiteboard/index.js +0 -1
- package/lib/modules/dialog/hooks/use-popover-watcher.js +1 -2
- package/lib/modules/dialog/hooks/useElectron.d.ts +13 -0
- package/lib/modules/dialog/hooks/useElectron.js +62 -12
- package/lib/modules/dialog/index.d.ts +6 -3
- package/lib/modules/dialog/index.js +5 -3
- package/lib/modules/dialog/store.d.ts +21 -8
- package/lib/modules/dialog/store.js +79 -11
- package/lib/modules/dialog/type.d.ts +8 -0
- package/lib/modules/event-confirm/index.css +5 -2
- package/lib/modules/event-confirm/store.js +6 -7
- package/lib/modules/event-confirm/view.js +1 -1
- package/lib/modules/event-sound/index.d.ts +1 -0
- package/lib/modules/event-sound/index.js +11 -24
- package/lib/modules/invite/components/pstn-invite.js +0 -1
- package/lib/modules/layout/components/CommonVideoRenderer.js +21 -21
- package/lib/modules/layout/components/who-is-speaking.js +3 -6
- package/lib/modules/layout/index.d.ts +3 -1
- package/lib/modules/layout/index.js +2 -1
- package/lib/modules/layout/store.d.ts +7 -59
- package/lib/modules/layout/store.js +126 -24
- package/lib/modules/layout/type.d.ts +55 -0
- package/lib/modules/participant/components/can-moveable/index.js +0 -1
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.js +4 -2
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.js +14 -2
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.d.ts +1 -1
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.js +3 -2
- package/lib/modules/participant/components/participants/components/participants/index.js +3 -2
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.d.ts +1 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.js +3 -1
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/index.js +4 -2
- package/lib/modules/participant/components/participants/components/render-user/index.d.ts +4 -2
- package/lib/modules/participant/components/participants/components/render-user/index.js +5 -3
- package/lib/modules/participant/components/participants/index.js +5 -2
- package/lib/modules/participant/components/participants/types.d.ts +3 -0
- package/lib/modules/participant/index.d.ts +2 -0
- package/lib/modules/participant/index.js +2 -1
- package/lib/modules/participant/store.d.ts +5 -1
- package/lib/modules/participant/store.js +8 -1
- package/lib/modules/secondary-window/index.d.ts +49 -0
- package/lib/modules/secondary-window/index.js +108 -0
- package/lib/modules/secondary-window/store.d.ts +76 -0
- package/lib/modules/secondary-window/store.js +407 -0
- package/lib/modules/secondary-window/type.d.ts +106 -0
- package/lib/modules/secondary-window/type.js +35 -0
- package/lib/modules/secondary-window/view.d.ts +6 -0
- package/lib/modules/secondary-window/view.js +257 -0
- package/lib/modules/setting/general-settings/general-settings.js +9 -0
- package/lib/modules/setting/state/index.js +0 -10
- package/lib/modules/setting/store.d.ts +1 -0
- package/lib/modules/setting/store.js +6 -3
- package/lib/modules/share-screen/components/control-bar/index.d.ts +14 -1
- package/lib/modules/share-screen/components/control-bar/index.js +17 -12
- package/lib/modules/share-screen/components/selection/index.js +10 -15
- package/lib/modules/share-screen/index.d.ts +4 -1
- package/lib/modules/share-screen/index.js +6 -3
- package/lib/modules/share-screen/store.d.ts +9 -9
- package/lib/modules/share-screen/store.js +39 -64
- package/lib/modules/state-bar/index.d.ts +2 -0
- package/lib/modules/state-bar/index.js +2 -1
- package/lib/modules/state-bar/live-streaming-state.js +0 -1
- package/lib/modules/state-bar/store.d.ts +5 -2
- package/lib/modules/state-bar/store.js +14 -7
- package/lib/modules/state-bar/view.js +3 -3
- package/lib/modules/video-window/components/members/index.js +7 -12
- package/lib/modules/video-window/store.d.ts +1 -0
- package/lib/modules/video-window/store.js +5 -0
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +2 -2
- package/lib/modules/whiteboard/index.d.ts +10 -13
- package/lib/modules/whiteboard/index.js +12 -11
- package/lib/providers/ability-provider.js +2 -0
- package/lib/providers/device-provider.d.ts +6 -3
- package/lib/providers/device-provider.js +331 -333
- package/lib/providers/multi-display-provider.d.ts +85 -0
- package/lib/providers/multi-display-provider.js +581 -0
- package/lib/providers/privilege-provider.js +1 -7
- package/lib/providers/room-provider.js +7 -1
- package/lib/providers/screen-share-provider.d.ts +3 -1
- package/lib/providers/screen-share-provider.js +39 -40
- package/lib/providers/sharing-provider.d.ts +7 -1
- package/lib/providers/sharing-provider.js +32 -3
- package/lib/providers/whiteboard-provider.d.ts +24 -0
- package/lib/providers/whiteboard-provider.js +127 -0
- package/lib/runtime.d.ts +1 -0
- package/lib/scenes/main-scene.d.ts +6 -0
- package/lib/scenes/main-scene.js +38 -2
- package/lib/scenes/waiting-scene.d.ts +0 -2
- package/lib/scenes/waiting-scene.js +0 -6
- package/lib/shared-data-source/member-data.d.ts +2 -2
- package/lib/shared-data-source/screen-share-data.d.ts +6 -0
- package/lib/shared-data-source/screen-share-data.js +5 -0
- package/lib/shared-data-source/setting.js +2 -1
- package/lib/shared-data-source/video-window.js +1 -2
- package/lib/shared-data-source/whiteboard-data.d.ts +68 -0
- package/lib/shared-data-source/whiteboard-data.js +347 -0
- package/lib/translations/enUS.d.ts +1 -0
- package/lib/translations/enUS.js +2 -1
- package/lib/translations/zhCN.d.ts +1 -0
- package/lib/translations/zhCN.js +2 -1
- package/lib/ui-scene.d.ts +0 -1
- package/lib/ui-scene.js +0 -3
- package/lib/utilities/constant.d.ts +4 -2
- package/lib/utilities/constant.js +3 -1
- package/lib/utilities/debug.d.ts +4 -0
- package/lib/utilities/debug.js +40 -0
- package/lib/utilities/dialog-utils.js +26 -4
- package/lib/utilities/meeting-detail.js +4 -1
- package/lib/utilities/renderer-event.d.ts +4 -6
- package/lib/utilities/renderer-event.js +23 -43
- package/lib/utilities/renderer.d.ts +1 -1
- package/lib/utilities/renderer.js +44 -10
- package/lib/utilities/shared-storage.d.ts +18 -0
- package/lib/utilities/shared-storage.js +63 -0
- package/lib/utilities/tools.js +2 -1
- package/package.json +5 -6
- package/lib/electron/tools.d.ts +0 -5
- package/lib/electron/tools.js +0 -62
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { FcrUIDisplayContentDistribution, FcrUIDisplayDistributionContentType, FcrUIDisplayState, FcrUIMultiDisplayObserver } from '../modules/secondary-window/type';
|
|
2
|
+
import { FcrUIMemberSharedDataSource } from '../shared-data-source/member-data';
|
|
3
|
+
import { FcrUIScreenShareSharedDataSource } from '../shared-data-source/screen-share-data';
|
|
4
|
+
import { FcrUISharedSettingDataSource } from '../shared-data-source/setting';
|
|
5
|
+
import { FcrUIVideoWindowDataSource } from '../shared-data-source/video-window';
|
|
6
|
+
import { FcrUIEventProvider } from './event-provider';
|
|
7
|
+
import { FcrUISharingProvider } from './sharing-provider';
|
|
8
|
+
export interface FcrUIMultiDisplayProvider {
|
|
9
|
+
get mianWindowContentType(): `${FcrUIDisplayDistributionContentType}`;
|
|
10
|
+
get secondaryWindowContentType(): `${FcrUIDisplayDistributionContentType}`;
|
|
11
|
+
get contentDistribution(): FcrUIDisplayContentDistribution;
|
|
12
|
+
get displayState(): FcrUIDisplayState;
|
|
13
|
+
get displayCount(): number;
|
|
14
|
+
/** 是否激活多屏显示模式
|
|
15
|
+
* 如果是 Electron 环境,显示器数量大于 1 且开启了双屏模式,则返回 true
|
|
16
|
+
* 如果是 Web 环境,返回 false
|
|
17
|
+
*/
|
|
18
|
+
get isActive(): boolean;
|
|
19
|
+
/** 判断本地用户的视频流是否在副窗口 */
|
|
20
|
+
get isLocalCameraInSecondaryWindow(): boolean;
|
|
21
|
+
addObserver(observer: FcrUIMultiDisplayObserver): void;
|
|
22
|
+
removeObserver(observer: FcrUIMultiDisplayObserver): void;
|
|
23
|
+
release(): void;
|
|
24
|
+
/** 显示主窗口在排序最小的显示器中,当前正在共享屏幕(窗口)所在的显示器除外 */
|
|
25
|
+
showMainWindowInIndexLeastDisplay(options?: {
|
|
26
|
+
displayOfCurrentSharingBounds?: Electron.Display;
|
|
27
|
+
/** 是否最大化应用窗口,不是 mac 下的应用全屏 */
|
|
28
|
+
maximize?: boolean;
|
|
29
|
+
}): void;
|
|
30
|
+
/** 如果屏幕共享和主窗口在同一个显示器,则将主窗口移动到排序最小的显示器中,共享屏幕(窗口)所在的显示器除外 */
|
|
31
|
+
moveMainWindowToIndexLeastDisplay(): void;
|
|
32
|
+
/** 设置主窗口为窗口最大化 */
|
|
33
|
+
setMainWindowMaximize(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare class FcrUIMultiDisplayProviderImpl implements FcrUIMultiDisplayProvider {
|
|
36
|
+
protected _logger: import("agora-foundation/lib/logger").Logger;
|
|
37
|
+
private _observers;
|
|
38
|
+
private _disposers;
|
|
39
|
+
private _isElectron;
|
|
40
|
+
private _eventProvider;
|
|
41
|
+
private _sharedSettingDataSource;
|
|
42
|
+
private _sharedMemberDataSource;
|
|
43
|
+
private _sharedVideoWindowDataSource;
|
|
44
|
+
private _sharingProvider;
|
|
45
|
+
private _sharedScreenShareDataSource;
|
|
46
|
+
private _contentDistribution;
|
|
47
|
+
private get _userId();
|
|
48
|
+
private accessor _displayCount;
|
|
49
|
+
private accessor _displayState;
|
|
50
|
+
private accessor _secondaryWindowContentType;
|
|
51
|
+
private accessor _mainWindowContentType;
|
|
52
|
+
get contentDistribution(): FcrUIDisplayContentDistribution;
|
|
53
|
+
get displayState(): FcrUIDisplayState;
|
|
54
|
+
get displayCount(): number;
|
|
55
|
+
get isActive(): boolean;
|
|
56
|
+
get mianWindowContentType(): `${FcrUIDisplayDistributionContentType}`;
|
|
57
|
+
get secondaryWindowContentType(): `${FcrUIDisplayDistributionContentType}`;
|
|
58
|
+
get isLocalCameraInSecondaryWindow(): boolean;
|
|
59
|
+
constructor({ eventProvider, sharedSettingDataSource, sharedMemberDataSource, sharedVideoWindowDataSource, sharingProvider, sharedScreenShareSharedDataSource, }: {
|
|
60
|
+
eventProvider: FcrUIEventProvider;
|
|
61
|
+
sharedSettingDataSource: FcrUISharedSettingDataSource;
|
|
62
|
+
sharedMemberDataSource: FcrUIMemberSharedDataSource;
|
|
63
|
+
sharedVideoWindowDataSource: FcrUIVideoWindowDataSource;
|
|
64
|
+
sharingProvider: FcrUISharingProvider;
|
|
65
|
+
sharedScreenShareSharedDataSource: FcrUIScreenShareSharedDataSource;
|
|
66
|
+
});
|
|
67
|
+
addObserver(observer: FcrUIMultiDisplayObserver): void;
|
|
68
|
+
removeObserver(observer: FcrUIMultiDisplayObserver): void;
|
|
69
|
+
release(): void;
|
|
70
|
+
moveMainWindowToIndexLeastDisplay(): void;
|
|
71
|
+
showMainWindowInIndexLeastDisplay(options?: {
|
|
72
|
+
displayOfCurrentSharingBounds?: Electron.Display;
|
|
73
|
+
maximize?: boolean;
|
|
74
|
+
}): void;
|
|
75
|
+
setMainWindowMaximize(): void;
|
|
76
|
+
private _getContentDistribution;
|
|
77
|
+
private _setDisplayState;
|
|
78
|
+
private _addReaction;
|
|
79
|
+
private _getSharingStream;
|
|
80
|
+
private _handleDisplayCountUpdated;
|
|
81
|
+
private _handleContentDistributionUpdated;
|
|
82
|
+
private _initDisplayState;
|
|
83
|
+
private _handleScreenSharingState;
|
|
84
|
+
private _handleWhiteboardState;
|
|
85
|
+
}
|
|
@@ -0,0 +1,581 @@
|
|
|
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.filter.js");
|
|
9
|
+
require("core-js/modules/es.array.is-array.js");
|
|
10
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
11
|
+
require("core-js/modules/es.function.bind.js");
|
|
12
|
+
require("core-js/modules/es.function.name.js");
|
|
13
|
+
require("core-js/modules/es.map.js");
|
|
14
|
+
require("core-js/modules/es.number.constructor.js");
|
|
15
|
+
require("core-js/modules/es.object.create.js");
|
|
16
|
+
require("core-js/modules/es.object.define-properties.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.object.get-own-property-descriptors.js");
|
|
20
|
+
require("core-js/modules/es.object.keys.js");
|
|
21
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
22
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
23
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
24
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
25
|
+
require("core-js/modules/esnext.map.every.js");
|
|
26
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
27
|
+
require("core-js/modules/esnext.map.find.js");
|
|
28
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
29
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
30
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
31
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
32
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
33
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
34
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
35
|
+
require("core-js/modules/esnext.map.some.js");
|
|
36
|
+
require("core-js/modules/esnext.map.update.js");
|
|
37
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
38
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
39
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
40
|
+
Object.defineProperty(exports, "__esModule", {
|
|
41
|
+
value: true
|
|
42
|
+
});
|
|
43
|
+
exports.FcrUIMultiDisplayProviderImpl = void 0;
|
|
44
|
+
require("core-js/modules/es.array.concat.js");
|
|
45
|
+
require("core-js/modules/es.array.find.js");
|
|
46
|
+
require("core-js/modules/es.array.for-each.js");
|
|
47
|
+
require("core-js/modules/es.array.iterator.js");
|
|
48
|
+
require("core-js/modules/es.array.push.js");
|
|
49
|
+
require("core-js/modules/es.date.to-json.js");
|
|
50
|
+
require("core-js/modules/es.json.stringify.js");
|
|
51
|
+
require("core-js/modules/es.object.to-string.js");
|
|
52
|
+
require("core-js/modules/es.string.iterator.js");
|
|
53
|
+
require("core-js/modules/es.weak-map.js");
|
|
54
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
55
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
56
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
57
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
58
|
+
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
59
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
60
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
61
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
62
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
63
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
64
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
65
|
+
var _env = require("agora-foundation/lib/utilities/env");
|
|
66
|
+
var _imports = require("fcr-core/lib/imports");
|
|
67
|
+
var _type = require("fcr-core/lib/type");
|
|
68
|
+
var _logger = require("../utilities/logger");
|
|
69
|
+
var _mobx = require("mobx");
|
|
70
|
+
var _base = require("../base");
|
|
71
|
+
var _type2 = require("../modules/secondary-window/type");
|
|
72
|
+
var _type3 = require("../type");
|
|
73
|
+
var _FcrUIMultiDisplayProviderImpl;
|
|
74
|
+
var _initProto, _init__displayCount, _init__displayState, _init__secondaryWindowContentType, _init__mainWindowContentType;
|
|
75
|
+
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; }
|
|
76
|
+
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; }
|
|
77
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
78
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
79
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
80
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
81
|
+
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"); }
|
|
82
|
+
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
83
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
84
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
85
|
+
function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
86
|
+
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
|
|
87
|
+
function getIsSecondaryWindowModeEnabled(displayCount, isDualDisplayMode) {
|
|
88
|
+
return displayCount > 1 && isDualDisplayMode;
|
|
89
|
+
}
|
|
90
|
+
var _A = /*#__PURE__*/new WeakMap();
|
|
91
|
+
var _B = /*#__PURE__*/new WeakMap();
|
|
92
|
+
var _C = /*#__PURE__*/new WeakMap();
|
|
93
|
+
var _D = /*#__PURE__*/new WeakMap();
|
|
94
|
+
var FcrUIMultiDisplayProviderImpl = exports.FcrUIMultiDisplayProviderImpl = /*#__PURE__*/function () {
|
|
95
|
+
function FcrUIMultiDisplayProviderImpl(_ref) {
|
|
96
|
+
var eventProvider = _ref.eventProvider,
|
|
97
|
+
sharedSettingDataSource = _ref.sharedSettingDataSource,
|
|
98
|
+
sharedMemberDataSource = _ref.sharedMemberDataSource,
|
|
99
|
+
sharedVideoWindowDataSource = _ref.sharedVideoWindowDataSource,
|
|
100
|
+
sharingProvider = _ref.sharingProvider,
|
|
101
|
+
sharedScreenShareSharedDataSource = _ref.sharedScreenShareSharedDataSource;
|
|
102
|
+
(0, _classCallCheck2["default"])(this, FcrUIMultiDisplayProviderImpl);
|
|
103
|
+
(0, _defineProperty2["default"])(this, "_logger", (_initProto(this), (0, _logger.createLogger)({
|
|
104
|
+
prefix: 'FcrUIMultiDisplayProvider'
|
|
105
|
+
})));
|
|
106
|
+
(0, _defineProperty2["default"])(this, "_observers", new _imports.AgoraObservable());
|
|
107
|
+
(0, _defineProperty2["default"])(this, "_disposers", []);
|
|
108
|
+
(0, _defineProperty2["default"])(this, "_isElectron", (0, _env.isElectron)());
|
|
109
|
+
(0, _defineProperty2["default"])(this, "_contentDistribution", {
|
|
110
|
+
mainWindow: {
|
|
111
|
+
type: _type2.FcrUIDisplayDistributionContentType.LOCAL_CAMERA
|
|
112
|
+
},
|
|
113
|
+
secondaryWindow: {
|
|
114
|
+
type: _type2.FcrUIDisplayDistributionContentType.HIDDEN
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
_classPrivateFieldInitSpec(this, _A, _init__displayCount(this, 1));
|
|
118
|
+
_classPrivateFieldInitSpec(this, _B, _init__displayState(this, {
|
|
119
|
+
participantCount: 1,
|
|
120
|
+
layoutMode: _type3.FcrUIVideoWindowLayoutType.Gallery,
|
|
121
|
+
isSharing: false,
|
|
122
|
+
sharingBySelf: false,
|
|
123
|
+
sharingStreamId: '',
|
|
124
|
+
sharingType: undefined,
|
|
125
|
+
otherStreamId: '',
|
|
126
|
+
isSharingBoard: false,
|
|
127
|
+
isSharingScreen: false,
|
|
128
|
+
isSecondaryWindowModeEnabled: false
|
|
129
|
+
}));
|
|
130
|
+
_classPrivateFieldInitSpec(this, _C, _init__secondaryWindowContentType(this));
|
|
131
|
+
_classPrivateFieldInitSpec(this, _D, _init__mainWindowContentType(this));
|
|
132
|
+
this._eventProvider = eventProvider;
|
|
133
|
+
this._sharedSettingDataSource = sharedSettingDataSource;
|
|
134
|
+
this._sharedMemberDataSource = sharedMemberDataSource;
|
|
135
|
+
this._sharedVideoWindowDataSource = sharedVideoWindowDataSource;
|
|
136
|
+
this._sharingProvider = sharingProvider;
|
|
137
|
+
this._sharedScreenShareDataSource = sharedScreenShareSharedDataSource;
|
|
138
|
+
if (this._isElectron) {
|
|
139
|
+
window.runtime.screen.addListener('display-added', this._handleDisplayCountUpdated);
|
|
140
|
+
window.runtime.screen.addListener('display-removed', this._handleDisplayCountUpdated);
|
|
141
|
+
this._displayCount = window.runtime.screen.getAllDisplays().length;
|
|
142
|
+
this._initDisplayState();
|
|
143
|
+
this._addReaction();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return (0, _createClass2["default"])(FcrUIMultiDisplayProviderImpl, [{
|
|
147
|
+
key: "_userId",
|
|
148
|
+
get: function get() {
|
|
149
|
+
return this._sharedMemberDataSource.localUser.userId;
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "_displayCount",
|
|
153
|
+
get: function get() {
|
|
154
|
+
return _classPrivateFieldGet(_A, this);
|
|
155
|
+
},
|
|
156
|
+
set: function set(v) {
|
|
157
|
+
_classPrivateFieldSet(_A, this, v);
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "_displayState",
|
|
161
|
+
get: function get() {
|
|
162
|
+
return _classPrivateFieldGet(_B, this);
|
|
163
|
+
},
|
|
164
|
+
set: function set(v) {
|
|
165
|
+
_classPrivateFieldSet(_B, this, v);
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "_secondaryWindowContentType",
|
|
169
|
+
get: function get() {
|
|
170
|
+
return _classPrivateFieldGet(_C, this);
|
|
171
|
+
},
|
|
172
|
+
set: function set(v) {
|
|
173
|
+
_classPrivateFieldSet(_C, this, v);
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "_mainWindowContentType",
|
|
177
|
+
get: function get() {
|
|
178
|
+
return _classPrivateFieldGet(_D, this);
|
|
179
|
+
},
|
|
180
|
+
set: function set(v) {
|
|
181
|
+
_classPrivateFieldSet(_D, this, v);
|
|
182
|
+
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "contentDistribution",
|
|
185
|
+
get: function get() {
|
|
186
|
+
return this._contentDistribution;
|
|
187
|
+
}
|
|
188
|
+
}, {
|
|
189
|
+
key: "displayState",
|
|
190
|
+
get: function get() {
|
|
191
|
+
return this._displayState;
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "displayCount",
|
|
195
|
+
get: function get() {
|
|
196
|
+
return this._displayCount;
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
key: "isActive",
|
|
200
|
+
get: function get() {
|
|
201
|
+
return this._displayState.isSecondaryWindowModeEnabled;
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
key: "mianWindowContentType",
|
|
205
|
+
get: function get() {
|
|
206
|
+
return this._mainWindowContentType;
|
|
207
|
+
}
|
|
208
|
+
}, {
|
|
209
|
+
key: "secondaryWindowContentType",
|
|
210
|
+
get: function get() {
|
|
211
|
+
return this._secondaryWindowContentType;
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
key: "isLocalCameraInSecondaryWindow",
|
|
215
|
+
get: function get() {
|
|
216
|
+
return this._secondaryWindowContentType === _type2.FcrUIDisplayDistributionContentType.LOCAL_CAMERA;
|
|
217
|
+
}
|
|
218
|
+
}, {
|
|
219
|
+
key: "addObserver",
|
|
220
|
+
value: function addObserver(observer) {
|
|
221
|
+
this._observers.addObserver(observer);
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
key: "removeObserver",
|
|
225
|
+
value: function removeObserver(observer) {
|
|
226
|
+
this._observers.removeObserver(observer);
|
|
227
|
+
}
|
|
228
|
+
}, {
|
|
229
|
+
key: "release",
|
|
230
|
+
value: function release() {
|
|
231
|
+
if (this._isElectron) {
|
|
232
|
+
window.runtime.screen.removeListener('display-added', this._handleDisplayCountUpdated);
|
|
233
|
+
window.runtime.screen.removeListener('display-removed', this._handleDisplayCountUpdated);
|
|
234
|
+
}
|
|
235
|
+
this._observers.removeAllObservers();
|
|
236
|
+
this._disposers.forEach(function (disposer) {
|
|
237
|
+
return disposer();
|
|
238
|
+
});
|
|
239
|
+
this._disposers = [];
|
|
240
|
+
this._logger.info('FcrUIMultiDisplayProvider released');
|
|
241
|
+
}
|
|
242
|
+
}, {
|
|
243
|
+
key: "moveMainWindowToIndexLeastDisplay",
|
|
244
|
+
value: function moveMainWindowToIndexLeastDisplay() {
|
|
245
|
+
if (!this.isActive) {
|
|
246
|
+
this._logger.warn('move: Secondary window mode is not enabled, cannot move main window to least display.');
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
var browserWindow = window.runtime.browserWindow;
|
|
250
|
+
var currentSharingBounds = this._sharedScreenShareDataSource.currentSelectionBounds;
|
|
251
|
+
var mainWindowBounds = browserWindow.getBounds();
|
|
252
|
+
var displayOfCurrentSharingBounds = window.runtime.screen.getDisplayMatching(currentSharingBounds);
|
|
253
|
+
var displaysOfCurrentMainWindow = window.runtime.screen.getDisplayMatching(mainWindowBounds);
|
|
254
|
+
if (displayOfCurrentSharingBounds.id !== displaysOfCurrentMainWindow.id) {
|
|
255
|
+
this._logger.info('Main window is not in the sharing display, no need to move.');
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
var isMaximized = browserWindow.isMaximized();
|
|
259
|
+
this.showMainWindowInIndexLeastDisplay({
|
|
260
|
+
displayOfCurrentSharingBounds: displayOfCurrentSharingBounds,
|
|
261
|
+
maximize: isMaximized
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}, {
|
|
265
|
+
key: "showMainWindowInIndexLeastDisplay",
|
|
266
|
+
value: function showMainWindowInIndexLeastDisplay() {
|
|
267
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
268
|
+
var displayOfCurrentSharingBounds = options.displayOfCurrentSharingBounds;
|
|
269
|
+
var _options$maximize = options.maximize,
|
|
270
|
+
maximize = _options$maximize === void 0 ? false : _options$maximize;
|
|
271
|
+
if (!this.isActive) {
|
|
272
|
+
this._logger.warn('show: Secondary window mode is not enabled, cannot show main window in least display.');
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
var currentSharingBounds = this._sharedScreenShareDataSource.currentSelectionBounds;
|
|
276
|
+
displayOfCurrentSharingBounds = displayOfCurrentSharingBounds || window.runtime.screen.getDisplayMatching(currentSharingBounds);
|
|
277
|
+
var browserWindow = window.runtime.browserWindow;
|
|
278
|
+
var displayOfMainWindow = window.runtime.screen.getAllDisplays().find(function (_ref2) {
|
|
279
|
+
var id = _ref2.id;
|
|
280
|
+
return id !== displayOfCurrentSharingBounds.id;
|
|
281
|
+
});
|
|
282
|
+
if (!displayOfMainWindow) {
|
|
283
|
+
this._logger.error('No available display found to show main window.');
|
|
284
|
+
browserWindow.show();
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
this._logger.info("Showing main window in display: ".concat(displayOfMainWindow.id, " - ").concat(displayOfMainWindow.label));
|
|
288
|
+
var _displayOfMainWindow$ = displayOfMainWindow.bounds,
|
|
289
|
+
x = _displayOfMainWindow$.x,
|
|
290
|
+
y = _displayOfMainWindow$.y,
|
|
291
|
+
width = _displayOfMainWindow$.width,
|
|
292
|
+
height = _displayOfMainWindow$.height;
|
|
293
|
+
var _browserWindow$getBou = browserWindow.getBounds(),
|
|
294
|
+
mainWindowWidth = _browserWindow$getBou.width,
|
|
295
|
+
mainWindowHeight = _browserWindow$getBou.height;
|
|
296
|
+
var bounds = {
|
|
297
|
+
x: x + Math.floor(width / 2 - mainWindowWidth / 2),
|
|
298
|
+
y: y + Math.floor(height / 2 - mainWindowHeight / 2)
|
|
299
|
+
};
|
|
300
|
+
browserWindow.setBounds(bounds);
|
|
301
|
+
if (maximize) {
|
|
302
|
+
browserWindow.maximize();
|
|
303
|
+
browserWindow.focus();
|
|
304
|
+
} else {
|
|
305
|
+
browserWindow.show();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}, {
|
|
309
|
+
key: "setMainWindowMaximize",
|
|
310
|
+
value: function setMainWindowMaximize() {
|
|
311
|
+
if (!this.isActive) {
|
|
312
|
+
this._logger.warn('makeFullScreen: Secondary window mode is not enabled, cannot make main window full screen.');
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
var browserWindow = window.runtime.browserWindow;
|
|
316
|
+
browserWindow.maximize();
|
|
317
|
+
this._logger.info("Main window set to maximize state.");
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
key: "_getContentDistribution",
|
|
321
|
+
value: function _getContentDistribution() {
|
|
322
|
+
var state = this.displayState;
|
|
323
|
+
function calculateContentDistribution(state) {
|
|
324
|
+
// 没有开启副屏模式时,隐藏副屏窗口
|
|
325
|
+
if (!state.isSecondaryWindowModeEnabled) {
|
|
326
|
+
return {
|
|
327
|
+
mainWindow: {
|
|
328
|
+
type: state.layoutMode,
|
|
329
|
+
participants: _type2.FcrUIDisplayDistributionParticipants.ALL
|
|
330
|
+
},
|
|
331
|
+
secondaryWindow: {
|
|
332
|
+
type: _type2.FcrUIDisplayDistributionContentType.HIDDEN
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* 正在共享屏幕
|
|
339
|
+
*/
|
|
340
|
+
if (state.isSharing) {
|
|
341
|
+
var mainWindow = {
|
|
342
|
+
type: state.layoutMode,
|
|
343
|
+
participants: _type2.FcrUIDisplayDistributionParticipants.ALL
|
|
344
|
+
};
|
|
345
|
+
var secondaryWindow;
|
|
346
|
+
|
|
347
|
+
// 如果自己在共享,则副屏隐藏
|
|
348
|
+
if (state.sharingBySelf) {
|
|
349
|
+
secondaryWindow = {
|
|
350
|
+
type: _type2.FcrUIDisplayDistributionContentType.HIDDEN
|
|
351
|
+
};
|
|
352
|
+
} else {
|
|
353
|
+
// 如果不是自己在共享,则副屏显示共享内容
|
|
354
|
+
secondaryWindow = {
|
|
355
|
+
type: state.sharingType,
|
|
356
|
+
content: state.sharingStreamId
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
mainWindow: mainWindow,
|
|
361
|
+
secondaryWindow: secondaryWindow
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* 没有屏幕共享时
|
|
367
|
+
*/
|
|
368
|
+
// 参会人数少于2人时,主副屏都显示自己
|
|
369
|
+
if (state.participantCount < 2) {
|
|
370
|
+
return {
|
|
371
|
+
mainWindow: {
|
|
372
|
+
type: _type2.FcrUIDisplayDistributionContentType.LOCAL_CAMERA
|
|
373
|
+
},
|
|
374
|
+
secondaryWindow: {
|
|
375
|
+
type: _type2.FcrUIDisplayDistributionContentType.LOCAL_CAMERA
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// 参会人数为2人时,主屏显示对方,副屏显示自己
|
|
381
|
+
if (state.participantCount === 2) {
|
|
382
|
+
return {
|
|
383
|
+
mainWindow: {
|
|
384
|
+
type: _type2.FcrUIDisplayDistributionContentType.REMOTE_CAMERA
|
|
385
|
+
},
|
|
386
|
+
secondaryWindow: {
|
|
387
|
+
type: _type2.FcrUIDisplayDistributionContentType.LOCAL_CAMERA
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// 多人,主屏显示所有人,副屏显示我自己
|
|
393
|
+
return {
|
|
394
|
+
mainWindow: {
|
|
395
|
+
type: state.layoutMode,
|
|
396
|
+
participants: _type2.FcrUIDisplayDistributionParticipants.ALL
|
|
397
|
+
},
|
|
398
|
+
secondaryWindow: {
|
|
399
|
+
type: _type2.FcrUIDisplayDistributionContentType.LOCAL_CAMERA
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
var distribution = calculateContentDistribution(state);
|
|
404
|
+
this._mainWindowContentType = distribution.mainWindow.type;
|
|
405
|
+
this._secondaryWindowContentType = distribution.secondaryWindow.type;
|
|
406
|
+
this._contentDistribution = distribution;
|
|
407
|
+
this._logger.info("getContentDistribution: ".concat(JSON.stringify(distribution)));
|
|
408
|
+
return distribution;
|
|
409
|
+
}
|
|
410
|
+
}, {
|
|
411
|
+
key: "_setDisplayState",
|
|
412
|
+
value: function _setDisplayState(state) {
|
|
413
|
+
this._logger.info("setDisplayState: ".concat(JSON.stringify(state)));
|
|
414
|
+
this._displayState = _objectSpread(_objectSpread({}, this._displayState), state);
|
|
415
|
+
this._handleContentDistributionUpdated();
|
|
416
|
+
}
|
|
417
|
+
}, {
|
|
418
|
+
key: "_addReaction",
|
|
419
|
+
value: function _addReaction() {
|
|
420
|
+
var _this = this;
|
|
421
|
+
this._disposers.push((0, _mobx.reaction)(function () {
|
|
422
|
+
return _this._sharedSettingDataSource.setting.isDualDisplayMode;
|
|
423
|
+
}, function (isDualDisplayMode) {
|
|
424
|
+
_this._setDisplayState({
|
|
425
|
+
isSecondaryWindowModeEnabled: getIsSecondaryWindowModeEnabled(_this._displayCount, isDualDisplayMode)
|
|
426
|
+
});
|
|
427
|
+
}), (0, _mobx.reaction)(function () {
|
|
428
|
+
return _this._sharedMemberDataSource.totalUserCount;
|
|
429
|
+
}, function (participantCount) {
|
|
430
|
+
_this._setDisplayState({
|
|
431
|
+
participantCount: participantCount
|
|
432
|
+
});
|
|
433
|
+
}), (0, _mobx.reaction)(function () {
|
|
434
|
+
return _this._sharedVideoWindowDataSource.layoutType;
|
|
435
|
+
}, function (layoutMode) {
|
|
436
|
+
_this._setDisplayState({
|
|
437
|
+
layoutMode: layoutMode
|
|
438
|
+
});
|
|
439
|
+
}), (0, _mobx.reaction)(function () {
|
|
440
|
+
return _this._sharingProvider.screenSharingState;
|
|
441
|
+
}, function () {
|
|
442
|
+
var state = _objectSpread({}, _this._displayState);
|
|
443
|
+
_this._handleScreenSharingState(state);
|
|
444
|
+
_this._setDisplayState(state);
|
|
445
|
+
}), (0, _mobx.reaction)(function () {
|
|
446
|
+
return _this._sharingProvider.whiteboardState;
|
|
447
|
+
}, function () {
|
|
448
|
+
var state = _objectSpread({}, _this._displayState);
|
|
449
|
+
_this._handleWhiteboardState(state);
|
|
450
|
+
_this._setDisplayState(state);
|
|
451
|
+
}));
|
|
452
|
+
}
|
|
453
|
+
}, {
|
|
454
|
+
key: "_getSharingStream",
|
|
455
|
+
value: function _getSharingStream(ownerId) {
|
|
456
|
+
var stream = this._sharedVideoWindowDataSource.mainList.find(function (item) {
|
|
457
|
+
return item.userId === ownerId;
|
|
458
|
+
});
|
|
459
|
+
if (!stream) {
|
|
460
|
+
this._logger.warn("No sharing stream found for ownerId: ".concat(ownerId));
|
|
461
|
+
}
|
|
462
|
+
return stream;
|
|
463
|
+
}
|
|
464
|
+
}, {
|
|
465
|
+
key: "_handleDisplayCountUpdated",
|
|
466
|
+
value: function _handleDisplayCountUpdated() {
|
|
467
|
+
var count = window.runtime.screen.getAllDisplays().length;
|
|
468
|
+
this._logger.info("notify observers of display count update, prevCont: ".concat(this._displayCount, ", count: ").concat(count));
|
|
469
|
+
this._displayCount = count;
|
|
470
|
+
this._observers.notifyObservers('onDisplayCountUpdated', count);
|
|
471
|
+
var isSecondaryWindowModeEnabled = getIsSecondaryWindowModeEnabled(count, this._sharedSettingDataSource.setting.isDualDisplayMode);
|
|
472
|
+
if (this._displayState.isSecondaryWindowModeEnabled !== isSecondaryWindowModeEnabled) {
|
|
473
|
+
var state = {
|
|
474
|
+
isSecondaryWindowModeEnabled: isSecondaryWindowModeEnabled
|
|
475
|
+
};
|
|
476
|
+
var _this$_displayState = this._displayState,
|
|
477
|
+
sharingBySelf = _this$_displayState.sharingBySelf,
|
|
478
|
+
isSharingScreen = _this$_displayState.isSharingScreen;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* 正在共享的显示器被拔出时,会先触发 FcrUIScreenShareProvider 的 _handleScreenCaptureStateUpdated,然后才触发显示器的移除事件。
|
|
482
|
+
* _handleScreenCaptureStateUpdated 内会设置 localUserScreenSharingState。
|
|
483
|
+
* _sharingProvider.screenSharingState 是通过 fcr core 内的事件设置的,存在延迟的情况。
|
|
484
|
+
*
|
|
485
|
+
* 有一种异常情况:当正在共享的显示器被移除时,本地先关闭屏幕共享,然后才触发显示器移除事件,此时双屏显示处于禁用状态。
|
|
486
|
+
* 这时应该根据屏幕共享的状态来决定是否更新主窗口、悬浮视频窗的显示状态。
|
|
487
|
+
* 但是因为 _sharingProvider.screenSharingState 存在延迟,会导窗口显示异常。
|
|
488
|
+
* 所以这里需要判断 localUserScreenSharingState 和 screenSharingState 是否一致
|
|
489
|
+
* 如果不一致,则重置 displayState 内与屏幕共享相关的状态。
|
|
490
|
+
*/
|
|
491
|
+
var isLocalUserNotScreenSharing = this._sharedScreenShareDataSource.localUserScreenSharingState !== _type.FcrMediaSourceState.OPEN;
|
|
492
|
+
var isSharingScreenBySelf = sharingBySelf && isSharingScreen;
|
|
493
|
+
if (!isSecondaryWindowModeEnabled && isSharingScreenBySelf && isLocalUserNotScreenSharing) {
|
|
494
|
+
state.isSharing = false;
|
|
495
|
+
state.sharingBySelf = false;
|
|
496
|
+
state.sharingType = undefined;
|
|
497
|
+
state.sharingStreamId = '';
|
|
498
|
+
state.isSharingScreen = false;
|
|
499
|
+
}
|
|
500
|
+
this._setDisplayState(state);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}, {
|
|
504
|
+
key: "_handleContentDistributionUpdated",
|
|
505
|
+
value: function _handleContentDistributionUpdated() {
|
|
506
|
+
var distribution = this._getContentDistribution();
|
|
507
|
+
this._logger.info('notify observers of content distribution update');
|
|
508
|
+
this._observers.notifyObservers('onContentDistributionUpdated', distribution);
|
|
509
|
+
}
|
|
510
|
+
}, {
|
|
511
|
+
key: "_initDisplayState",
|
|
512
|
+
value: function _initDisplayState() {
|
|
513
|
+
var state = _objectSpread({}, this._displayState);
|
|
514
|
+
var _this$_sharingProvide = this._sharingProvider,
|
|
515
|
+
screenSharingState = _this$_sharingProvide.screenSharingState,
|
|
516
|
+
whiteboardState = _this$_sharingProvide.whiteboardState;
|
|
517
|
+
state.layoutMode = this._sharedVideoWindowDataSource.layoutType;
|
|
518
|
+
state.participantCount = this._sharedMemberDataSource.totalUserCount;
|
|
519
|
+
state.isSecondaryWindowModeEnabled = getIsSecondaryWindowModeEnabled(this._displayCount, this._sharedSettingDataSource.setting.isDualDisplayMode);
|
|
520
|
+
if (screenSharingState !== _type.FcrScreenSharingState.END) {
|
|
521
|
+
this._handleScreenSharingState(state);
|
|
522
|
+
}
|
|
523
|
+
if (whiteboardState !== _type.FcrWhiteboardState.END) {
|
|
524
|
+
this._handleWhiteboardState(state);
|
|
525
|
+
}
|
|
526
|
+
this._setDisplayState(state);
|
|
527
|
+
}
|
|
528
|
+
}, {
|
|
529
|
+
key: "_handleScreenSharingState",
|
|
530
|
+
value: function _handleScreenSharingState(state) {
|
|
531
|
+
var sharingProvider = this._sharingProvider;
|
|
532
|
+
if (sharingProvider.screenSharingState === _type.FcrScreenSharingState.END) {
|
|
533
|
+
state.isSharing = false;
|
|
534
|
+
state.sharingBySelf = false;
|
|
535
|
+
state.sharingType = undefined;
|
|
536
|
+
state.sharingStreamId = '';
|
|
537
|
+
state.isSharingScreen = false;
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
var stream = this._getSharingStream(sharingProvider.screenSharingOwnerId);
|
|
541
|
+
state.isSharing = true;
|
|
542
|
+
state.isSharingScreen = true;
|
|
543
|
+
if (stream) {
|
|
544
|
+
state.sharingBySelf = stream.isMySelf;
|
|
545
|
+
state.sharingStreamId = stream.videoStreamId || '';
|
|
546
|
+
}
|
|
547
|
+
switch (sharingProvider.screenSharingState) {
|
|
548
|
+
case _type.FcrScreenSharingState.START_ONLY_SCREEN:
|
|
549
|
+
state.sharingType = _type2.FcrUIDisplayDistributionContentType.SHARING_SCREEN;
|
|
550
|
+
break;
|
|
551
|
+
case _type.FcrScreenSharingState.START_WHIT_ANNOTATION:
|
|
552
|
+
state.sharingType = _type2.FcrUIDisplayDistributionContentType.SHARING_SCREEN_WITH_ANNOTATION;
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}, {
|
|
557
|
+
key: "_handleWhiteboardState",
|
|
558
|
+
value: function _handleWhiteboardState(state) {
|
|
559
|
+
var sharingProvider = this._sharingProvider;
|
|
560
|
+
if (sharingProvider.whiteboardState === _type.FcrWhiteboardState.END) {
|
|
561
|
+
state.isSharing = false;
|
|
562
|
+
state.sharingBySelf = false;
|
|
563
|
+
state.sharingType = undefined;
|
|
564
|
+
state.isSharingBoard = false;
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
state.isSharing = true;
|
|
568
|
+
state.sharingBySelf = sharingProvider.whiteboardOwnerId === this._userId;
|
|
569
|
+
state.sharingType = _type2.FcrUIDisplayDistributionContentType.SHARING_WHITEBOARD;
|
|
570
|
+
state.isSharingBoard = true;
|
|
571
|
+
}
|
|
572
|
+
}]);
|
|
573
|
+
}();
|
|
574
|
+
_FcrUIMultiDisplayProviderImpl = FcrUIMultiDisplayProviderImpl;
|
|
575
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIMultiDisplayProviderImpl, [[_mobx.observable, 1, "_displayCount"], [_mobx.observable, 1, "_displayState"], [_mobx.observable, 1, "_secondaryWindowContentType"], [_mobx.observable, 1, "_mainWindowContentType"], [_imports.bound, 2, "moveMainWindowToIndexLeastDisplay"], [_imports.bound, 2, "showMainWindowInIndexLeastDisplay"], [_imports.bound, 2, "setMainWindowMaximize"], [_imports.bound, 2, "_handleDisplayCountUpdated"]], []).e, 5);
|
|
576
|
+
_init__displayCount = _applyDecs$e[0];
|
|
577
|
+
_init__displayState = _applyDecs$e[1];
|
|
578
|
+
_init__secondaryWindowContentType = _applyDecs$e[2];
|
|
579
|
+
_init__mainWindowContentType = _applyDecs$e[3];
|
|
580
|
+
_initProto = _applyDecs$e[4];
|
|
581
|
+
(0, _base.registerDependency)('multiDisplayProvider');
|