yangjie #47

Merged
yangqiang merged 49 commits from yangjie into master 2025-01-24 13:43:09 +08:00
2 changed files with 30 additions and 25 deletions
Showing only changes of commit 982867dfe1 - Show all commits

View File

@ -340,7 +340,6 @@ const Meeting: React.FC = () => {
return res return res
})) }))
break; break;
break;
case 'userListWindowGetRoomKickout': case 'userListWindowGetRoomKickout':
GetRoomKickout(state.channelId, userListWindowGetRoomKickout.uid) GetRoomKickout(state.channelId, userListWindowGetRoomKickout.uid)
break; break;
@ -1013,6 +1012,17 @@ const Meeting: React.FC = () => {
}, currentVideoId ? 0 : 1500); }, currentVideoId ? 0 : 1500);
}, [currentLookUserStatus, currentVideoUid]); }, [currentLookUserStatus, currentVideoUid]);
useEffect(() => {
if (isScreenCapture) {
agora.setupLocalVideo({
uid: Number(user.uid),
view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement,
channelId: state.channelId,
sourceType: VideoSourceType.VideoSourceCameraPrimary,
type: true
})
}
}, [isScreenCapture]);
useEffect(() => { useEffect(() => {
let timer: NodeJS.Timeout; let timer: NodeJS.Timeout;
@ -1444,6 +1454,7 @@ const Meeting: React.FC = () => {
} }
return res return res
}) })
setTimeout(() => {
if (uid === userInfo.uid || uid === userInfo.screenShareId) { if (uid === userInfo.uid || uid === userInfo.screenShareId) {
if (String(uid).length === 9) { if (String(uid).length === 9) {
// 共享屏幕 // 共享屏幕
@ -1461,6 +1472,7 @@ const Meeting: React.FC = () => {
setCurrentLookUserStatus(4) setCurrentLookUserStatus(4)
} }
} }
}, 500);
} }
// 全员观看 // 全员观看
const getShowUser = async (): Promise<void> => { const getShowUser = async (): Promise<void> => {
@ -1797,15 +1809,6 @@ const Meeting: React.FC = () => {
height: 160, height: 160,
}) })
window.electron.setPosition('right') 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);
} }
} }
}) })
@ -1848,6 +1851,7 @@ const Meeting: React.FC = () => {
} }
// 停止共享 // 停止共享
const stopScreenCapture = async (): Promise<void> => { const stopScreenCapture = async (): Promise<void> => {
await agora.destroyRendererByView(`meetingAbsoluteVideo`)
const footerListTemplate = [...footerList] const footerListTemplate = [...footerList]
await agora.leaveChannelEx(userInfo.screenShareId) await agora.leaveChannelEx(userInfo.screenShareId)
agora.stopScreenCapture() agora.stopScreenCapture()

View File

@ -395,6 +395,7 @@ export const agora = {
}, },
destroyRendererByView: async (key: string) => { destroyRendererByView: async (key: string) => {
let dom = document.getElementById(key); let dom = document.getElementById(key);
console.log(dom);
if (dom) { if (dom) {
await rtcEngine.destroyRendererByView(dom); await rtcEngine.destroyRendererByView(dom);
} }