skip track updates when client has disconnected

This commit is contained in:
David Zhao
2021-01-29 01:03:20 -08:00
parent 421664c279
commit 65078f5ef8
+2 -1
View File
@@ -562,7 +562,8 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) {
p.lock.Lock()
delete(p.publishedTracks, track.ID())
p.lock.Unlock()
if p.onTrackUpdated != nil {
// only send this when client is in a ready state
if p.IsReady() && p.onTrackUpdated != nil {
p.onTrackUpdated(p, track)
}
})