From 6a99146c21136b5d0b056e93890c61483d9ade84 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Fri, 14 May 2021 22:50:45 -0700 Subject: [PATCH] skip ICE restart if subscriber not connected --- pkg/rtc/participant.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 59b3c98f..3092fb95 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -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, })