This commit is contained in:
yj 2024-07-22 10:54:50 +08:00
parent 8ccf1a02d8
commit 49a01c1af8
1 changed files with 4 additions and 1 deletions

View File

@ -124,6 +124,7 @@ const Meeting: React.FC = () => {
agora.init() agora.init()
agora.registerEventHandler({ agora.registerEventHandler({
onJoinChannelSuccess: async (info: any, _elapsed: any) => { onJoinChannelSuccess: async (info: any, _elapsed: any) => {
console.log(info.localUid, '加入');
await onInvoke('joinChannel', { await onInvoke('joinChannel', {
roomNum: info.channelId, roomNum: info.channelId,
enableMicr: true, enableMicr: true,
@ -139,6 +140,7 @@ const Meeting: React.FC = () => {
}, 1000); }, 1000);
}, },
onUserJoined: async (info: any, remoteUid: any, _elapsed: any) => { onUserJoined: async (info: any, remoteUid: any, _elapsed: any) => {
console.log(remoteUid, '远端');
await getRoomUser() await getRoomUser()
setTimeout(() => { setTimeout(() => {
agora.setupRemoteVideoJoin({ agora.setupRemoteVideoJoin({
@ -149,6 +151,7 @@ const Meeting: React.FC = () => {
}, 1000); }, 1000);
}, },
onUserOffline: async (info: any, remoteUid: any, reason: any) => { onUserOffline: async (info: any, remoteUid: any, reason: any) => {
console.log(remoteUid, "离开");
await onInvoke('levelChannel', { await onInvoke('levelChannel', {
roomNum: info.channelId roomNum: info.channelId
}) })
@ -159,7 +162,7 @@ const Meeting: React.FC = () => {
}) })
setTimeout(() => { setTimeout(() => {
getRoomUser() getRoomUser()
}, 2000); }, 3000);
} }
}) })
agora.setCameraCapture(VideoSourceType.VideoSourceCameraPrimary) agora.setCameraCapture(VideoSourceType.VideoSourceCameraPrimary)