停止分享

This commit is contained in:
yj 2024-08-09 15:28:48 +08:00
parent 6c91d35663
commit e688824be0
4 changed files with 49 additions and 12 deletions

View File

@ -276,7 +276,19 @@
} }
} }
@include meetingContent() @include meetingContent();
.meetingContentSwiperCardShare {
position: absolute;
left: 50%;
top: 50%;
z-index: 2;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.5);
color: white;
padding: 10px 20px;
white-space: nowrap;
}
} }
.meetingContentBodyRight { .meetingContentBodyRight {

View File

@ -819,7 +819,11 @@ const Meeting: React.FC = () => {
key={index} key={index}
onClick={() => { onClick={() => {
setCurrentVideoId(item.uid) setCurrentVideoId(item.uid)
renderVideo(item.uid) if (String(isShare) === item.screenShareId) {
renderVideo(item.screenShareId)
} else {
renderVideo(item.uid)
}
}} }}
> >
<div className={`${styles.meetingContentSwiperCardVdeio} ${currentVideoId === item.uid ? styles.active : ''}`} id={`video-${item.uid}`}> <div className={`${styles.meetingContentSwiperCardVdeio} ${currentVideoId === item.uid ? styles.active : ''}`} id={`video-${item.uid}`}>
@ -829,6 +833,9 @@ const Meeting: React.FC = () => {
</div> </div>
{meetingContentUser(item)} {meetingContentUser(item)}
{item.enableCamera ? null : meetingContentError(currentVideoId, item)} {item.enableCamera ? null : meetingContentError(currentVideoId, item)}
{String(isShare) === item.screenShareId ? <div className={styles.meetingContentSwiperCardShare}>
</div> : null}
</div> : null </div> : null
) )
} }
@ -1042,13 +1049,26 @@ const Meeting: React.FC = () => {
<Popover key={rowIndex} <Popover key={rowIndex}
content={ content={
<div className='meetingContentFooterPopover'> <div className='meetingContentFooterPopover'>
{user.roleId === '1' ? <div onClick={async () => { {user.roleId === '1' ?
await onInvoke('sendOper', { <Popconfirm
roomNum: state.channelId, title="提示"
type: 1, description={`结束会议后,所有人将退出,是否结束?`}
}) onConfirm={async () => {
leaveChannel(true) await onInvoke('sendOper', {
}}></div> : null} roomNum: state.channelId,
type: 1,
})
leaveChannel(true)
}}
onCancel={() => {
}}
okText="结束"
cancelText="取消"
>
<div></div>
</Popconfirm>
: null}
<div onClick={() => leaveChannel()}></div> <div onClick={() => leaveChannel()}></div>
<div onClick={() => { setOpen(false) }}></div> <div onClick={() => { setOpen(false) }}></div>
</div> </div>
@ -1111,7 +1131,7 @@ const Meeting: React.FC = () => {
}} style={{ backgroundColor: '#31353A', marginRight: '14px' }}></Button> }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}></Button>
{isShare ? <Popconfirm {isShare ? <Popconfirm
title="提示" title="提示"
description={`用户${isShareUser?.userName}正在屏幕,是否继续共享`} description={`这将停止[${isShareUser?.userName}]的共享,是否继续`}
open={isSharePopConfirm} open={isSharePopConfirm}
onConfirm={async () => { onConfirm={async () => {
setIsSharePopConfirm(false) setIsSharePopConfirm(false)

View File

@ -81,7 +81,7 @@ const agora = {
}, },
// 本地加入 // 本地加入
setupLocalVideo: async (item: any) => { setupLocalVideo: async (item: any) => {
if (item.view.childNodes.length === 1) { if (item.view?.childNodes.length === 1) {
await rtcEngine.setupLocalVideo({ await rtcEngine.setupLocalVideo({
renderMode: agora.getRrenderMode(item.uid), renderMode: agora.getRrenderMode(item.uid),
sourceType: item.sourceType, sourceType: item.sourceType,
@ -93,7 +93,7 @@ const agora = {
}, },
// 远端加入 // 远端加入
setupRemoteVideoJoin: async (item: any) => { setupRemoteVideoJoin: async (item: any) => {
if (item.view.childNodes.length === 1) { if (item.view?.childNodes.length === 1) {
await rtcEngine.setupRemoteVideo( await rtcEngine.setupRemoteVideo(
{ {
renderMode: agora.getRrenderMode(item.uid), renderMode: agora.getRrenderMode(item.uid),

View File

@ -47,6 +47,7 @@ export const onInvitation = (callBack: Function) => {
} }
export const onSignalr = (callBack: Function) => { export const onSignalr = (callBack: Function) => {
if (connection) { if (connection) {
// 聊天
connection.on("ReceiveMessage", (uid: string, userName: string, message: string) => { connection.on("ReceiveMessage", (uid: string, userName: string, message: string) => {
callBack({ callBack({
key: 'ReceiveMessage', key: 'ReceiveMessage',
@ -58,22 +59,26 @@ export const onSignalr = (callBack: Function) => {
key: 'RefreshUserList' key: 'RefreshUserList'
}) })
}); });
// 扩展操作
connection.on("Operation", (type: number) => { connection.on("Operation", (type: number) => {
callBack({ callBack({
key: 'Operation', key: 'Operation',
type type
}) })
}); });
// 全员离开房间
connection.on("ForceExitRoom", () => { connection.on("ForceExitRoom", () => {
callBack({ callBack({
key: 'ForceExitRoom', key: 'ForceExitRoom',
}) })
}); });
// 全员看他
connection.on("ShowUser", () => { connection.on("ShowUser", () => {
callBack({ callBack({
key: 'ShowUser', key: 'ShowUser',
}) })
}); });
// 更新视图模式
connection.on("RefreshView", (type: string) => { connection.on("RefreshView", (type: string) => {
callBack({ callBack({
key: 'RefreshView', key: 'RefreshView',