don't remove tracks if client is closed

This commit is contained in:
David Zhao committed 2020-12-03 23:22:59 -08:00
1 parent 04dcdc3772
commit 64b427a388
1 file changed
+3
+3
View File
@@ -78,6 +78,9 @@ func (t *Track) AddSubscriber(participant *Participant) error {
delete(t.forwarders, participant.ID())
t.lock.Unlock()
if participant.peerConn.ConnectionState() == webrtc.PeerConnectionStateClosed {
return
}
if err := participant.peerConn.RemoveTrack(rtpSender); err != nil {
logger.GetLogger().Warnw("could not remove mediaTrack from forwarder",
"participant", participant.ID(),