Skip to content

Hide zoom buttons for PTZ cameras without zoom - #7

Open
hyngsk wants to merge 1 commit into
codextde:mainfrom
hyngsk:feat/hide-zoom-without-zoom-space
Open

hyngsk wants to merge 1 commit into
codextde:mainfrom
hyngsk:feat/hide-zoom-without-zoom-space

Conversation

@hyngsk

@hyngsk hyngsk commented Nov 24, 2026

Copy link
Copy Markdown

Problem

Pan/tilt-only PTZ cameras (fixed lens) still show the zoom in/out buttons next to the PTZ pad, in both the web live viewer and the app. Pressing them does nothing.

Change

  • Server: after GetCapabilities and GetProfiles, the ONVIF probe also sends GetNodes to the PTZ service. zoomFromNodes() returns true when SupportedPTZSpaces lists a zoom movement space (Absolute/Relative/ContinuousZoom…Space), false when the spaces list has none, and undefined when the node has no SupportedPTZSpaces at all. ZoomSpeedSpace on its own does not count, because it only sets the speed for other moves.
  • Storage: the result is stored as caps.ptzZoom and exposed as capabilities.ptzZoom. checkPtz updates it like the presets.
  • Web UI and app: both hide the zoom buttons only when ptzZoom === false. If GetNodes fails, or the camera does not describe its spaces, nothing changes and the buttons stay. Cameras that can zoom are not affected.

Testing

  • bun test in server/ passes 77 of 77, including 4 new cases for zoomFromNodes. tsc --noEmit is clean for the server and the app, and bun test src passes in app/.
  • I checked this against a pan/tilt-only camera whose ONVIF server lists only RelativePanTiltTranslationSpace and ContinuousPanTiltVelocitySpace. The camera reports ptzZoom: false, and the web live viewer shows the PTZ pad without zoom buttons.

Pan/tilt-only cameras (fixed lens) still showed zoom in/out next to the
PTZ pad in the web UI and the app; the buttons did nothing.

The ONVIF probe now also asks the PTZ service for GetNodes and records
whether the node lists a zoom movement space (Absolute/Relative/
ContinuousZoom...). ZoomSpeedSpace alone does not count. The result is
stored as caps.ptzZoom and returned as capabilities.ptzZoom.

The web UI and the app hide the zoom buttons only when ptzZoom is
explicitly false. If GetNodes fails or carries no SupportedPTZSpaces, the
value stays undefined and the buttons are shown as before, so cameras that
do zoom keep working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant