Skip to content

Commit

Permalink
fix(ice): add buffered candidates (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev authored Nov 24, 2020
1 parent 6e511c3 commit cd896a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ func (p *Publisher) Answer(offer webrtc.SessionDescription) (webrtc.SessionDescr
if err := p.pc.SetRemoteDescription(offer); err != nil {
return webrtc.SessionDescription{}, err
}

for _, c := range p.candidates {
p.pc.AddICECandidate(c)
p.candidates = nil
}

answer, err := p.pc.CreateAnswer(nil)
if err != nil {
return webrtc.SessionDescription{}, err
Expand Down
6 changes: 6 additions & 0 deletions pkg/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ func (s *Subscriber) SetRemoteDescription(desc webrtc.SessionDescription) error
log.Errorf("SetRemoteDescription error: %v", err)
return err
}

for _, c := range s.candidates {
s.pc.AddICECandidate(c)
s.candidates = nil
}

return nil
}

Expand Down

0 comments on commit cd896a6

Please sign in to comment.