don't remove tracks if client is closed
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user