How can you scan QR code using HTML5 and MVC3?

12,789

Solution 1

There is no public camera API in HTML5 as is in a web browser.

For now, you can use frameworks embedding HTML5 to native apps to do this.

An example:

http://phonegap.org

ZBar QR code scanner for Phonegap

http://blog.infoentropy.com/Use_ZBar_barcode_reader_with_PhoneGap

The payload of QR code can be any text, but it is usually a HTML link.

Solution 2

On Android and iPhone you can scan from a web page this way: http://code.google.com/p/zxing/wiki/ScanningFromWebPages

It's not really scanning with HTML5 or anything, but, may be the closest you can get.

Share:
12,789
updev
Author by

updev

Updated on June 04, 2022

Comments

  • updev
    updev almost 2 years

    Can anyone help or explain how QR code would work using HTML5 and MVC3?

    Can it be scanned using laptop webcam or will only work on mobile sit?

  • updev
    updev about 12 years
    Thanks Mikko for the reply. Can you allobrate this sentence, because i didn't get it: "no public camera API in HTML5 as it is in the web browser"? Besides allowing it to the native camera, can this be done from a laptop where it has a webcam?
  • Agustin
    Agustin almost 11 years
    Please correct me if I'm wrong, but I would say getUserMedia is pretty close to a "camera API", no?
  • Mikko Ohtamaa
    Mikko Ohtamaa almost 11 years
    That's correct. Please note that the answer was written more than one year ago.
  • Trafalgar D Law
    Trafalgar D Law over 7 years
    @Agustin the getUserMedia can be use as a searching for data after scanner a QR?. I am a project that can generate a QR so I need to scan it and find the data from my system(grid)