Pass along mime type with TrackInfo (#292)
This commit is contained in:
+10
-4
@@ -306,14 +306,14 @@ func (c *RTCClient) Run() error {
|
||||
return err
|
||||
}
|
||||
case *livekit.SignalResponse_Update:
|
||||
participants := make(map[string]*livekit.ParticipantInfo)
|
||||
c.lock.Lock()
|
||||
for _, p := range msg.Update.Participants {
|
||||
if p.State != livekit.ParticipantInfo_DISCONNECTED {
|
||||
participants[p.Sid] = p
|
||||
c.remoteParticipants[p.Sid] = p
|
||||
} else {
|
||||
delete(c.remoteParticipants, p.Sid)
|
||||
}
|
||||
}
|
||||
c.lock.Lock()
|
||||
c.remoteParticipants = participants
|
||||
c.lock.Unlock()
|
||||
|
||||
case *livekit.SignalResponse_TrackPublished:
|
||||
@@ -389,6 +389,12 @@ func (c *RTCClient) RemoteParticipants() []*livekit.ParticipantInfo {
|
||||
return funk.Values(c.remoteParticipants).([]*livekit.ParticipantInfo)
|
||||
}
|
||||
|
||||
func (c *RTCClient) GetRemoteParticipant(sid string) *livekit.ParticipantInfo {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
return c.remoteParticipants[sid]
|
||||
}
|
||||
|
||||
func (c *RTCClient) Stop() {
|
||||
logger.Infow("stopping client", "ID", c.ID())
|
||||
_ = c.SendRequest(&livekit.SignalRequest{
|
||||
|
||||
Reference in New Issue
Block a user