fix migrate state of subscribe only client (#366)
This commit is contained in:
@@ -1051,6 +1051,9 @@ func (p *ParticipantImpl) handleDataMessage(kind livekit.DataPacket_Kind, data [
|
|||||||
func (p *ParticipantImpl) handlePrimaryStateChange(state webrtc.PeerConnectionState) {
|
func (p *ParticipantImpl) handlePrimaryStateChange(state webrtc.PeerConnectionState) {
|
||||||
if state == webrtc.PeerConnectionStateConnected {
|
if state == webrtc.PeerConnectionStateConnected {
|
||||||
prometheus.ServiceOperationCounter.WithLabelValues("ice_connection", "success", "").Add(1)
|
prometheus.ServiceOperationCounter.WithLabelValues("ice_connection", "success", "").Add(1)
|
||||||
|
if !p.hasPendingMigratedTrack() && p.MigrateState() == types.MigrateStateSync {
|
||||||
|
p.SetMigrateState(types.MigrateStateComplete)
|
||||||
|
}
|
||||||
p.updateState(livekit.ParticipantInfo_ACTIVE)
|
p.updateState(livekit.ParticipantInfo_ACTIVE)
|
||||||
} else if state == webrtc.PeerConnectionStateFailed {
|
} else if state == webrtc.PeerConnectionStateFailed {
|
||||||
// only close when failed, to allow clients opportunity to reconnect
|
// only close when failed, to allow clients opportunity to reconnect
|
||||||
|
|||||||
Reference in New Issue
Block a user