Skip to content

Methods for device selection#1

Open
gwue wants to merge 3 commits into
parttio:masterfrom
gwue:vcamera/cameraControl
Open

Methods for device selection#1
gwue wants to merge 3 commits into
parttio:masterfrom
gwue:vcamera/cameraControl

Conversation

@gwue

@gwue gwue commented Jan 8, 2025

Copy link
Copy Markdown

Added methods to enumerate the clients devices, to open a specific device and to open the "normal" environment camera

I am writing an application where I want to scan barcodes. On my phone though, openCamera() opens the user-facing camera by default.
When supplying an options string to OpenCamera with facingMode: { exact: "environment" }, my rear camera is openend, but with a fish-eye lens.
A reddit comment https://www.reddit.com/r/javascript/comments/8eg8w5/comment/dxvqycs/ mentions, that the most reliable way to open the regular back facing camera, was to just use the last device as returned by enumerate devices, so I also added a method for that.
You may not want to include openNormalEnvironmentCamera but I think listDevices and openCamera(Device device) at least are useful additions

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