use full candidateInit, update encoding

This commit is contained in:
David Zhao committed 2020-12-03 21:58:25 -08:00
1 parent bca8090b41
commit c64ecc4603
7 files changed
+59 -52

No files matched your search

+3 -3
View File
@@ -182,7 +182,7 @@ func (c *RTCClient) Run() error {
}
switch msg := res.Message.(type) {
case *livekit.SignalResponse_Join:
c.AppendLog("join accepted, sending offer..")
c.AppendLog("join accepted, sending offer..", "participant", msg.Join.Participant.Id)
c.localParticipant = msg.Join.Participant
c.AppendLog("other participants", "count", len(msg.Join.OtherParticipants))
@@ -238,7 +238,7 @@ func (c *RTCClient) Run() error {
case *livekit.SignalResponse_Trickle:
candidateInit := rtc.FromProtoTrickle(msg.Trickle)
c.AppendLog("adding remote candidate", "candidate", candidateInit.Candidate)
if err := c.PeerConn.AddICECandidate(*candidateInit); err != nil {
if err := c.PeerConn.AddICECandidate(candidateInit); err != nil {
return err
}
case *livekit.SignalResponse_Update:
@@ -318,7 +318,7 @@ func (c *RTCClient) SendIceCandidate(ic *webrtc.ICECandidate) error {
c.AppendLog("sending trickle candidate", "candidate", candInit.Candidate)
return c.SendRequest(&livekit.SignalRequest{
Message: &livekit.SignalRequest_Trickle{
Trickle: rtc.ToProtoTrickle(&candInit),
Trickle: rtc.ToProtoTrickle(candInit),
},
})
}