More abstractions (#316)

This commit is contained in:
Raja Subramanian
2022-01-07 01:46:15 +05:30
committed by GitHub
parent dd612f966d
commit ecf9590d56
12 changed files with 326 additions and 143 deletions
+9 -3
View File
@@ -392,6 +392,10 @@ func (r *Room) RemoveDisallowedSubscriptions(sub types.Participant, disallowedSu
}
}
func (r *Room) UpdateVideoLayers(participant types.Participant, updateVideoLayers *livekit.UpdateVideoLayers) error {
return participant.UpdateVideoLayers(updateVideoLayers)
}
func (r *Room) IsClosed() bool {
select {
case <-r.closed:
@@ -607,14 +611,16 @@ func (r *Room) subscribeToExistingTracks(p types.Participant) {
// don't send to itself
continue
}
if n, err := op.AddSubscriber(p, types.AddSubscriberParams{AllTracks: true}); err != nil {
// subscribe to all
n, err := op.AddSubscriber(p, types.AddSubscriberParams{AllTracks: true})
if err != nil {
// TODO: log error? or disconnect?
r.Logger.Errorw("could not subscribe to participant", err,
"participants", []livekit.ParticipantIdentity{op.Identity(), p.Identity()},
"pIDs", []livekit.ParticipantID{op.ID(), p.ID()})
} else {
tracksAdded += n
}
tracksAdded += n
}
if tracksAdded > 0 {
r.Logger.Debugw("subscribed participants to existing tracks", "tracks", tracksAdded)