disconnect participant when ICE connection fails
This commit is contained in:
@@ -722,11 +722,12 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) handlePublisherICEStateChange(state webrtc.ICEConnectionState) {
|
func (p *ParticipantImpl) handlePublisherICEStateChange(state webrtc.ICEConnectionState) {
|
||||||
//logger.Debugw("ICE connection state changed", "state", state.String())
|
//logger.Debugw("ICE connection state changed", "state", state.String(),
|
||||||
|
// "participant", p.identity)
|
||||||
if state == webrtc.ICEConnectionStateConnected {
|
if state == webrtc.ICEConnectionStateConnected {
|
||||||
p.connectedAt.Store(time.Now())
|
p.connectedAt.Store(time.Now())
|
||||||
p.updateState(livekit.ParticipantInfo_ACTIVE)
|
p.updateState(livekit.ParticipantInfo_ACTIVE)
|
||||||
} else if state == webrtc.ICEConnectionStateDisconnected {
|
} else if state == webrtc.ICEConnectionStateDisconnected || state == webrtc.ICEConnectionStateFailed {
|
||||||
go p.Close()
|
go p.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user