From 198e53bd42fff1086a38fc2d42254a7ee7f5598b Mon Sep 17 00:00:00 2001
From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Date: Mon, 1 Sep 2025 19:23:44 -0500
Subject: [PATCH] Fix stream stats display (#19874)
* Fix stats calculations and labels
* fix linter from complaining
* fix mse calc
* label
---
web/src/components/player/JSMpegPlayer.tsx | 2 +-
web/src/components/player/LivePlayer.tsx | 2 +-
web/src/components/player/MsePlayer.tsx | 4 ++--
web/src/components/player/PlayerStats.tsx | 4 ++--
web/src/components/player/WebRTCPlayer.tsx | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/web/src/components/player/JSMpegPlayer.tsx b/web/src/components/player/JSMpegPlayer.tsx
index 3753a9e46..f85535013 100644
--- a/web/src/components/player/JSMpegPlayer.tsx
+++ b/web/src/components/player/JSMpegPlayer.tsx
@@ -164,7 +164,7 @@ export default function JSMpegPlayer({
statsIntervalRef.current = setInterval(() => {
const currentTimestamp = Date.now();
const timeDiff = (currentTimestamp - lastTimestampRef.current) / 1000; // in seconds
- const bitrate = (bytesReceivedRef.current * 8) / timeDiff / 1000; // in kbps
+ const bitrate = bytesReceivedRef.current / timeDiff / 1000; // in kBps
setStats?.({
streamType: "jsmpeg",
diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx
index 3d8df2b34..d6f751499 100644
--- a/web/src/components/player/LivePlayer.tsx
+++ b/web/src/components/player/LivePlayer.tsx
@@ -80,7 +80,7 @@ export default function LivePlayer({
const [stats, setStats] = useState
{t("stats.bandwidth.title")}{" "} - {stats.bandwidth.toFixed(2)} kbps + {stats.bandwidth.toFixed(2)} kBps
{stats.latency != undefined && (@@ -66,7 +66,7 @@ export function PlayerStats({ stats, minimal }: PlayerStatsProps) {