Open IronOxidizer opened 3 years ago
Good point. I added a note to the troubleshooting doc for the moment. Long-term, I want it to support both streams; there's a bullet point about this at #115.
I'm calling this a JS bug in that the Javascript has all the information to know in advance that the sub
stream doesn't exist and the main
stream does.
It'd be nice if the server reported an error in a way the client Javascript could actually see—maybe accepting the WebSocket, sending a text message with an error, then closing it—rather than a HTTP status that the browser deliberately withholds from the Javascript. But given that the error is avoidable (ignoring silly edge cases like the server being reconfigured to take away the sub stream between the loading /api/
and loading /api/cameras/.../sub/live.m4s
), I think that's a secondary concern.
Live view does not work for cameras with no sub stream configured. The result is a black screen and the following error on FireFox
It's caused by this line:
https://github.com/scottlamb/moonfire-nvr/blob/8465b49cfab5561886c9ccea848cb38ef6907ba1/server/src/web.rs#L420
Potential solutions could be:
I'm not sure if this is expected behavior, but it should at least be documented.