mirror of https://github.com/jetkvm/kvm.git
fix: Handle error when writing new ICE candidate to WebRTC signaling channel
This commit is contained in:
parent
3c973ed272
commit
f17f15be57
|
@ -144,7 +144,10 @@ func newSession(config SessionConfig) (*Session, error) {
|
|||
peerConnection.OnICECandidate(func(candidate *webrtc.ICECandidate) {
|
||||
logger.Infof("Our WebRTC peerConnection has a new ICE candidate: %v", candidate)
|
||||
if candidate != nil {
|
||||
wsjson.Write(context.Background(), config.ws, gin.H{"type": "new-ice-candidate", "data": candidate.ToJSON()})
|
||||
err := wsjson.Write(context.Background(), config.ws, gin.H{"type": "new-ice-candidate", "data": candidate.ToJSON()})
|
||||
if err != nil {
|
||||
logger.Errorf("failed to write new-ice-candidate to WebRTC signaling channel: %v", err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue