Open mebjas opened 2 years ago
UX Help wanted
A better fix for this would be:
If zoom is supported
But this would need longer term effort!
@mebjas I found a nice project that control tilt, zoom, pan etc... https://web.dev/camera-pan-tilt-zoom/
https://github.com/mebjas/html5-qrcode/pull/331 will help expose the following two capabilities to Html5QrcodeScanner
/**
* Returns the capabilities of the running video track.
*
* Note: Should only be called if {@code Html5QrcodeScanner#getState()}
* returns {@code Html5QrcodeScannerState#SCANNING} or
* {@code Html5QrcodeScannerState#PAUSED}.
*
* @beta This is an experimental API
* @returns the capabilities of a running video track.
* @throws error if the scanning is not in running state.
*/
public getRunningTrackCapabilities(): MediaTrackCapabilities;
/**
* Apply a video constraints on running video track from camera.
*
* Note: Should only be called if {@code Html5QrcodeScanner#getState()}
* returns {@code Html5QrcodeScannerState#SCANNING} or
* {@code Html5QrcodeScannerState#PAUSED}.
*
* @beta This is an experimental API
* @param {MediaTrackConstraints} specifies a variety of video or camera
* controls as defined in
* https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints
* @returns a Promise which succeeds if the passed constraints are applied,
* fails otherwise.
* @throws error if the scanning is not in running state.
*/
public applyVideoConstraints(videoConstaints: MediaTrackConstraints)
Which shall enable the users to build zoom features with a zoom slider UI. It would take me some time to identify a good UI to crunch in zoom slider within current UI. It will probably need some UI rewamp as well.
@ROBERT-MCDOWELL
I found a nice project that control tilt, zoom, pan etc... https://web.dev/camera-pan-tilt-zoom/
I saw this before, bunch of it is useful but not very well supported across browsers. Particularly pan
and tilt
is for camera hardware that support pan and tilt like ones used in video conferencing.
@mebjas maybe the zoom part code can inspire us?
If you plan to integrate the pan/zoom functionality, these would be best controlled with finger gestures drag/pinch-zoom on a phone or click-drag/mouswheel-zoom on desktop without the need of an UI. If the developer really wants it, a slider could be exposed, but I think it should be hidden by default. No need to litter the UI :)
about zoom control, i tested this and works perfectly: https://github.com/mebjas/html5-qrcode/issues/308#issuecomment-1121195534
Feature support coming for Html5QrcodeScanner
in version 2.3.2
.
Slider implemented, looking into pinch to zoom next.
Zoom feature published:
For
Html5QrcodeScanner
- add zoom slider if capability is supported.For
Html5Qrcode
Html5Qrcode