Clear webrtc resources on failed connection

This commit is contained in:
Alexey Khit
2022-08-27 15:57:47 +03:00
parent a006394e5f
commit 38a18cab62
2 changed files with 20 additions and 5 deletions
+2 -2
View File
@@ -151,8 +151,8 @@ func ExchangeSDP(
conn.UserAgent = userAgent
conn.Listen(func(msg interface{}) {
switch msg := msg.(type) {
case streamer.EventType:
if msg == streamer.StateNull {
case pion.PeerConnectionState:
if msg == pion.PeerConnectionStateClosed{
stream.RemoveConsumer(conn)
}
}