better error msg on live view when misconfigured

Improves (but doesn't fix) #119 and #120.
This commit is contained in:
Scott Lamb
2021-08-13 12:02:42 -07:00
parent 42cf77f0d6
commit b8b5038f71
6 changed files with 15 additions and 4 deletions

View File

@@ -80,6 +80,15 @@ class LiveCameraDriver {
if (this.ws !== undefined) {
return;
}
const subStream = this.camera.streams.sub;
if (subStream === undefined || !subStream.record) {
this.error(
"Must have sub stream set to record; see " +
"https://github.com/scottlamb/moonfire-nvr/issues/119 and " +
"https://github.com/scottlamb/moonfire-nvr/issues/120"
);
return;
}
console.log(`${this.camera.shortName}: starting stream: ${reason}`);
const loc = window.location;
const proto = loc.protocol === "https:" ? "wss" : "ws";

View File

@@ -31,6 +31,7 @@ export interface Stream {
totalSampleFileBytes: number;
fsBytes: number;
days: Record<string, Day>;
record: boolean;
}
export interface Day {