/// <summary>
        /// Receives the ice candidate from other users in call
        /// </summary>
        /// <returns>The ice candidate.</returns>
        /// <param name="iceCandidates">Ice candidates.</param>
        /// <param name="caller">Caller.</param>
        public void ReceiveIceCandidate(Collection <IceCandidate> iceCandidates, string peerId)
        {
            foreach (var iceCandidate in iceCandidates)
            {
                var candidate = new Candidate();
                candidate.SdpCandidateAttribute = iceCandidate.Candidate;
                candidate.SdpMediaIndex         = iceCandidate.SdpMLineIndex != null?int.Parse(iceCandidate.SdpMLineIndex) : 0;

                conference.ReceiveCandidate(candidate, peerId);
            }
        }
Ejemplo n.º 2
0
        private void ReceiveOfferAnswerOrCandidate(NotifyReceiveArgs e)
        {
            var peerId    = e.NotifyingClient.ClientId.ToString();
            var peerState = e.NotifyingClient.BoundRecords;

            if (e.Tag == "offeranswer:" + SessionId)
            {
                Conference.ReceiveOfferAnswer(OfferAnswer.FromJson(e.DataJson), peerId, peerState);
            }
            else if (e.Tag == "candidate:" + SessionId)
            {
                Conference.ReceiveCandidate(Candidate.FromJson(e.DataJson), peerId);
            }
        }