Scoped speaker update (#280)

* Scoped speaker update

Include only participants a participant is subscribed to.

NOTE: Not doing this for active speaker changes for Protocol < 3.

* correct comment spelling
This commit is contained in:
Raja Subramanian
2021-12-23 09:13:49 +05:30
committed by GitHub
parent 857ff7fae7
commit 42a9b6657d
6 changed files with 106 additions and 19 deletions
+5 -5
View File
@@ -735,7 +735,7 @@ func (r *Room) connectionQualityWorker() {
connectionInfos := make(map[string]*livekit.ConnectionQualityInfo, len(participants))
for _, p := range participants {
connectionInfos[p.Identity()] = p.GetConnectionQuality()
connectionInfos[p.ID()] = p.GetConnectionQuality()
}
for _, op := range participants {
@@ -745,13 +745,13 @@ func (r *Room) connectionQualityWorker() {
update := &livekit.ConnectionQualityUpdate{}
// send to user itself
if info, ok := connectionInfos[op.Identity()]; ok {
if info, ok := connectionInfos[op.ID()]; ok {
update.Updates = append(update.Updates, info)
}
// send to other participants its subscribed to
for _, identity := range op.GetSubscribedParticipants() {
if info, ok := connectionInfos[identity]; ok {
// add connection quality of other participants its subscribed to
for _, sid := range op.GetSubscribedParticipants() {
if info, ok := connectionInfos[sid]; ok {
update.Updates = append(update.Updates, info)
}
}