diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 2b32883..ce50e21 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -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) }; }, []); diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index 6f857ce..4e0a99f 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -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 } );