Skip to content

Add camera control properties (pan, tilt, zoom) to DOM media track types - #64333

Draft
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 2 commits into
mainfrom
copilot/add-media-track-zoom-tilt-pan
Draft

Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 2 commits into
mainfrom
copilot/add-media-track-zoom-tilt-pan

Conversation

Copilot AI commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

The MediaStream camera-control constrainable properties (pan, tilt, zoom, torch, whiteBalanceMode) were missing from the media-track types in lib.dom.d.ts, so browser-supported camera control was unusable without casts:

const track = stream.getVideoTracks()[0];
const caps = track.getCapabilities();
if (caps.zoom) {                                    // TS2339
    await track.applyConstraints({ advanced: [{ zoom: caps.zoom.max }] }); // TS2353
}

Changes

  • MediaTrackCapabilities: added pan, tilt, zoom (DoubleRange), torch (boolean[]), whiteBalanceMode (string[])
  • MediaTrackConstraintSet: added pan, tilt, zoom (ConstrainDouble), torch (ConstrainBoolean), whiteBalanceMode (ConstrainDOMString)
  • MediaTrackSettings: added pan, tilt (number); zoom/torch/whiteBalanceMode already existed
  • MediaTrackSupportedConstraints: added pan, tilt, zoom, torch, whiteBalanceMode (boolean)
  • New compiler test mediaTrackPanTiltZoom.ts + baselines covering all four interfaces

Note: lib.dom.d.ts is generated by TypeScript-DOM-lib-generator; a matching upstream change is needed so this isn't lost on the next lib sync.

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug and removed For Milestone Bug PRs that fix a bug with a specific milestone labels Sep 19, 2026
Copilot AI changed the title [WIP] Add zoom, tilt, and pan properties to MediaTrackCapabilities and MediaTrackConstraints Add camera control properties (pan, tilt, zoom) to DOM media track types Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MediaStream API should support pan, zoom and tilt

2 participants