兼容完成
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user