Skip to content

NVR with realtime local object detection for IP cameras

Ensure we use the stream name from local storage on mobile (#17452)

Josh Hawkins2c1ded37a172
diff --git a/web/src/views/live/LiveDashboardView.tsx b/web/src/views/live/LiveDashboardView.tsx
index 199146b0bf..b00b1a2f51 100644
--- a/web/src/views/live/LiveDashboardView.tsx
+++ b/web/src/views/live/LiveDashboardView.tsx
@@ -472,11 +472,20 @@ export default function LiveDashboardView({
} else {
grow = "aspect-video";
}
- const streamName =
- currentGroupStreamingSettings?.[camera.name]?.streamName ||
- camera?.live?.streams
- ? Object?.values(camera?.live?.streams)?.[0]
- : "";
+ const availableStreams = camera.live.streams || {};
+ const firstStreamEntry = Object.values(availableStreams)[0] || "";
+
+ const streamNameFromSettings =
+ currentGroupStreamingSettings?.[camera.name]?.streamName || "";
+ const streamExists =
+ streamNameFromSettings &&
+ Object.values(availableStreams).includes(
+ streamNameFromSettings,
+ );
+
+ const streamName = streamExists
+ ? streamNameFromSettings
+ : firstStreamEntry;
const autoLive =
currentGroupStreamingSettings?.[camera.name]?.streamType !==
"no-streaming";