skip ICE restart if subscriber not connected

This commit is contained in:
David Zhao
2021-05-14 22:50:45 -07:00
parent 3a302e2b09
commit 6a99146c21
+4
View File
@@ -406,6 +406,10 @@ func (p *ParticipantImpl) Negotiate() {
// ICERestart restarts subscriber ICE connections
func (p *ParticipantImpl) ICERestart() error {
if p.subscriber.pc.RemoteDescription() == nil {
// not connected, skip
return nil
}
return p.subscriber.CreateAndSendOffer(&webrtc.OfferOptions{
ICERestart: true,
})