bensonruan / webcam-easy

javascript access webcam stream and take photo
https://bensonruan.com/how-to-access-webcam-and-take-photo-with-javascript
MIT License
240 stars 110 forks source link

accessing the device torch || flash light #39

Open antonyf opened 2 years ago

antonyf commented 2 years ago

Is it possible to turn on the device flash light?

i followed this link: https://codepen.io/adamrifai/pen/YLxjKa

and tested it, it turns on the flash light, but the flash light is attached to the camera event.. Is it possible to have this function added?

Greets.

markaw375 commented 1 year ago

Did you manage to add a flashlight? Is this code from codeopen working with current library?

antonyf commented 1 year ago

Hi, i just got your message now... The project i was working on at the time was commissioned as a PWA with QRcode scanning capabilities. The PWA or javascript qrscanner was a milliseconds to slow for the clients and then they requested to rather have the application changed to a hybrid apps. I then used cordova and in that i go the flash light working for sure.. Let me go through the source code of the pwa and check for you quickly

antonyf commented 1 year ago

Hi markaw375, no i didn't complete the torch functionality for this, actually what happened was that for ios, when i created the PWA, the getusermedia stopped working and so i used the INPUT type FILE with capture which calls the device default Camera and this had the flashlight in it.. But then the project was scrapped for the Hybrid app. Hope this helps..

markaw375 commented 1 year ago

Okay. Thank you for the quick reply.