terminate RTC sessions properly

This commit is contained in:
David Zhao
2021-01-19 16:18:03 -08:00
parent 71b4673a0a
commit 0b00b26d05
10 changed files with 254 additions and 174 deletions
+3
View File
@@ -80,6 +80,9 @@ func (r *Room) Join(participant types.Participant) error {
}
// start the workers once connectivity is established
p.Start()
} else if p.State() == livekit.ParticipantInfo_DISCONNECTED {
// remove participant from room
go r.RemoveParticipant(p.ID())
}
})
participant.OnTrackUpdated(r.onTrackUpdated)