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