Repository navigation
Include participant_sid in UpdateSubscription. - #279
Conversation
Prevents all publisher tracks to find a match.
| gopkg.in/square/go-jose.v2 v2.5.1 // indirect | ||
| ) | ||
|
|
||
| replace github.com/livekit/protocol => ../protocol |
There was a problem hiding this comment.
Will update once protocol is merged and versioned.
| return r.participants[identity] | ||
| } | ||
|
|
||
| func (r *Room) GetParticipantBySid(participantID string) types.Participant { |
There was a problem hiding this comment.
Sooner or later, looks like we will need a fast look up of participant in room by either identity or sid. So, maybe we need to maintain two maps.
There was a problem hiding this comment.
I think a identity to sid map makes a ton of sense. and keying off of sid internally.
| break | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
optimising this a bit by asking participant for specific track sid and breaking as soon as one is found.
| } | ||
|
|
||
| for _, pt := range participantTracks { | ||
| p := r.GetParticipantBySid(pt.ParticipantSid) |
There was a problem hiding this comment.
This is where we need look up room by participant sid.
| for _, trackSid := range pt.TrackSids { | ||
| track := p.GetPublishedTrack(trackSid) | ||
| if track != nil { | ||
| tracks[trackSid] = track |
There was a problem hiding this comment.
Layering the new field on top and keep building the tracks list.
This is one of the reasons I chose to do the permissions stuff at track level as this is calling AddSubscriber directly on the track. The publishing participant does not have any information about who are all subscribed to its tracks.
| return r.participants[identity] | ||
| } | ||
|
|
||
| func (r *Room) GetParticipantBySid(participantID string) types.Participant { |
There was a problem hiding this comment.
I think a identity to sid map makes a ton of sense. and keying off of sid internally.
* Include `participant_sid` in `UpdateSubscription`. Prevents all publisher tracks to find a match. * generate * Update protocol version
Prevents all publisher tracks to find a match.