yangjie #22

Merged
yangqiang merged 99 commits from yangjie into master 2024-10-22 16:11:46 +08:00
2 changed files with 20 additions and 24 deletions
Showing only changes of commit 652830f6f1 - Show all commits

View File

@ -189,7 +189,7 @@ const Meeting: React.FC = () => {
const channel = new BroadcastChannel('meeting_channel');
useEffect(() => {
let time: NodeJS.Timeout;
// let getDesktopCapturerVideoTime: NodeJS.Timeout;
let getDesktopCapturerVideoTime: NodeJS.Timeout;
setUser(userInfo)
window.electron.getIsMaximized().then((res: boolean) => {
if (!res) {
@ -358,28 +358,28 @@ const Meeting: React.FC = () => {
})
}
}, 10000);
// getDesktopCapturerVideoTime = setInterval(() => {
// setSharedScreenItem((i: any) => {
// if (i && i.type === 0) {
// agora.getDesktopCapturerVideo({ width: 0, height: 0 }, { width: 0, height: 0 }, false).then(res => {
// if (res.length) {
// let row = res.find((item: any) => item.sourceId === i.sourceId)
// if (!row) {
// stopScreenCapture()
// setSharedScreenItem('')
// allUserLook(userInfo.uid, userInfo.userName)
// }
// }
// })
// }
// return i
// })
// }, 3000)
getDesktopCapturerVideoTime = setInterval(() => {
setSharedScreenItem((i: any) => {
if (i && i.type === 0) {
agora.getDesktopCapturerVideo({ width: 0, height: 0 }, { width: 0, height: 0 }, false).then(res => {
if (res.length) {
let row = res.find((item: any) => item.sourceId === i.sourceId)
if (!row) {
stopScreenCapture()
setSharedScreenItem('')
allUserLook(userInfo.uid, userInfo.userName)
}
}
})
}
return i
})
}, 3000)
return () => {
window.removeEventListener('customStorageChange', handleCustomStorageChange);
window.removeEventListener('wheel', handleWheelChange);
clearInterval(time)
// clearInterval(getDesktopCapturerVideoTime)
clearInterval(getDesktopCapturerVideoTime)
};
}, []);

View File

@ -388,7 +388,7 @@ export const agora = {
},
// 桌面捕获音频和视频的媒体源的信息
getDesktopCapturerVideo: async (thumbSize: any, iconSize: any, includeScreen: boolean) => {
return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen).filter((item: any) => item.type === 1)
return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen)
},
// 共享屏幕采集
setDesktopCapturerVideo: async (targetSource: any, isComputerAudio: boolean, isFluencyPriority: boolean) => {
@ -414,8 +414,6 @@ export const agora = {
{},
{
windowFocus: true,
enableHighLight: true,
highLightColor: 0xFF99CC00,
...data
}
);
@ -425,8 +423,6 @@ export const agora = {
{},
{
windowFocus: true,
enableHighLight: true,
highLightColor: 0xFF99CC00,
...data
}
);