diff --git a/pkg/sfu/peer.go b/pkg/sfu/peer.go index b5c1b3528..4d6798b7e 100644 --- a/pkg/sfu/peer.go +++ b/pkg/sfu/peer.go @@ -104,7 +104,7 @@ func (p *Peer) Join(sid string, sdp webrtc.SessionDescription) (*webrtc.SessionD }) p.subscriber.OnICECandidate(func(c *webrtc.ICECandidate) { - log.Debugf("on ice candidate called") + log.Debugf("on subscriber ice candidate called for peer " + p.id) if c == nil { return } @@ -116,7 +116,7 @@ func (p *Peer) Join(sid string, sdp webrtc.SessionDescription) (*webrtc.SessionD }) p.publisher.OnICECandidate(func(c *webrtc.ICECandidate) { - log.Debugf("on ice candidate called") + log.Debugf("on publisher ice candidate called for peer " + p.id) if c == nil { return } diff --git a/pkg/sfu/publisher.go b/pkg/sfu/publisher.go index 19ceed849..9267cd778 100644 --- a/pkg/sfu/publisher.go +++ b/pkg/sfu/publisher.go @@ -84,7 +84,9 @@ func (p *Publisher) Answer(offer webrtc.SessionDescription) (webrtc.SessionDescr } for _, c := range p.candidates { - p.pc.AddICECandidate(c) + if err := p.pc.AddICECandidate(c); err != nil { + log.Errorf("Add publisher ice candidate to peer %s err: %v", p.id, err) + } } p.candidates = nil diff --git a/pkg/sfu/subscriber.go b/pkg/sfu/subscriber.go index 130f00806..06d46c402 100644 --- a/pkg/sfu/subscriber.go +++ b/pkg/sfu/subscriber.go @@ -153,7 +153,9 @@ func (s *Subscriber) SetRemoteDescription(desc webrtc.SessionDescription) error } for _, c := range s.candidates { - s.pc.AddICECandidate(c) + if err := s.pc.AddICECandidate(c); err != nil { + log.Errorf("Add subscriber ice candidate to peer %s err: %v", s.id, err) + } } s.candidates = nil