From 5a977f1b7c0c16d9ab161ef58e743b01573757ff Mon Sep 17 00:00:00 2001 From: liqi Date: Tue, 16 Dec 2025 10:21:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E9=A1=B5=E4=B9=8B=E9=97=B4=E6=89=93?= =?UTF-8?q?=E7=94=B5=E8=AF=9D=E7=94=A8webrtc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useWebRTC.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/composables/useWebRTC.ts b/src/composables/useWebRTC.ts index ecfeffd..d029fd7 100644 --- a/src/composables/useWebRTC.ts +++ b/src/composables/useWebRTC.ts @@ -170,10 +170,10 @@ export function useWebRTC( // WebRTC 模式:创建 Offer(只有 useRTMP 为 false 时才使用 WebRTC) if (!useRTMP.value) { console.log('[WebRTC] WebRTC 模式:创建 Offer') - if (!pc) await createPC() - const offer = await pc!.createOffer() - await pc!.setLocalDescription(offer) - sendSignal('offer', offer) + if (!pc) await createPC() + const offer = await pc!.createOffer() + await pc!.setLocalDescription(offer) + sendSignal('offer', offer) } else { console.log('[WebRTC] RTMP 模式:等待 FLV 流') } @@ -531,7 +531,7 @@ export function useWebRTC( // RTMP 模式:加入房间后会自动开始 WebSocket 推流 } else { console.log('[WebRTC] 📡 使用 WebRTC 模式') - await createPC() + await createPC() } playRingtone('dialing') @@ -570,7 +570,7 @@ export function useWebRTC( await joinCallRoomAndGetFlvUrls() } else { console.log('[WebRTC] 📡 接听:使用 WebRTC 模式') - await createPC() + await createPC() } console.log('[WebRTC] 📤 发送 accepted 信令给:', currentReceiverUserId)