static void PCOnIceCandidate(IntPtr ptr, string sdp, string sdpMid, int sdpMlineIndex)
 {
     WebRTC.Sync(ptr, () =>
     {
         if (WebRTC.Table[ptr] is RTCPeerConnection connection)
         {
             var options = new RTCIceCandidateInit
             {
                 candidate     = sdp,
                 sdpMid        = sdpMid,
                 sdpMLineIndex = sdpMlineIndex
             };
             var candidate = new RTCIceCandidate(options);
             connection.OnIceCandidate?.Invoke(candidate);
         }
     });
 }
Example #2
0
 public static extern bool PeerConnectionAddIceCandidate(IntPtr ptr, ref RTCIceCandidate candidate);
 /// <summary>
 ///
 /// </summary>
 /// <param name="candidate"></param>
 public bool AddIceCandidate(RTCIceCandidate candidate)
 {
     return(NativeMethods.PeerConnectionAddIceCandidate(
                GetSelfOrThrow(), candidate.self));
 }