use synchronized GetParticipants to ensure eliminate timing issues upon participant join

This commit is contained in:
David Zhao
2021-01-31 23:06:48 -08:00
parent 014610bb05
commit 712d0da6cc
5 changed files with 12 additions and 21 deletions
+2 -2
View File
@@ -197,7 +197,7 @@ func (c *RTCClient) Run() error {
}
c.lock.Unlock()
logger.Debugw("join accepted, sending offer..", "participant", msg.Join.Participant.Sid)
logger.Debugw("join accepted, sending offer..", "participant", msg.Join.Participant.Identity)
c.localParticipant = msg.Join.Participant
logger.Debugw("other participants", "count", len(msg.Join.OtherParticipants))
@@ -247,7 +247,7 @@ func (c *RTCClient) Run() error {
c.lock.Lock()
for _, p := range msg.Update.Participants {
c.remoteParticipants[p.Sid] = p
logger.Debugw("participant update", "id", p.Sid, "state", p.State.String())
logger.Debugw("participant update", "id", p.Identity, "state", p.State.String())
}
c.lock.Unlock()
case *livekit.SignalResponse_TrackPublished: