Open Mobile camera for barcode scan from web page

Viewed 2196

i hope you'r all doing well. I am working on a project in which we ask the user to scan a barcode,I want if the user click on a specific button at mywebsite the mobile camera will open to scan the barcode but i am not sure how to open the mobile camera for that purpose, can somebody help me please ? Thanks in advance. Note : I am not providing the barcode but i just want to open mobile camera to scan any barcode at clicking button.

1 Answers

This should work on most mobile devices.

<input type="file" accept="image/*" capture="camera" />

It's essentially an input box like a button. When the user clicks on it, it launches the camera.

Related