视频小窗
This commit is contained in:
parent
63ce58bb96
commit
f34731f040
31
main.js
31
main.js
|
|
@ -551,7 +551,8 @@ app.on('ready', () => {
|
|||
childWindow[k] = ""
|
||||
}
|
||||
}
|
||||
mainWindowCenter()
|
||||
mainWindow.setSkipTaskbar(false)
|
||||
mainWindow.setAlwaysOnTop(false)
|
||||
} else {
|
||||
childWindow[key].close()
|
||||
childWindow[key] = ""
|
||||
|
|
@ -589,13 +590,18 @@ app.on('ready', () => {
|
|||
}
|
||||
}
|
||||
});
|
||||
// 隐藏主窗口
|
||||
ipcMain.handle('mainWindowHide', () => {
|
||||
mainWindowHide()
|
||||
});
|
||||
// 居中主窗口
|
||||
ipcMain.handle('mainWindowCenter', () => {
|
||||
mainWindowCenter()
|
||||
// 定位主窗口
|
||||
ipcMain.handle('setPosition', (event, data) => {
|
||||
const display = screen.getDisplayMatching({ ...mainWindow.getBounds() });
|
||||
const { width, height } = display.size
|
||||
switch (data) {
|
||||
case 'right':
|
||||
x = width - mainWindow.getSize()[0];
|
||||
mainWindow.setPosition(x - 40, 40);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
// 窗口通信
|
||||
ipcMain.handle('windowHandleMessage', (event, data) => {
|
||||
|
|
@ -682,7 +688,8 @@ function windowOperation(config) {
|
|||
case 'shareScreenWindow':
|
||||
x = Math.round((display.workArea.width - child.getSize()[0]) / 2);
|
||||
child.setPosition(x, 0);
|
||||
mainWindowHide()
|
||||
mainWindow.setSkipTaskbar(true)
|
||||
mainWindow.setAlwaysOnTop(true, 'screen-saver')
|
||||
break;
|
||||
case 'chatSmallWindow':
|
||||
y = height - child.getSize()[1];
|
||||
|
|
@ -690,7 +697,7 @@ function windowOperation(config) {
|
|||
break;
|
||||
case 'currentSpeakUserWindow':
|
||||
x = width - child.getSize()[0];
|
||||
child.setPosition(x - 40, 40);
|
||||
child.setPosition(x - 40, 210);
|
||||
break;
|
||||
case 'noticeWindow':
|
||||
x = width - child.getSize()[0];
|
||||
|
|
@ -706,10 +713,6 @@ function mainWindowCenter() {
|
|||
const y = Math.round((display.workArea.height - mainWindow.getSize()[1]) / 2);
|
||||
mainWindow.setPosition(x, y);
|
||||
}
|
||||
// 主窗口隐藏
|
||||
function mainWindowHide() {
|
||||
mainWindow.setPosition(-999999, -999999);
|
||||
}
|
||||
|
||||
const startSignalr = async (user) => {
|
||||
connection = new signalR.HubConnectionBuilder()
|
||||
|
|
|
|||
10
preload.js
10
preload.js
|
|
@ -127,13 +127,9 @@ window.electron = {
|
|||
setChildWindowShow: (config) => {
|
||||
ipcRenderer.invoke('setChildWindowShow', config)
|
||||
},
|
||||
// 隐藏主窗口
|
||||
mainWindowHide: () => {
|
||||
ipcRenderer.invoke('mainWindowHide')
|
||||
},
|
||||
// 居中主窗口
|
||||
mainWindowCenter: () => {
|
||||
ipcRenderer.invoke('mainWindowCenter')
|
||||
// 定位主窗口
|
||||
setPosition: (data) => {
|
||||
ipcRenderer.invoke('setPosition', data)
|
||||
},
|
||||
// 窗口通信传参
|
||||
windowHandleMessage: (data) => {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import { PostLogin } from "@/api/Login";
|
|||
import { agora } from "@/utils/package/agora";
|
||||
import QuitTips from "@/components/QuitTips";
|
||||
import { GetLeave } from "@/api/Meeting";
|
||||
import path from "path";
|
||||
import ShareScreenWindow from "@/page/Meeting/ShareScreenWindow";
|
||||
import UserListWindow from "@/page/Meeting/UserListWindow";
|
||||
import ChatSmallWindow from "@/page/Meeting/ChatSmallWindow";
|
||||
|
|
|
|||
|
|
@ -94,6 +94,29 @@
|
|||
background-color: #1F2022;
|
||||
display: flex;
|
||||
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 {
|
||||
display: flex;
|
||||
|
|
@ -597,8 +620,6 @@
|
|||
color: #F3F3F5;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
>div {}
|
||||
}
|
||||
|
||||
>div:nth-child(2) {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ const Meeting: React.FC = () => {
|
|||
})
|
||||
const [networkOther, setNetworkOther] = useState<RtcStats>({})
|
||||
const [isComputerAudio, setIsComputerAudio] = useState(false)
|
||||
const [_isScreenCapture, setIsScreenCapture] = useState(false)
|
||||
const [isScreenCapture, setIsScreenCapture] = useState(false)
|
||||
const [isFluencyPriority, setIsFluencyPriority] = useState(false)
|
||||
const [open, setOpen] = useState(false)
|
||||
const [modeOpen, setModeOpen] = useState(false)
|
||||
|
|
@ -1597,7 +1597,6 @@ const Meeting: React.FC = () => {
|
|||
await allUserLook(user.screenShareId, user.userName)
|
||||
const isOpen = await getKeyOpenChildWindow('shareScreenWindow')
|
||||
setIsScreenCapture(true)
|
||||
window.electron.setViewStatus('hide')
|
||||
if (!isOpen) {
|
||||
window.electron.createChildWindow({
|
||||
url: location.origin + `/#/noticeWindow`,
|
||||
|
|
@ -1640,6 +1639,20 @@ const Meeting: React.FC = () => {
|
|||
key: 'userListWindow',
|
||||
})
|
||||
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 {
|
||||
message.error('请选择应用!')
|
||||
|
|
@ -2067,6 +2080,11 @@ const Meeting: React.FC = () => {
|
|||
return (
|
||||
<>
|
||||
<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}
|
||||
<div className={styles.meetingHeader}>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ export interface IElectronAPI {
|
|||
setChildWindow: (config: any) => void;
|
||||
setChildWindowShow: (config: any) => void;
|
||||
closeChildWindow: (key: string) => void;
|
||||
mainWindowCenter: () => any;
|
||||
mainWindowHide: () => any;
|
||||
setPosition: (data: ang) => void;
|
||||
windowHandleMessage: (data: any) => {}
|
||||
windowHandleMessageCallBack: (callBack: Function) => void;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue