Do not send connection quality when participant is not active.
* Do not send connection quality when participant is not active.
Some times when the connection takes a while (in a long delay network
on Safari for example), connection quality arrives before connectivity.
* Do not calculate connection quality of unconnected participants
@@ -831,11 +831,15 @@ func (r *Room) connectionQualityWorker() {
connectionInfos := make(map[livekit.ParticipantID]*livekit.ConnectionQualityInfo, len(participants))
for _, p := range participants {
+ if p.State() != livekit.ParticipantInfo_ACTIVE {
+ continue
+ }
+
connectionInfos[p.ID()] = p.GetConnectionQuality()
}
for _, op := range participants {
- if !op.ProtocolVersion().SupportsConnectionQuality() {
+ if !op.ProtocolVersion().SupportsConnectionQuality() || op.State() != livekit.ParticipantInfo_ACTIVE {
continue
}
update := &livekit.ConnectionQualityUpdate{}
