1

i write a code for scan passport id .. i have plustek reader (x50). i can capture image from my device in javascript (webcam.js).. but when capture image the light source not run . how can run the led light before capture image ... i need cod in javascript becouse the device in client side .. my application not mobile apps.. it web application .

 // Configure a few settings and attach camera
 function configure() {
     Webcam.set({
         width: 320,
         height: 240,
         image_format: 'jpeg',
         jpeg_quality: 90,
         flip_horiz: true,
     });

     Webcam.attach('#my_camera');
 }

 // A button for taking snaps
 // preload shutter audio clip
 var shutter = new Audio();
 //shutter.autoplay = true;

 shutter.src = navigator.userAgent.match(/Firefox/) ? 'shutter.ogg' : 'shutter.mp3';

 function take_snapshot() {
     // play sound effect
     shutter.play();

     // take snapshot and get image data
     Webcam.snap(function (data_uri) {
         // display results in page

         document.getElementById('results').innerHTML =
          '<img id="imageprev" src="' + data_uri + '"/>';
         ////////////
         ////////////////
         var base64image = document.getElementById("imageprev").src;
         var strImage = base64image.replace(/^data:image\/[a-z]+;base64,/, "");

         //
         //  $("#<%=Image1.ClientID%>")
         // .attr("src", base64image)
     });

     Webcam.reset();
 }
Stefan Becker
  • 5,695
  • 9
  • 20
  • 30
iflatoon
  • 11
  • 1
  • Hello and welcome to SO. I'm a little confused. Are you talking about lighting the led light which indicates that the camera is on -or- a led-flash-light on the camera? – Ted Aug 29 '19 at 08:51
  • I think that you better follow/read the SDK and the api of the plustek reader (x50) - its difficult to get answer on this, except if some from the company answer to you – Aristos Aug 29 '19 at 10:18
  • hi.. iam talk about led flashlight... i want run it while capture the image.. – iflatoon Aug 30 '19 at 10:01
  • Possibly using `MediaStream Image Capture API ` I found this on this answer: https://stackoverflow.com/questions/59202499/adjusting-webcam-usermedia-camera-settings-via-javascript – Flavien Volken Jul 29 '22 at 18:43

0 Answers0