视频折叠展开

This commit is contained in:
yj 2024-08-23 10:03:19 +08:00
parent d365b319a1
commit 736a958747
2 changed files with 68 additions and 7 deletions

View File

@ -161,6 +161,26 @@
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
.standardModeIcon {
position: absolute;
left: 50%;
transform: translate(-50%, 0%);
cursor: pointer;
font-size: 30px;
color: white;
z-index: 3;
}
.speakerModeIcon {
position: absolute;
top: 50%;
transform: translate(0, -50%);
cursor: pointer;
font-size: 30px;
color: white;
z-index: 3;
}
// 自由者模式 // 自由者模式
.meetingContentBodyLeftFreedomMode { .meetingContentBodyLeftFreedomMode {
width: 100%; width: 100%;
@ -236,6 +256,12 @@
left: 0; left: 0;
height: calc(100% - 160px) !important; height: calc(100% - 160px) !important;
width: 100% !important; width: 100% !important;
z-index: 2;
}
// 标准模式视频全部
.meetingContentSwiperCardStandardModeFullScreen {
height: 100% !important;
} }
// 演讲者模式视频 // 演讲者模式视频
@ -245,6 +271,12 @@
bottom: 0; bottom: 0;
height: 100% !important; height: 100% !important;
width: calc(100% - 18%) !important; width: calc(100% - 18%) !important;
z-index: 2;
}
// 标准模式视频全部
.meetingContentSwiperCardSpeakerModeFullScreen {
width: 100% !important;
} }
.meetingContentSwiperCard { .meetingContentSwiperCard {

View File

@ -4,7 +4,7 @@ import Operation from '@/components/Operation';
import SpeakerModeModal from '@/components/SpeakerModeModal'; import SpeakerModeModal from '@/components/SpeakerModeModal';
import InvitingPersonnelModal from '@/components/InvitingPersonnelModal'; import InvitingPersonnelModal from '@/components/InvitingPersonnelModal';
import { Button, Input, Popover, Modal, Checkbox, message, Popconfirm, notification } from "antd"; import { Button, Input, Popover, Modal, Checkbox, message, Popconfirm, notification } from "antd";
import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled } from '@ant-design/icons'; import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled, CaretDownOutlined, CaretUpOutlined, CaretLeftOutlined, CaretRightOutlined } from '@ant-design/icons';
import { useLocation, useNavigate } from 'react-router-dom'; import { useLocation, useNavigate } from 'react-router-dom';
import { thumbImageBufferToBase64 } from '@/utils/package/base64' import { thumbImageBufferToBase64 } from '@/utils/package/base64'
import { storage } from '@/utils'; import { storage } from '@/utils';
@ -148,6 +148,7 @@ const Meeting: React.FC = () => {
threshold: 3 threshold: 3
} }
}); });
const [isVideoFullScreen, setIsVideoFullScreen] = useState<boolean>(false)
let userInfo = JSON.parse(storage.getItem('user') as string) let userInfo = JSON.parse(storage.getItem('user') as string)
const msgTips = '您不是管理员或发言人,无法开启此功能!' const msgTips = '您不是管理员或发言人,无法开启此功能!'
useEffect(() => { useEffect(() => {
@ -1163,6 +1164,33 @@ const Meeting: React.FC = () => {
} }
return '' return ''
} }
// 视频是否全屏
const setMeetingContentSwiperCardFullScreenClass = (): string => {
switch (meetingMode) {
case 'StandardMode':
return isVideoFullScreen ? styles.meetingContentSwiperCardStandardModeFullScreen : ''
case 'SpeakerMode':
return isVideoFullScreen ? styles.meetingContentSwiperCardSpeakerModeFullScreen : ''
}
return ''
}
// 获取展开折叠按钮
const getSettingIcon = (): any => {
switch (meetingMode) {
case 'StandardMode':
if (isVideoFullScreen) {
return <CaretDownOutlined className={`${styles.standardModeIcon} drag`} style={{ top: '-10px' }} title='展开' onClick={() => setIsVideoFullScreen(false)} /> //下
} else {
return <CaretUpOutlined className={`${styles.standardModeIcon} drag`} style={{ top: '148px' }} title='收起' onClick={() => setIsVideoFullScreen(true)} /> //上
}
case 'SpeakerMode':
if (isVideoFullScreen) {
return <CaretRightOutlined className={`${styles.speakerModeIcon} drag`} style={{ left: '-10px' }} title='展开' onClick={() => setIsVideoFullScreen(false)} /> //右
} else {
return <CaretLeftOutlined className={`${styles.speakerModeIcon} drag`} style={{ left: 'calc(18% - 12px)' }} title='收起' onClick={() => setIsVideoFullScreen(true)} /> //左
}
}
}
// 加入房间 // 加入房间
const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => { const getJoin = async (enableMicr: boolean, enableCamera: boolean): Promise<void> => {
await GetJoin({ await GetJoin({
@ -1257,6 +1285,7 @@ const Meeting: React.FC = () => {
<div className={styles.meetingContent}> <div className={styles.meetingContent}>
<div className={styles.meetingContentBody}> <div className={styles.meetingContentBody}>
<div className={`${styles.meetingContentBodyLeft} drag`}> <div className={`${styles.meetingContentBodyLeft} drag`}>
{currentLookUserAccount ? getSettingIcon() : 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
@ -1271,7 +1300,7 @@ const Meeting: React.FC = () => {
} }
}} }}
> >
<div className={`${styles.meetingContentSwiperCardVdeio} ${item.uid === currentVideoId ? styles.active : ''} ${item.roleId === '1' || item.isRoomManager ? styles.boxShadow : ''}`} id={`video-${item.uid}`}> <div className={`${styles.meetingContentSwiperCardVdeio} ${(item.uid === currentVideoId) && !isVideoFullScreen ? styles.active : ''} ${(item.roleId === '1' || item.isRoomManager) && !isVideoFullScreen ? styles.boxShadow : ''}`} id={`video-${item.uid}`}>
<div className={styles.meetingContentSwiperCardVdeioLoading}> <div className={styles.meetingContentSwiperCardVdeioLoading}>
<Avatar name={item.userName} /> <Avatar name={item.userName} />
</div> </div>
@ -1356,7 +1385,7 @@ const Meeting: React.FC = () => {
} }
)} )}
{currentLookUserStatus === 0 && currentLookUserAccount ? {currentLookUserStatus === 0 && currentLookUserAccount ?
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()}`}> <div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-camera-primary'> <div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-camera-primary'>
{<div className={styles.meetingContentSwiperCardVdeioLoading}> {<div className={styles.meetingContentSwiperCardVdeioLoading}>
<Avatar name={currentLookUserAccount.userName} /> <Avatar name={currentLookUserAccount.userName} />
@ -1365,7 +1394,7 @@ const Meeting: React.FC = () => {
{meetingContentUser(currentLookUserAccount, true)} {meetingContentUser(currentLookUserAccount, true)}
</div> : null} </div> : null}
{currentLookUserStatus === 1 && currentLookUserAccount ? {currentLookUserStatus === 1 && currentLookUserAccount ?
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()}`}> <div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-camera-primary'> <div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-camera-primary'>
{<div className={styles.meetingContentSwiperCardVdeioLoading}> {<div className={styles.meetingContentSwiperCardVdeioLoading}>
<Avatar name={currentLookUserAccount.userName} /> <Avatar name={currentLookUserAccount.userName} />
@ -1375,7 +1404,7 @@ const Meeting: React.FC = () => {
{currentLookUserAccount.enableCamera ? null : meetingContentError(currentLookUserAccount)} {currentLookUserAccount.enableCamera ? null : meetingContentError(currentLookUserAccount)}
</div> : null} </div> : null}
{currentLookUserStatus === 2 && currentLookUserAccount ? {currentLookUserStatus === 2 && currentLookUserAccount ?
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()}`}> <div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-screen'> <div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-screen'>
<div className={styles.meetingContentSwiperCardVdeioLoading}> <div className={styles.meetingContentSwiperCardVdeioLoading}>
<Avatar name={currentLookUserAccount.userName} /> <Avatar name={currentLookUserAccount.userName} />
@ -1384,7 +1413,7 @@ const Meeting: React.FC = () => {
{meetingContentUser(currentLookUserAccount, true)} {meetingContentUser(currentLookUserAccount, true)}
</div> : null} </div> : null}
{currentLookUserStatus === 3 && currentLookUserAccount ? {currentLookUserStatus === 3 && currentLookUserAccount ?
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()}`}> <div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-remote-screen'> <div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-remote-screen'>
<div className={styles.meetingContentSwiperCardVdeioLoading}> <div className={styles.meetingContentSwiperCardVdeioLoading}>
<Avatar name={currentLookUserAccount.userName} /> <Avatar name={currentLookUserAccount.userName} />
@ -1393,7 +1422,7 @@ const Meeting: React.FC = () => {
{meetingContentUser(currentLookUserAccount, true)} {meetingContentUser(currentLookUserAccount, true)}
</div> : null} </div> : null}
{currentLookUserStatus === 4 && currentLookUserAccount ? {currentLookUserStatus === 4 && currentLookUserAccount ?
<div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()}`}> <div className={`${styles.meetingContentSwiperCard} ${setMeetingContentSwiperCardClass()} ${setMeetingContentSwiperCardFullScreenClass()}`}>
<div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-remote-camera'> <div className={`${styles.meetingContentSwiperCardVdeio}`} id='video-source-remote-camera'>
<div className={styles.meetingContentSwiperCardVdeioLoading}> <div className={styles.meetingContentSwiperCardVdeioLoading}>
<Avatar name={currentLookUserAccount.userName} /> <Avatar name={currentLookUserAccount.userName} />