Commit Graph

289 Commits

Author SHA1 Message Date
Isaac Connor
615055e496 fix: default analysis overlay to off in zms streams
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>
2026-02-23 18:16:55 -05:00
IgorA100
90891e3456 Fix: Clear "srcObject" for "Stream" and adjust Janus connection timeout (MonitorStream.js) 2026-02-15 15:38:07 -05:00
Isaac Connor
7b71ad2149 fix: pass analysis=true in zone view stream URL on initial load
The zone view enables analysis frames by default but the initial image
src and the rebuilt streaming URL were missing the analysis query param.
Add analysis=true to the getStreamHTML call in zone.php and preserve it
in MonitorStream.start() when switching from single to jpeg mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:12:06 -05:00
IgorA100
d15febf205 Moved the "replaceDOMElement" function to "skin.js" (MonitorStream.js) 2026-02-10 22:15:48 +03:00
Isaac Connor
368affc08e Merge pull request #4591 from IgorA100/patch-955784
Fix: More correct logic for #volumeSlider processing & Improved functionality for RTSP2web, Janus, and ZMS
2026-02-10 12:55:09 -05:00
Isaac Connor
c9196e8fd5 Merge branch 'master' of github.com:ZoneMinder/zoneminder 2026-02-10 09:38:03 -05:00
Isaac Connor
9a2e9a8600 fix: fall back to CameraDirectPrimary when RTSPServer is disabled
When StreamChannel is set to Restream, the JS maps it to the
_ZoneMinderPrimary go2rtc stream. However, that stream is only
registered when RTSPServer is enabled on the monitor. Fall back
to _CameraDirectPrimary when RTSPServer is not enabled.

Pass RTSPServer property through monitorData in all views so the
JS can check it at stream selection time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 09:32:24 -05:00
Nic Boet
5393c626c5 fix: preserve maxfps when MonitorStream.start() rebuilds stream URL
start() reconstructs the zms URL from url_to_zms, which only contains
the monitor id. Parameters like auth, connkey, scale, and mode are
carried over, but maxfps was dropped. This causes streams to start at
the camera's native capture rate even when PHP rendered the initial
<img src> with a maxfps value (e.g. from the montage Rate cookie).

Carry over maxfps from the existing src the same way the other
parameters are preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 18:42:44 -06:00
Isaac Connor
079b873380 fix: correct auth property name in getStatusCmdResponse
The PHP status.php returns 'auth' but getStatusCmdResponse was checking
for 'auth_hash'. This mismatch prevented auth hash updates from status
responses from ever being applied, causing invalid hash errors after
the auth expired.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 16:44:52 -05:00
Isaac Connor
d64636cf7d fix: prevent stream commands from being sent after quit
Added started flag checks in streamCommand() and streamCmdQuery() to
prevent commands from being sent after the stream has been killed.
This fixes an issue where scale commands were being sent after quit
commands during page reload.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:59:16 -05:00
IgorA100
ef74b63587 Code optimization (MonitorStream.js) 2026-02-05 00:44:46 +03:00
IgorA100
27c225e4ef Missing Semicolon (MonitorStream.js) 2026-02-05 00:32:31 +03:00
IgorA100
62faabc5f0 When using ZMS, destroy VolumeSlider if it exists (MonitorStream.js) 2026-02-05 00:30:00 +03:00
IgorA100
534a9ef197 Fix: Eslint (MonitorStream.js) 2026-02-04 19:36:35 +03:00
IgorA100
85d5cbd63a Added the ability to retrieve tracks from a stream, disable Volume Controls if there is no audio track, and improved functionality for RTSP2Web, Janus, and ZMS. (MonitorStream.js) 2026-02-04 19:28:33 +03:00
Isaac Connor
ac4585b6b4 fix: use monitor's StreamChannel setting for go2rtc stream selection
Two issues caused monitors to stream from wrong channel:

1. In setChannelStream(), the expression `StreamChannel && SecondPath`
   returned SecondPath (often empty) instead of StreamChannel. Now
   correctly uses the monitor's configured StreamChannel.

2. In MonitorStream.start(), default channel only checked for
   CameraDirectSecondary and defaulted everything else to Restream.
   Now respects the actual StreamChannel setting.

Also improved fallback when selected option is disabled to find first
enabled option rather than always defaulting to Restream.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:01:50 -05:00
Isaac Connor
eae89025ee refactor: rename RTSP2WebStream to StreamChannel
Rename applies to Go2RTC, Janus, and RTSP2Web streaming options.
Update enum values from Primary/Secondary to Restream/CameraDirectPrimary/CameraDirectSecondary.

- Add db migration zm_update-1.37.79.sql to rename column and migrate data
- Update C++ enum StreamChannelOption and member stream_channel
- Update PHP getStreamChannelOptions() method
- Update all JavaScript references
- Auto-select CameraDirectPrimary when Restream option becomes disabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:37:08 -05:00
IgorA100
c7a8e5a78c Fix Eslint (MonitorStream.js) 2026-01-21 21:14:00 +03:00
IgorA100
b6ad1b94dd Fix: More correct handling of "muted" and copying of all attributes when cloning a DOM node (MonitorStream.js) 2026-01-21 20:59:29 +03:00
Isaac Connor
eb2d90eed0 Set started=false so we don't send STOP after QUIT 2026-01-20 22:10:20 -05:00
IgorA100
1759381a8e Fix: Eslint (MonitorStream.js) 2026-01-13 18:18:25 +03:00
IgorA100
ffc7f96b58 Fix: Correct operation of controlMute if iconMute or volumeSlider are missing (MonitorStream.js)
Actual for Montage page
2026-01-13 17:34:39 +03:00
IgorA100
3496937825 I returned the old "this.controlMute" function (MonitorStream.js)
It's not entirely clear why it was necessary to change the "this.controlMute" function in the commit.f796fa913f

After this change, the "volumeSlider" and "iconMute" styling sometimes doesn't work correctly.

The old code was 99.9% debugged and worked without any issues.

It's also unclear why "this.muted" was added? After all, we already had "audioStream.muted." Now we're probably getting duplicates.
2026-01-12 15:30:27 +03:00
Isaac Connor
90da1be90e Funny thing img.src is NEVER == ''. It will return the current nav url. So all the code testing for '' is bogus. This fixes sending an additional STOP after QUIT, which leaves errors in logs. 2026-01-02 10:41:44 -05:00
Isaac Connor
a15fb72b6f error => debug 2025-12-19 12:06:12 -05:00
Isaac Connor
ae3e8a86b9 Fix initial status update 2025-12-14 12:43:27 -05:00
Isaac Connor
f796fa913f Fix audio auto-starting on montage. AUdio should never auto-start... Or maybe we need to track it in cookies, but by default should start muted 2025-11-21 22:33:22 -05:00
Isaac Connor
cbd343b8e2 Only update img.src if we are started. 2025-11-20 15:54:44 -05:00
Isaac Connor
7ce9cdef25 Set muted attribute of go2rtc streams 2025-11-19 22:18:32 -05:00
Isaac Connor
3bfaf3e9ae Provide backtrace in setScale. Only start streamCmdTimer if stream is started (a status update can be in flight while we stop. 2025-11-18 17:37:36 -05:00
Isaac Connor
46343903c0 Fixup starting with muted=trute on montage 2025-11-13 21:53:39 -05:00
Isaac Connor
384d6d5463 Merge firefly:sandbox/ZoneMinder 2025-11-13 19:34:08 -05:00
Isaac Connor
09983c9545 FIx typo getAudioStraem => getAudioStream. Add this.muted 2025-11-13 19:33:09 -05:00
Isaac Connor
09f997fa8b Fix eslint 2025-11-13 12:36:14 -05:00
Isaac Connor
788e65886f Add genConnKey and when reloading a failed stream, generate a new connKey. Even tho the stream failed, zms may still be running , locked on the old connKey. Any new attempt to stream with the old will hang. 2025-11-12 16:06:49 -05:00
Isaac Connor
f28146e3ac Improve auto mode for RTSP2Web. Default to webrtc. Fix streaminfo mode display. 2025-11-11 18:48:34 -05:00
Isaac Connor
2ffbdbe9e3 Add a test to prevent height=0px 2025-11-11 18:12:45 -05:00
Isaac Connor
1ddf0771eb If activePlayer is already set to zms, try just sending a PLAY command. This fixes paused streams not restarting 2025-11-10 12:09:50 -05:00
Isaac Connor
98ecc30905 Remove debug RE ZM_WEB_SOUND_ON_ALARM 2025-11-10 11:40:46 -05:00
Isaac Connor
fd15f72687 Use parseInt on ZM_WEB_SOUND_ON_ALARM which fixes it trying to play a sound on alarm when that feature is off 2025-10-27 15:05:01 -04:00
Isaac Connor
da450eca2f Fix eslint 2025-10-24 09:16:01 -04:00
Isaac Connor
683636ca5e When constructing img.src include scale and mode. 2025-10-23 19:17:00 -04:00
Isaac Connor
5e6ae9e155 WHen using mode=paused, start up the streamCmdQUery timer. Also in cmdResponse, if there is no stream timer, start it up. 2025-10-23 19:17:00 -04:00
Isaac Connor
1e8d299c31 We havn't import url_to_stream yet. 2025-10-07 21:33:22 -04:00
Isaac Connor
05e18af95c Better logging, handle when zms starts up in paused mode. Add support for initial scale being passed through monitorData 2025-10-07 21:02:14 -04:00
Isaac Connor
aec6f8af32 Fix adding rand 2025-10-01 21:01:53 -04:00
Isaac Connor
2e16eb92a8 FIx logic inversion rand updating 2025-09-27 10:34:31 -04:00
Isaac Connor
01443b7449 Handle not finding monitorStream div more gracefully 2025-09-25 12:32:45 -04:00
Isaac Connor
b48476bff0 Fix video=>video_el 2025-09-25 10:29:58 -04:00
Isaac Connor
37a1159b92 Handle lack of video element more gracefully 2025-09-25 10:10:31 -04:00