Only send connection quality updates for protocol 5+

This commit is contained in:
David Zhao
2021-11-03 23:09:25 -07:00
parent aa9534b7fb
commit 6a80beedfc
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -722,6 +722,9 @@ func (r *Room) connectionQualityWorker() {
}
for _, op := range participants {
if !op.ProtocolVersion().SupportsConnectionQuality() {
continue
}
update := &livekit.ConnectionQualityUpdate{}
// send to user itself
+5
View File
@@ -30,3 +30,8 @@ func (v ProtocolVersion) SupportsSpeakerChanged() bool {
func (v ProtocolVersion) SupportsTransceiverReuse() bool {
return v > 3
}
// SupportsConnectionQuality - avoid sending frequent ConnectionQuality updates for lower protocol versions
func (v ProtocolVersion) SupportsConnectionQuality() bool {
return v > 4
}