Delegate DelegateOnNegotiationNeeded
Delegate to be called when negotiation of the connection through the signaling channel is required.
Namespace: Unity.WebRTC
Assembly: Unity.WebRTC.dll
Syntax
public delegate void DelegateOnNegotiationNeeded()
Remarks
This delegate is called when negotiation of the connection through the signaling channel is required.
Examples
peerConnection.OnNegotiationNeeded = () =>
{
StartCoroutine(NegotiationProcess());
}
IEnumerator NegotiationProcess()
{
RTCSessionDescriptionAsyncOperation asyncOperation = peerConnection.CreateOffer();
yield return asyncOperation;
if (!asyncOperation.IsError)
{
RTCSessionDescription description = asyncOperation.Desc;
RTCSetSessionDescriptionAsyncOperation asyncOperation = peerConnection.SetLocalDescription(ref description);
yield return asyncOperation;
}
}