Beispiel #1
0
        /// <summary>
        /// Called when WebRTC detects another ICE candidate.
        /// This candidate needs to be sent to the other peer.
        /// </summary>
        /// <param name="evt">Details about RTC Peer Connection Ice event.</param>
        private void PeerConnection_OnIceCandidate(RTCPeerConnectionIceEvent evt)
        {
            if (evt.Candidate == null) // relevant: GlobalObserver::OnIceComplete in Org.WebRtc
            {
                return;
            }

            double index = null != evt.Candidate.SdpMLineIndex ? (double)evt.Candidate.SdpMLineIndex : -1;

            JsonObject json;

#if ORTCLIB
            if (RTCPeerConnectionSignalingMode.Json == _signalingMode)
            {
                json = JsonObject.Parse(evt.Candidate.ToJsonString());
            }
            else
#endif
            {
                json = new JsonObject
                {
                    { kCandidateSdpMidName, JsonValue.CreateStringValue(evt.Candidate.SdpMid) },
                    { kCandidateSdpMlineIndexName, JsonValue.CreateNumberValue(index) },
                    { kCandidateSdpName, JsonValue.CreateStringValue(evt.Candidate.Candidate) }
                };
            }
            Debug.WriteLine("Conductor: Sending ice candidate.\n" + json.Stringify());
            SendMessage(json);
        }
 async void OnLocalIceCandidateDeterminedAsync(RTCPeerConnectionIceEvent args)
 {
     // We send this to our connected peer immediately.
     if (this.signaller.IsConnected())
     {
         var jsonMessage = args.Candidate.ToJsonMessageString();
         await this.signaller.SendToPeerAsync(this.peerManager.PeerId, jsonMessage);
     }
 }
Beispiel #3
0
        private async void Conn_OnIceCandidateAsync(RTCPeerConnectionIceEvent __param0)
        {
            var Candidate = __param0.Candidate;
            var m         = new SendCadidatModel();

            m.candidate = new CandidateModel
            {
                candidate     = Candidate.Candidate,
                sdpMid        = Candidate.SdpMid,
                sdpMlineindex = Candidate.SdpMLineIndex
            };
            m.uid = Uid;
            Candidates.Add(m);
            await SendCandidate(m);

            //await SendCand(Candidate);
        }
Beispiel #4
0
 private void connection_OnIceCandidate(RTCPeerConnectionIceEvent ev)
 {
     this.iceCandidates.Add(ev.Candidate);
 }
Beispiel #5
0
 void OnLocalIceCandidateDetermined(RTCPeerConnectionIceEvent iceCandidate)
 {
     this.OnIceCandidate?.Invoke(iceCandidate);
 }
Beispiel #6
0
 private async void _localRtcPeerConnection_OnIceCandidate(RTCPeerConnectionIceEvent __param0)
 {
     Debug.WriteLine("Entered _localRtcPeerConnection_OnIceCandidate");
     await _peerConnection.AddIceCandidate(__param0.Candidate);
 }
Beispiel #7
0
 private void PeerConnection_OnIceCandidate(RTCPeerConnectionIceEvent iceEvent)
 {
     Logger.Log("On ice candidate triggered");
     this.IceCandidates.Add(iceEvent.Candidate);
 }