Esempio n. 1
0
        /// <summary>
        /// Called when WebRTC detects another ICE candidate.
        /// This candidate needs to be sent to the other peer.
        /// </summary>
        /// <param name="Event">Details about RTCPeerConnectionIceEvent</param>
        private void PeerConnection_OnIceCandidate(IRTCPeerConnectionIceEvent Event)
        {
            if (Event.Candidate == null)
            {
                return;
            }

            double index = (double)Event.Candidate.SdpMLineIndex;

            JsonObject json = null;

            json = new JsonObject
            {
                { NegotiationAtributes.SdpMid, JsonValue.CreateStringValue(Event.Candidate.SdpMid) },
                { NegotiationAtributes.SdpMLineIndex, JsonValue.CreateNumberValue(index) },
                { NegotiationAtributes.Candidate, JsonValue.CreateStringValue(Event.Candidate.Candidate) }
            };

            Debug.WriteLine($"Send ice candidate:\n{json.Stringify()}");

            OnSendMessageToRemotePeer.Invoke(this, json.Stringify());
        }
Esempio n. 2
0
 private async void peerConnection_OnIceCandidate(IRTCPeerConnectionIceEvent ev)
 {
     await this.signaller.SendIceCandidate((RTCIceCandidate)ev.Candidate);
 }
Esempio n. 3
0
        void Conn_OnIceCandidate(IRTCPeerConnectionIceEvent evt)
        {
            Logger.Debug("PeerChannel", $"OnIceCandidate");

            OnIceCandidate?.Invoke(evt.Candidate.Candidate);
        }