Skip to content

Fix: Camera switching latency issue#161

Open
Manu3lde wants to merge 1 commit into
Pbatch:mainfrom
Manu3lde:main
Open

Fix: Camera switching latency issue#161
Manu3lde wants to merge 1 commit into
Pbatch:mainfrom
Manu3lde:main

Conversation

@Manu3lde

@Manu3lde Manu3lde commented Jun 10, 2026

Copy link
Copy Markdown

Improves camera device selection and video stream handling. Fixes issues when switching cameras and safely applies video track constraints.

changes

  • (deviceButton.tsx)
    Stops previous stream tracks before switching, removes facingMode when deviceId is used, adds fallback to default constraints on error, listens to devicechange for dynamic updates, syncs dropdown state with active track, and handles missing labels.

  • (video.tsx)
    Adds type-safe zoom constraints, checks existence of videoRef.current and srcObject before accessing capabilities, restructures cleanup to properly await track stop, and applies constraints immediately + after 500ms (instead of a fixed 2s timeout).

Closes #159

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.

Camera Input Switch Lag

1 participant