Fix unsubscribed speakers stuck as speaking to clients (#1475)

When we unsubscribe from a speaker, SendSpeakerUpdates will drop updates
from that speaker. This has the side effect of dropping the "clearing"
message that we are sending as well.
This commit is contained in:
David Zhao
2023-02-26 23:56:09 -08:00
committed by GitHub
parent ade26f7c9e
commit 8c43b7b48f
5 changed files with 24 additions and 18 deletions
+3 -3
View File
@@ -305,7 +305,7 @@ func (r *Room) Join(participant types.LocalParticipant, opts *ParticipantOptions
Level: float32(level),
Active: active,
},
})
}, false)
}
update := &livekit.ConnectionQualityUpdate{}
@@ -320,7 +320,7 @@ func (r *Room) Join(participant types.LocalParticipant, opts *ParticipantOptions
Level: 0,
Active: false,
},
})
}, true)
}
})
@@ -911,7 +911,7 @@ func (r *Room) sendActiveSpeakers(speakers []*livekit.SpeakerInfo) {
func (r *Room) sendSpeakerChanges(speakers []*livekit.SpeakerInfo) {
for _, p := range r.GetParticipants() {
if p.ProtocolVersion().SupportsSpeakerChanged() {
_ = p.SendSpeakerUpdate(speakers)
_ = p.SendSpeakerUpdate(speakers, false)
}
}
}