This commit is contained in:
parent
83efd746e2
commit
4774f875a3
|
|
@ -58,9 +58,9 @@ const UserVideo: React.FC = () => {
|
||||||
}, [from.viewPeopleValue])
|
}, [from.viewPeopleValue])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
userList.forEach((item: any) => {
|
userList.forEach(async (item: any) => {
|
||||||
agora.destroyRendererByConfig(Number('1' + item.screenShareId))
|
await agora.destroyRendererByConfig(Number('1' + item.screenShareId))
|
||||||
agora.setupRemoteVideoEx({
|
await agora.setupRemoteVideoEx({
|
||||||
uid: Number('1' + item.screenShareId),
|
uid: Number('1' + item.screenShareId),
|
||||||
view: document.getElementById(`video-${item.screenShareId}`),
|
view: document.getElementById(`video-${item.screenShareId}`),
|
||||||
channelId: state.channelId + 'a',
|
channelId: state.channelId + 'a',
|
||||||
|
|
|
||||||
|
|
@ -209,15 +209,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scrollButton {
|
|
||||||
position: absolute;
|
|
||||||
padding: 4px 10px;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 3;
|
|
||||||
color: white;
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 自由者模式
|
// 自由者模式
|
||||||
.meetingContentBodyLeftFreedomMode {
|
.meetingContentBodyLeftFreedomMode {
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,8 @@ const Meeting: React.FC = () => {
|
||||||
window.addEventListener('customStorageChange', handleCustomStorageChange);
|
window.addEventListener('customStorageChange', handleCustomStorageChange);
|
||||||
window.addEventListener('online', handleNetworkChange);
|
window.addEventListener('online', handleNetworkChange);
|
||||||
window.addEventListener('offline', handleNetworkChange);
|
window.addEventListener('offline', handleNetworkChange);
|
||||||
|
const container = document.getElementById('videoView') as HTMLElement;
|
||||||
|
container.addEventListener('wheel', handleWheelChange);
|
||||||
time = setInterval(() => {
|
time = setInterval(() => {
|
||||||
setCurrentSeconds(currentSeconds++)
|
setCurrentSeconds(currentSeconds++)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
@ -216,6 +218,7 @@ const Meeting: React.FC = () => {
|
||||||
window.removeEventListener('customStorageChange', handleCustomStorageChange);
|
window.removeEventListener('customStorageChange', handleCustomStorageChange);
|
||||||
window.removeEventListener('online', handleNetworkChange);
|
window.removeEventListener('online', handleNetworkChange);
|
||||||
window.removeEventListener('offline', handleNetworkChange);
|
window.removeEventListener('offline', handleNetworkChange);
|
||||||
|
window.removeEventListener('wheel', handleWheelChange);
|
||||||
clearInterval(time)
|
clearInterval(time)
|
||||||
clearInterval(getDesktopCapturerVideoTime)
|
clearInterval(getDesktopCapturerVideoTime)
|
||||||
};
|
};
|
||||||
|
|
@ -384,11 +387,6 @@ const Meeting: React.FC = () => {
|
||||||
type="primary"
|
type="primary"
|
||||||
className='m-ant-btn'
|
className='m-ant-btn'
|
||||||
onClick={async (e: any) => {
|
onClick={async (e: any) => {
|
||||||
await postRoomManager({
|
|
||||||
roomId: state.roomId,
|
|
||||||
roomNum: state.channelId,
|
|
||||||
userId: item.uid
|
|
||||||
})
|
|
||||||
let i = e.nativeEvent.path;
|
let i = e.nativeEvent.path;
|
||||||
if (i) {
|
if (i) {
|
||||||
i.forEach((i: any) => {
|
i.forEach((i: any) => {
|
||||||
|
|
@ -396,6 +394,11 @@ const Meeting: React.FC = () => {
|
||||||
i.childNodes.forEach((row: any) => {
|
i.childNodes.forEach((row: any) => {
|
||||||
if (row.className === 'ant-notification-notice-close') {
|
if (row.className === 'ant-notification-notice-close') {
|
||||||
row.click()
|
row.click()
|
||||||
|
postRoomManager({
|
||||||
|
roomId: state.roomId,
|
||||||
|
roomNum: state.channelId,
|
||||||
|
userId: item.uid
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -722,6 +725,15 @@ const Meeting: React.FC = () => {
|
||||||
message.error('网络已断开!')
|
message.error('网络已断开!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 滚动
|
||||||
|
const handleWheelChange = (e: any): void => {
|
||||||
|
const container = document.getElementById('videoView') as HTMLElement;
|
||||||
|
if (e.wheelDeltaY > 0) {
|
||||||
|
container.scrollLeft -= 100
|
||||||
|
} else {
|
||||||
|
container.scrollLeft += 100
|
||||||
|
}
|
||||||
|
}
|
||||||
// 渲染视频
|
// 渲染视频
|
||||||
const renderVideo = async (uid: string = ''): Promise<void> => {
|
const renderVideo = async (uid: string = ''): Promise<void> => {
|
||||||
if (uid) {
|
if (uid) {
|
||||||
|
|
@ -1298,26 +1310,6 @@ const Meeting: React.FC = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 滚动按钮
|
|
||||||
const getScrollButton = (): any => {
|
|
||||||
switch (meetingMode) {
|
|
||||||
case 'StandardMode':
|
|
||||||
return <div className={`${styles.scrollButton} drag`} style={{ top: '80px', right: '20px' }} title='滚动' onClick={() => {
|
|
||||||
const element = document.getElementById('videoView') as HTMLElement;
|
|
||||||
element.scrollLeft += 100; // 每次点击向右滚动100像素
|
|
||||||
}}>
|
|
||||||
滚动
|
|
||||||
</div>
|
|
||||||
case 'SpeakerMode':
|
|
||||||
return <div className={`${styles.scrollButton} drag`} style={{ bottom: '10px', left: '144px' }} title='滚动' onClick={() => {
|
|
||||||
const element = document.getElementById('videoView') as HTMLElement;
|
|
||||||
element.scrollTop += 100; // 每次点击向下滚动100像素
|
|
||||||
}}>
|
|
||||||
滚动
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// 加入房间
|
// 加入房间
|
||||||
const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => {
|
const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => {
|
||||||
await GetJoin({
|
await GetJoin({
|
||||||
|
|
@ -1413,7 +1405,6 @@ const Meeting: React.FC = () => {
|
||||||
<div className={styles.meetingContentBody}>
|
<div className={styles.meetingContentBody}>
|
||||||
<div className={`${styles.meetingContentBodyLeft} drag`}>
|
<div className={`${styles.meetingContentBodyLeft} drag`}>
|
||||||
{isAdmin && currentLookUserAccount ? getSettingIcon() : null}
|
{isAdmin && currentLookUserAccount ? getSettingIcon() : null}
|
||||||
{roomUserList.length > 6 ? getScrollButton() : null}
|
|
||||||
<div className={getMeetingContentBodyLeftModeClass()} id='videoView'>
|
<div className={getMeetingContentBodyLeftModeClass()} id='videoView'>
|
||||||
{roomUserList.map((item: any, index: number) => {
|
{roomUserList.map((item: any, index: number) => {
|
||||||
return (index <= 19 && item.isRoom && item.isAdmin ? <div
|
return (index <= 19 && item.isRoom && item.isAdmin ? <div
|
||||||
|
|
@ -1512,6 +1503,56 @@ const Meeting: React.FC = () => {
|
||||||
</div> : null)
|
</div> : null)
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${styles.meetingContentSwiperCard} `}>
|
||||||
|
<div className={`${styles.meetingContentSwiperCardVdeio}`}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{currentLookUserStatus === 0 && currentLookUserAccount ?
|
{currentLookUserStatus === 0 && currentLookUserAccount ?
|
||||||
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
|
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
|
||||||
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-camera-primary'>
|
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-camera-primary'>
|
||||||
|
|
|
||||||
|
|
@ -286,8 +286,8 @@ export const agora = {
|
||||||
startCameraCapture: async () => {
|
startCameraCapture: async () => {
|
||||||
await rtcEngine.startCameraCapture(VideoSourceType.VideoSourceCamera, {
|
await rtcEngine.startCameraCapture(VideoSourceType.VideoSourceCamera, {
|
||||||
format: {
|
format: {
|
||||||
width: 640,
|
width: 1280,
|
||||||
height: 360,
|
height: 720,
|
||||||
fps: 15,
|
fps: 15,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue