修复了点击联系人信息发送消息的时候房间id绑定问题
This commit is contained in:
@@ -392,6 +392,11 @@ export function useWebRTC(userId: string, onIncomingCall?: (senderUserId: string
|
||||
call.status = 'connected'
|
||||
call.statusText = '通话中'
|
||||
startCallTimer()
|
||||
// 确保 pc 已创建
|
||||
if (!pc) {
|
||||
await initMedia(call.type === 'video')
|
||||
await createPC()
|
||||
}
|
||||
const offer = await pc!.createOffer()
|
||||
await pc!.setLocalDescription(offer)
|
||||
sendSignal('offer', offer)
|
||||
@@ -412,6 +417,11 @@ export function useWebRTC(userId: string, onIncomingCall?: (senderUserId: string
|
||||
startCallTimer()
|
||||
|
||||
} else if (signal === 'answer') {
|
||||
// 确保 pc 已创建
|
||||
if (!pc) {
|
||||
await initMedia(call.type === 'video')
|
||||
await createPC()
|
||||
}
|
||||
await pc!.setRemoteDescription(content)
|
||||
processPendingCandidates()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user