Expose Participant.IsPublisher to differentiate pubs from subs (#643)
This commit is contained in:
@@ -314,10 +314,12 @@ func (c *RTCClient) Run() error {
|
||||
case *livekit.SignalResponse_Update:
|
||||
c.lock.Lock()
|
||||
for _, p := range msg.Update.Participants {
|
||||
if p.State != livekit.ParticipantInfo_DISCONNECTED {
|
||||
c.remoteParticipants[livekit.ParticipantID(p.Sid)] = p
|
||||
} else {
|
||||
delete(c.remoteParticipants, livekit.ParticipantID(p.Sid))
|
||||
if livekit.ParticipantID(p.Sid) != c.id {
|
||||
if p.State != livekit.ParticipantInfo_DISCONNECTED {
|
||||
c.remoteParticipants[livekit.ParticipantID(p.Sid)] = p
|
||||
} else {
|
||||
delete(c.remoteParticipants, livekit.ParticipantID(p.Sid))
|
||||
}
|
||||
}
|
||||
}
|
||||
c.lock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user