Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

properly detect lowestVariant for system health (#2455)

Meisamf779a1742cc0
diff --git a/web/pages/admin/stream-health.tsx b/web/pages/admin/stream-health.tsx
index 5850ed0034..1a826e26f7 100644
--- a/web/pages/admin/stream-health.tsx
+++ b/web/pages/admin/stream-health.tsx
@@ -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;