兼容完成

This commit is contained in:
2026-04-30 15:35:47 +08:00
parent 231021d318
commit 2792916807
152 changed files with 5894 additions and 67947 deletions

View File

@@ -453,8 +453,17 @@ namespace Unity.RenderStreaming
pc = CreatePeerConnection(connectionId, e.polite);
}
// 先触发 onGotOffer让 Handler 在 SetRemoteDescription 之前添加 transceiver
// 这样 transceiver 会在 offer 的媒体行内正确匹配
onGotOffer?.Invoke(connectionId, e.sdp);
// 然后设置远程描述,完成后自动 SendAnswer
RTCSessionDescription description = new RTCSessionDescription { type = RTCSdpType.Offer, sdp = e.sdp };
_startCoroutine(pc.OnGotDescription(description, () => onGotOffer?.Invoke(connectionId, e.sdp)));
_startCoroutine(pc.OnGotDescription(description, () =>
{
// SetRemoteDescription 成功后,自动创建并发送 answer
pc.SendAnswer();
}));
}
void OnParticipantJoinedHandler(ISignaling signaling, ParticipantEventData e)