fix migrate state of subscribe only client (#366)

This commit is contained in:
cnderrauber
2022-01-24 17:03:24 +08:00
committed by GitHub
parent 52fc53d325
commit 90b97137c9
+3
View File
@@ -1051,6 +1051,9 @@ func (p *ParticipantImpl) handleDataMessage(kind livekit.DataPacket_Kind, data [
func (p *ParticipantImpl) handlePrimaryStateChange(state webrtc.PeerConnectionState) {
if state == webrtc.PeerConnectionStateConnected {
prometheus.ServiceOperationCounter.WithLabelValues("ice_connection", "success", "").Add(1)
if !p.hasPendingMigratedTrack() && p.MigrateState() == types.MigrateStateSync {
p.SetMigrateState(types.MigrateStateComplete)
}
p.updateState(livekit.ParticipantInfo_ACTIVE)
} else if state == webrtc.PeerConnectionStateFailed {
// only close when failed, to allow clients opportunity to reconnect