properly detect lowestVariant for system health (#2455)

This commit is contained in:
Meisam 2022-12-20 08:19:21 +01:00 committed by GitHub
parent 352d5cce64
commit 8f29acb7dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,7 +212,9 @@ const StreamHealth = () => {
const currentSpeed = bitrateChart[0]?.data[bitrateChart[0].data.length - 1]?.value;
const currentDownloadSeconds =
medianSegmentDownloadDurations[medianSegmentDownloadDurations.length - 1]?.value;
const lowestVariant = availableBitrates[0]; // TODO: get lowest bitrate from available bitrates
const lowestVariant = availableBitrates.reduce((bitrate1, bitrate2) =>
bitrate1.valueOf() < bitrate2.valueOf() ? bitrate1 : bitrate2,
);
const latencyMedian = medianLatency[medianLatency.length - 1]?.value || 0;
const latencyMax = highestLatency[highestLatency.length - 1]?.value || 0;