`<!DOCTYPE html> <html> <head> <title>Instascan</title> <script type="text/javascript" src="instascan.min.js"></script> <style> #video,#video_,#preview{ position: relative; width: 100%; height: 80%; top: 0.0%; border: 3px solid #E43E26; text-align: center; display: block; margin-left: auto; margin-right: auto; } #canvas{ position: relative; width: 100%; height: 80%; top: 0.0%; text-align: center; display: block; margin-left: auto; margin-right: auto; } </style> </head> <body> <video id="preview"></video> <script type="text/javascript"> let opts = { continuous: true, video: document.getElementById('preview'), mirror: true, captureImage: false, backgroundScan: true, refractoryPeriod: 5000, scanPeriod: 1 }; let scanner = new Instascan.Scanner(opts); scanner.addListener('scan', function (content) { console.log(content); }); Instascan.Camera.getCameras().then(function (cameras) { if (cameras.length > 0) { scanner.start(cameras[0]); } else { console.error('No cameras found.'); } }).catch(function (e) { console.error(e); }); </script> </body> </html>`