vue-qrcode-reader
vue-qrcode-reader copied to clipboard
Possible Features to Adjust Camera Expossure
Hi,
Could we adjust the expossure of the camera? It would be great to scan QR Code shown in a display like OLED screen
Looks like there the API offers something related to exposure:
https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#exposuremode
Haven‘t tested but I suspect browser support is bad (especially Safari). Anyway, adding a prop for this shouldn’t be too hard.
Just add a comment here: There's a write-up on how to properly apply this constraint and check for its support: https://webrtchacks.com/bad-lighting-fix-with-javascript-webcam-exposure/#post-3807-_ttmtkt8og756
And here is a playground to tweak with the constraints: https://live.mdnplay.dev/en-US/docs/Web/API/Media_Capture_and_Streams_API/Constraints/sample.Example_Constraint_exerciser.html
I'm able to control the exposure time of the camera video in this playground with the following constraints object:
{
"advanced": [
{
"exposureMode": "manual",
"exposureTime": 200
}
]
}
Ok so this probably just boils down to adding two props here. Maybe exposure-mode
and exposure-time
. Adding the values to the cameraSettings
object here. That should automatically trigger the watcher that requests a camera. The cameraSettings
object is passed to this function which then calls runStartTask
here. And in runStartTask
we can somehow implement the logic mentioned in this article:
Just add a comment here: There's a write-up on how to properly apply this constraint and check for its support: https://webrtchacks.com/bad-lighting-fix-with-javascript-webcam-exposure/#post-3807-_ttmtkt8og756
This issue has been marked as stale. If there is no further activity it will be closed.
I can look into this after vacation (~2.18).
This issue has been marked as stale. If there is no further activity it will be closed.