Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log ICE candidates as debug #389

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,27 @@ func (e *RTCEngine) configure(res *livekit.JoinResponse) error {
// done
return
}
if err := e.client.SendICECandidate(candidate.ToJSON(), livekit.SignalTarget_PUBLISHER); err != nil {
init := candidate.ToJSON()
logger.Debugw("local ICE candidate",
"target", livekit.SignalTarget_PUBLISHER,
"candidate", init.Candidate,
)
if err := e.client.SendICECandidate(init, livekit.SignalTarget_PUBLISHER); err != nil {
logger.Errorw("could not send ICE candidates for publisher", err)
}

})
e.subscriber.pc.OnICECandidate(func(candidate *webrtc.ICECandidate) {
if candidate == nil {
// done
return
}
if err := e.client.SendICECandidate(candidate.ToJSON(), livekit.SignalTarget_SUBSCRIBER); err != nil {
init := candidate.ToJSON()
logger.Debugw("local ICE candidate",
"target", livekit.SignalTarget_SUBSCRIBER,
"candidate", init.Candidate,
)
if err := e.client.SendICECandidate(init, livekit.SignalTarget_SUBSCRIBER); err != nil {
logger.Errorw("could not send ICE candidates for subscriber", err)
}
})
Expand Down Expand Up @@ -301,6 +312,10 @@ func (e *RTCEngine) configure(res *livekit.JoinResponse) error {
}
e.client.OnTrickle = func(init webrtc.ICECandidateInit, target livekit.SignalTarget) {
var err error
logger.Debugw("remote ICE candidate",
"target", target,
"candidate", init.Candidate,
)
if target == livekit.SignalTarget_PUBLISHER {
err = e.publisher.AddICECandidate(init)
} else if target == livekit.SignalTarget_SUBSCRIBER {
Expand Down
Loading