From e322314761595402bed75ab7f22017d0626159fc Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 9 Sep 2024 11:07:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserVideo/index.tsx | 2 +- src/page/Meeting/index.module.scss | 2 +- src/page/Meeting/index.tsx | 42 +++++++++++++++--------------- src/utils/package/agora.ts | 10 +++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/components/UserVideo/index.tsx b/src/components/UserVideo/index.tsx index ac9fcfd..c26b1b4 100644 --- a/src/components/UserVideo/index.tsx +++ b/src/components/UserVideo/index.tsx @@ -18,7 +18,7 @@ const UserVideo: React.FC = () => { viewPeople: [ { value: 6, label: '6人' }, { value: 12, label: '12人' }, - { value: 20, label: '20人' }, + // { value: 20, label: '20人' }, ], viewPeopleValue: 6, }) diff --git a/src/page/Meeting/index.module.scss b/src/page/Meeting/index.module.scss index 7b753af..95b6b5f 100644 --- a/src/page/Meeting/index.module.scss +++ b/src/page/Meeting/index.module.scss @@ -160,6 +160,7 @@ height: 100%; box-sizing: border-box; position: relative; + overflow: hidden; .standardModeIcon { position: absolute; @@ -658,7 +659,6 @@ } .meetingUserVideoList { - width: 500px; padding: 10px 10px 10px; box-sizing: border-box; height: 100%; diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 298ee3c..7bdc843 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -175,7 +175,7 @@ const Meeting: React.FC = () => { const msgTips = '您不是管理员或发言人,无法开启此功能!' useEffect(() => { let time: NodeJS.Timeout; - let getDesktopCapturerVideoTime: NodeJS.Timeout; + // let getDesktopCapturerVideoTime: NodeJS.Timeout; setUser(userInfo) setTimeout(() => { if (location.hash.indexOf('/login') === -1) { @@ -197,30 +197,30 @@ const Meeting: React.FC = () => { time = setInterval(() => { setCurrentSeconds(currentSeconds++) }, 1000) - 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('online', handleNetworkChange); window.removeEventListener('offline', handleNetworkChange); window.removeEventListener('wheel', handleWheelChange); clearInterval(time) - clearInterval(getDesktopCapturerVideoTime) + // clearInterval(getDesktopCapturerVideoTime) }; }, []); @@ -1403,7 +1403,7 @@ const Meeting: React.FC = () => {
{isAdmin && currentLookUserAccount ? getSettingIcon() : null} -
+
{roomUserList.map((item: any, index: number) => { return (index <= 19 && item.isRoom && item.isAdmin ?
{
: -
+
会议监控 { diff --git a/src/utils/package/agora.ts b/src/utils/package/agora.ts index eb652ae..691dd73 100644 --- a/src/utils/package/agora.ts +++ b/src/utils/package/agora.ts @@ -239,7 +239,7 @@ export const agora = { }, // 所有用户加入的第二个房间 allJoinChannelEx: async (bool: boolean = false) => { - await agora.startCameraCapture() + await agora.startCameraCapture(true) await rtcEngine.joinChannelEx( option.tokenA, { channelId: option.channelId + 'a', localUid: Number('1' + option.screenShareId) }, @@ -283,11 +283,11 @@ export const agora = { await rtcEngine.muteLocalVideoStream(mute) }, // 摄像头采集 - startCameraCapture: async () => { + startCameraCapture: async (bool: boolean = false) => { await rtcEngine.startCameraCapture(VideoSourceType.VideoSourceCamera, { format: { - width: 1280, - height: 720, + width: bool ? 120 : 1280, + height: bool ? 120 : 1280, fps: 15, } }) @@ -307,7 +307,7 @@ export const agora = { }, // 桌面捕获音频和视频的媒体源的信息 getDesktopCapturerVideo: async (thumbSize: any, iconSize: any, includeScreen: boolean) => { - return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen); + return await rtcEngine.getScreenCaptureSources(thumbSize, iconSize, includeScreen).filter((item: any) => item.type === 1) }, // 共享屏幕采集 setDesktopCapturerVideo: async (targetSource: any, isComputerAudio: boolean, isFluencyPriority: boolean) => {