yangjie #35
31
main.js
31
main.js
|
|
@ -551,7 +551,8 @@ app.on('ready', () => {
|
||||||
childWindow[k] = ""
|
childWindow[k] = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mainWindowCenter()
|
mainWindow.setSkipTaskbar(false)
|
||||||
|
mainWindow.setAlwaysOnTop(false)
|
||||||
} else {
|
} else {
|
||||||
childWindow[key].close()
|
childWindow[key].close()
|
||||||
childWindow[key] = ""
|
childWindow[key] = ""
|
||||||
|
|
@ -589,13 +590,18 @@ app.on('ready', () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 隐藏主窗口
|
// 定位主窗口
|
||||||
ipcMain.handle('mainWindowHide', () => {
|
ipcMain.handle('setPosition', (event, data) => {
|
||||||
mainWindowHide()
|
const display = screen.getDisplayMatching({ ...mainWindow.getBounds() });
|
||||||
});
|
const { width, height } = display.size
|
||||||
// 居中主窗口
|
switch (data) {
|
||||||
ipcMain.handle('mainWindowCenter', () => {
|
case 'right':
|
||||||
mainWindowCenter()
|
x = width - mainWindow.getSize()[0];
|
||||||
|
mainWindow.setPosition(x - 40, 40);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// 窗口通信
|
// 窗口通信
|
||||||
ipcMain.handle('windowHandleMessage', (event, data) => {
|
ipcMain.handle('windowHandleMessage', (event, data) => {
|
||||||
|
|
@ -682,7 +688,8 @@ function windowOperation(config) {
|
||||||
case 'shareScreenWindow':
|
case 'shareScreenWindow':
|
||||||
x = Math.round((display.workArea.width - child.getSize()[0]) / 2);
|
x = Math.round((display.workArea.width - child.getSize()[0]) / 2);
|
||||||
child.setPosition(x, 0);
|
child.setPosition(x, 0);
|
||||||
mainWindowHide()
|
mainWindow.setSkipTaskbar(true)
|
||||||
|
mainWindow.setAlwaysOnTop(true, 'screen-saver')
|
||||||
break;
|
break;
|
||||||
case 'chatSmallWindow':
|
case 'chatSmallWindow':
|
||||||
y = height - child.getSize()[1];
|
y = height - child.getSize()[1];
|
||||||
|
|
@ -690,7 +697,7 @@ function windowOperation(config) {
|
||||||
break;
|
break;
|
||||||
case 'currentSpeakUserWindow':
|
case 'currentSpeakUserWindow':
|
||||||
x = width - child.getSize()[0];
|
x = width - child.getSize()[0];
|
||||||
child.setPosition(x - 40, 40);
|
child.setPosition(x - 40, 210);
|
||||||
break;
|
break;
|
||||||
case 'noticeWindow':
|
case 'noticeWindow':
|
||||||
x = width - child.getSize()[0];
|
x = width - child.getSize()[0];
|
||||||
|
|
@ -706,10 +713,6 @@ function mainWindowCenter() {
|
||||||
const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2);
|
const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2);
|
||||||
mainWindow.setPosition(x, y);
|
mainWindow.setPosition(x, y);
|
||||||
}
|
}
|
||||||
// 主窗口隐藏
|
|
||||||
function mainWindowHide() {
|
|
||||||
mainWindow.setPosition(-999999, -999999);
|
|
||||||
}
|
|
||||||
|
|
||||||
const startSignalr = async (user) => {
|
const startSignalr = async (user) => {
|
||||||
connection = new signalR.HubConnectionBuilder()
|
connection = new signalR.HubConnectionBuilder()
|
||||||
|
|
|
||||||
10
preload.js
10
preload.js
|
|
@ -127,13 +127,9 @@ window.electron = {
|
||||||
setChildWindowShow: (config) => {
|
setChildWindowShow: (config) => {
|
||||||
ipcRenderer.invoke('setChildWindowShow', config)
|
ipcRenderer.invoke('setChildWindowShow', config)
|
||||||
},
|
},
|
||||||
// 隐藏主窗口
|
// 定位主窗口
|
||||||
mainWindowHide: () => {
|
setPosition: (data) => {
|
||||||
ipcRenderer.invoke('mainWindowHide')
|
ipcRenderer.invoke('setPosition', data)
|
||||||
},
|
|
||||||
// 居中主窗口
|
|
||||||
mainWindowCenter: () => {
|
|
||||||
ipcRenderer.invoke('mainWindowCenter')
|
|
||||||
},
|
},
|
||||||
// 窗口通信传参
|
// 窗口通信传参
|
||||||
windowHandleMessage: (data) => {
|
windowHandleMessage: (data) => {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import { PostLogin } from "@/api/Login";
|
||||||
import { agora } from "@/utils/package/agora";
|
import { agora } from "@/utils/package/agora";
|
||||||
import QuitTips from "@/components/QuitTips";
|
import QuitTips from "@/components/QuitTips";
|
||||||
import { GetLeave } from "@/api/Meeting";
|
import { GetLeave } from "@/api/Meeting";
|
||||||
import path from "path";
|
|
||||||
import ShareScreenWindow from "@/page/Meeting/ShareScreenWindow";
|
import ShareScreenWindow from "@/page/Meeting/ShareScreenWindow";
|
||||||
import UserListWindow from "@/page/Meeting/UserListWindow";
|
import UserListWindow from "@/page/Meeting/UserListWindow";
|
||||||
import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow";
|
import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow";
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,29 @@
|
||||||
background-color: #1F2022;
|
background-color: #1F2022;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.meetingAbsolute {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #1F2022;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 3000;
|
||||||
|
|
||||||
|
.meetingAbsoluteLoading {
|
||||||
|
background: black;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.meetingHeader {
|
.meetingHeader {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -597,8 +620,6 @@
|
||||||
color: #F3F3F5;
|
color: #F3F3F5;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
>div {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
>div:nth-child(2) {
|
>div:nth-child(2) {
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ const Meeting: React.FC = () => {
|
||||||
})
|
})
|
||||||
const [networkOther, setNetworkOther] = useState<RtcStats>({})
|
const [networkOther, setNetworkOther] = useState<RtcStats>({})
|
||||||
const [isComputerAudio, setIsComputerAudio] = useState(false)
|
const [isComputerAudio, setIsComputerAudio] = useState(false)
|
||||||
const [_isScreenCapture, setIsScreenCapture] = useState(false)
|
const [isScreenCapture, setIsScreenCapture] = useState(false)
|
||||||
const [isFluencyPriority, setIsFluencyPriority] = useState(false)
|
const [isFluencyPriority, setIsFluencyPriority] = useState(false)
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const [modeOpen, setModeOpen] = useState(false)
|
const [modeOpen, setModeOpen] = useState(false)
|
||||||
|
|
@ -1597,7 +1597,6 @@ const Meeting: React.FC = () => {
|
||||||
await allUserLook(user.screenShareId, user.userName)
|
await allUserLook(user.screenShareId, user.userName)
|
||||||
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||||
setIsScreenCapture(true)
|
setIsScreenCapture(true)
|
||||||
window.electron.setViewStatus('hide')
|
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
window.electron.createChildWindow({
|
window.electron.createChildWindow({
|
||||||
url: location.origin + `/#/noticeWindow`,
|
url: location.origin + `/#/noticeWindow`,
|
||||||
|
|
@ -1640,6 +1639,20 @@ const Meeting: React.FC = () => {
|
||||||
key: 'userListWindow',
|
key: 'userListWindow',
|
||||||
})
|
})
|
||||||
setKeyOpenChildWindow('shareScreenWindow', true)
|
setKeyOpenChildWindow('shareScreenWindow', true)
|
||||||
|
window.electron.setMainWindowSize({
|
||||||
|
width: 250,
|
||||||
|
height: 160,
|
||||||
|
})
|
||||||
|
window.electron.setPosition('right')
|
||||||
|
setTimeout(() => {
|
||||||
|
agora.setupLocalVideo({
|
||||||
|
uid: Number(user.uid),
|
||||||
|
view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement,
|
||||||
|
channelId: state.channelId,
|
||||||
|
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||||
|
type: true
|
||||||
|
})
|
||||||
|
}, 1500);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('请选择应用!')
|
message.error('请选择应用!')
|
||||||
|
|
@ -2067,6 +2080,11 @@ const Meeting: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.meeting}>
|
<div className={styles.meeting}>
|
||||||
|
{isScreenCapture ? <div className={`${styles.meetingAbsolute}`} id='meetingAbsoluteVideo'>
|
||||||
|
{footerList[0][1].active ? <div className={styles.meetingAbsoluteLoading}>
|
||||||
|
<Avatar name={user.userName} />
|
||||||
|
</div> : null}
|
||||||
|
</div> : null}
|
||||||
{contextHolder}
|
{contextHolder}
|
||||||
<div className={styles.meetingHeader}>
|
<div className={styles.meetingHeader}>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,7 @@ export interface IElectronAPI {
|
||||||
setChildWindow: (config: any) => void;
|
setChildWindow: (config: any) => void;
|
||||||
setChildWindowShow: (config: any) => void;
|
setChildWindowShow: (config: any) => void;
|
||||||
closeChildWindow: (key: string) => void;
|
closeChildWindow: (key: string) => void;
|
||||||
mainWindowCenter: () => any;
|
setPosition: (data: ang) => void;
|
||||||
mainWindowHide: () => any;
|
|
||||||
windowHandleMessage: (data: any) => {}
|
windowHandleMessage: (data: any) => {}
|
||||||
windowHandleMessageCallBack: (callBack: Function) => void;
|
windowHandleMessageCallBack: (callBack: Function) => void;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue