This commit is contained in:
parent
084aed3303
commit
e531e71f4f
|
|
@ -262,11 +262,6 @@ const Meeting: React.FC = () => {
|
|||
if (res.code === 200) {
|
||||
setRoomUserList(res.data)
|
||||
callBack(res.data)
|
||||
// setTimeout(() => {
|
||||
// res.data.forEach((item: any) => {
|
||||
// agora.setVideo(Number(item.account), document.getElementById(`video-${item.account}`), state.channelId)
|
||||
// })
|
||||
// }, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,54 +67,56 @@ const agora = {
|
|||
// 渲染视频
|
||||
setVideo: (item: any) => {
|
||||
console.log(item);
|
||||
if (typeof item.isRemotJoin === 'boolean') {
|
||||
if (item.isRemotJoin) {
|
||||
// 远端加入
|
||||
rtcEngine.setupRemoteVideo(
|
||||
{
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
sourceType: VideoSourceType.VideoSourceRemote,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupAdd,
|
||||
},
|
||||
{ channelId: item.channelId },
|
||||
);
|
||||
} else {
|
||||
// 远端退出
|
||||
rtcEngine.setupRemoteVideo(
|
||||
{
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
sourceType: VideoSourceType.VideoSourceRemote,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupRemove,
|
||||
},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (option.userid === item.account) {
|
||||
// 本地加入
|
||||
rtcEngine.setupLocalVideo({
|
||||
// 本地加入
|
||||
function setupLocalVideo() {
|
||||
rtcEngine.setupLocalVideo({
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
// sourceType: VideoSourceType.VideoSourceScreen,
|
||||
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupAdd,
|
||||
});
|
||||
}
|
||||
// 远端加入
|
||||
function setupRemoteVideoJoin() {
|
||||
rtcEngine.setupRemoteVideo(
|
||||
{
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
// sourceType: VideoSourceType.VideoSourceScreen,
|
||||
sourceType: VideoSourceType.VideoSourceCameraPrimary,
|
||||
sourceType: VideoSourceType.VideoSourceRemote,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupAdd,
|
||||
});
|
||||
},
|
||||
{ channelId: item.channelId },
|
||||
);
|
||||
}
|
||||
// 远端退出
|
||||
function setupRemoteVideoLeave() {
|
||||
rtcEngine.setupRemoteVideo(
|
||||
{
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
sourceType: VideoSourceType.VideoSourceRemote,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupRemove,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof item.isRemotJoin === 'boolean') {
|
||||
if (option.userid != item.account) {
|
||||
if (item.isRemotJoin) {
|
||||
setupRemoteVideoJoin()
|
||||
} else {
|
||||
setupRemoteVideoLeave()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (option.userid === item.account) {
|
||||
setupLocalVideo()
|
||||
} else {
|
||||
// 远端加入
|
||||
rtcEngine.setupRemoteVideo(
|
||||
{
|
||||
renderMode: RenderModeType.RenderModeFit,
|
||||
sourceType: VideoSourceType.VideoSourceRemote,
|
||||
uid: item.account,
|
||||
view: item.view,
|
||||
setupMode: VideoViewSetupMode.VideoViewSetupAdd,
|
||||
},
|
||||
{ channelId: item.channelId },
|
||||
);
|
||||
setupRemoteVideoJoin()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue