This commit is contained in:
yj 2024-07-19 17:26:09 +08:00
parent 253b336d69
commit dd08b158e4
1 changed files with 10 additions and 12 deletions

View File

@ -39,20 +39,18 @@ const agora = {
storage.setItem('isRemotJoin', true)
},
// 监听用户离开频道事件
onUserOffline: (info: any, remoteUid: any, reason: any) => {
onUserOffline: async (info: any, remoteUid: any, reason: any) => {
// 远端用户离开频道后,关闭远端视频窗口
console.log(info, remoteUid, reason, document.getElementById(`video-${remoteUid}`));
await rtcEngine.setupRemoteVideo(
{
renderMode: RenderModeType.RenderModeFit,
sourceType: VideoSourceType.VideoSourceRemote,
uid: Number(info.localUid),
view: document.getElementById(`video-${remoteUid}`),
setupMode: VideoViewSetupMode.VideoViewSetupRemove,
},
);
storage.setItem('isRemotJoin', false)
// rtcEngine.setupRemoteVideo(
// {
// renderMode: RenderModeType.RenderModeFit,
// sourceType: VideoSourceType.VideoSourceRemote,
// uid: Number(info.localUid),
// view: document.getElementById(`video-${remoteUid}`),
// setupMode: VideoViewSetupMode.VideoViewSetupRemove,
// },
// );
},
// 视频发布状态改变回调
onVideoPublishStateChanged: (source: any, channel: any, oldState: any, newState: any, elapseSinceLastState: any) => {