订阅者增加监听PeerConnectionStateClosed事件

This commit is contained in:
pggiroro
2024-02-20 16:50:59 +08:00
parent 467b55cfec
commit 7cc8b07ca3

View File

@@ -235,7 +235,7 @@ func (suber *WebRTCSubscriber) OnEvent(event any) {
suber.PeerConnection.Close() suber.PeerConnection.Close()
}() }()
} }
case PeerConnectionStateDisconnected, PeerConnectionStateFailed: case PeerConnectionStateDisconnected, PeerConnectionStateFailed, PeerConnectionStateClosed:
suber.Stop(zap.String("reason", pcs.String())) suber.Stop(zap.String("reason", pcs.String()))
} }
}) })