Исправление форвардинга RTP
This commit is contained in:
@@ -92,6 +92,13 @@ func BindPeerLifecycle(roomID, peerID string, pc *webrtc.PeerConnection) {
|
||||
timer *time.Timer
|
||||
)
|
||||
|
||||
room, exists := GetRoom(roomID)
|
||||
if !exists {
|
||||
logger.LogWarnMessage("BindPeerLifecycle: tried to bind non existing room " + roomID)
|
||||
return
|
||||
}
|
||||
server := room.Server
|
||||
|
||||
startTimer := func() {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
@@ -109,7 +116,7 @@ func BindPeerLifecycle(roomID, peerID string, pc *webrtc.PeerConnection) {
|
||||
}
|
||||
_ = LeaveRoom(roomID, peerID)
|
||||
if OnPeerDisconnected != nil {
|
||||
OnPeerDisconnected(roomID, peerID)
|
||||
OnPeerDisconnected(roomID, peerID, server)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -134,7 +141,7 @@ func BindPeerLifecycle(roomID, peerID string, pc *webrtc.PeerConnection) {
|
||||
cancelTimer()
|
||||
_ = LeaveRoom(roomID, peerID)
|
||||
if OnPeerDisconnected != nil {
|
||||
OnPeerDisconnected(roomID, peerID)
|
||||
OnPeerDisconnected(roomID, peerID, server)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -149,7 +156,7 @@ func BindPeerLifecycle(roomID, peerID string, pc *webrtc.PeerConnection) {
|
||||
cancelTimer()
|
||||
_ = LeaveRoom(roomID, peerID)
|
||||
if OnPeerDisconnected != nil {
|
||||
OnPeerDisconnected(roomID, peerID)
|
||||
OnPeerDisconnected(roomID, peerID, server)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user