- Add user= parameter to get_auth_relay() so zms can use the indexed
Username column instead of iterating all users to validate the hash
- Apply the same fix to Event.php getStreamSrc() and getThumbnailSrc()
- Tighten Monitor.php from isset() to !empty() for consistency
- In MonitorStream.js start(), check if the auth hash in the img src
matches the current auth_hash before resuming via CMD_PLAY. If stale,
fall through to rebuild the URL with fresh auth_relay. This prevents
long-running montage pages from spawning zms with expired credentials.
- Downgrade zms auth failure from Error to Warning
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- getAudioStream has been renamed to getAVStream
- Clear this.handlerEventListener['volumechange'] when the stream is stopped
- Check volumeSlider.noUiSlider after assigning the listener
- This.handlerEventListenerStream does not require an argument (stream), but if we have already received a stream, we will pass it as an argument to avoid searching for the stream again.
When zms reports it is not sending analysis frames (e.g. monitor is not
analysing), update the analyse button appearance and MonitorStream's
analyse_frames state to reflect reality. Register the analyseBtn via
setButton in both watch and zone views so MonitorStream can update it.
View-level toggle handlers now read the current state from MonitorStream
before toggling to stay in sync with server-reported changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a boolean analysis_image field to the CMD_QUERY status response that
reports whether zms is actually sending analysis images (with motion zone
overlays) or regular capture images. This lets MonitorStream.js detect
when the stream state is out of sync with what the client requested and
re-send the CMD_ANALYZE_ON/OFF command to correct it.
The field is true only when frame_type is FRAME_ANALYSIS, shared memory
is valid, and the monitor has analysis enabled — matching the same
condition used to select the image in the streaming loop.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
We won't use the "this.killStreamListenerId" variable recommended by Copilot, but will instead use the this.handlerEventListener array, as we may have other listeners in the future.
Using an array will eliminate the need to declare additional constants.
When using Janus live streaming, MonitorStream.js assigns to undeclared variables (stream, audioElement) inside onremotetrack(). In strict mode this causes "ReferenceError: stream is not defined" and breaks playback. This change declares stream/audioElement with let, fixing Janus live video/audio playback.
After adding the "players" variable, the "players is not defined" issue appears on various pages.
There's currently an error on the Zones page.
Yes, ideally, the variable should be added in *.js.php files on various pages.
The absence of the variable has no significant impact, other than incomplete display of information.
The current error disrupts all JavaScript.
This PR prevents the disruption of all JavaScript code on the page.
MonitorStream.js initialized analyse_frames = true, causing zone
overlays to always appear on stream start regardless of view settings.
Change default to false so watch view starts clean. The zone editor
view already explicitly enables analysis after monitor creation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>