LazarSoft / jsqrcode

Javascript QRCode scanner
http://www.webqr.com
Apache License 2.0
3.98k stars 1.16k forks source link

webqr.com with android g chrome front cam to rear c #23

Open jeffreyho92 opened 11 years ago

jeffreyho92 commented 11 years ago

how can i change from front cam to rear cam?

DeadlySystem commented 9 years ago

You can't with the current code. You need to use MediaStreamTrack.getSources to identify the individual cameras and then provide the cam's ID when accessing the webcam. But that standard is not too established yet. It works on Chrome for Android though, I created a browser-based QR code scanner with this library which allows you to select the cam, but it's not public (at least for now).

rubensalcedo commented 9 years ago

DeadlySystem, can I have the code that you mention to test in our web application? Thank you.

DeadlySystem commented 9 years ago

Okay @rubensalcedo see here: https://gist.github.com/DeadlySystem/304d3da710a70ac0545c This is compiled TypeScript, i.e. JavaScript. Please read the gist's description. Also, note that you will need to use requirejs for this to work in the posted form. You may freely use and adapt it, but when you share it please link to this Github issue. This is just a snippet from a large project, and of course it is untested in this form. But you should be able to find the important concepts.

d00nn1 commented 8 years ago

hi i have the same problem. I do not know how can I turn rear camera (environment) if they could help me I would be very grateful i want to start automatically the rear camera bicos the qr scan is for a smartphone i found another QR scan but thets is the best of all

DeadlySystem commented 8 years ago

Just look at my gist from my previous comment... On line 33 starts the code that does the magic. It is used to fill a