correctly send participant updates

This commit is contained in:
David Zhao
2020-12-02 00:53:16 -08:00
parent a6c4db2cb3
commit bca8090b41
4 changed files with 20 additions and 9 deletions

View File

@@ -184,6 +184,7 @@ func (c *RTCClient) Run() error {
case *livekit.SignalResponse_Join:
c.AppendLog("join accepted, sending offer..")
c.localParticipant = msg.Join.Participant
c.AppendLog("other participants", "count", len(msg.Join.OtherParticipants))
// Create an offer to send to the other process
offer, err := c.PeerConn.CreateOffer(nil)
@@ -240,6 +241,10 @@ func (c *RTCClient) Run() error {
if err := c.PeerConn.AddICECandidate(*candidateInit); err != nil {
return err
}
case *livekit.SignalResponse_Update:
for _, p := range msg.Update.Participants {
c.AppendLog("participant update", "id", p.Id, "state", p.State.String())
}
}
}