title: Scan Barcode in HTML5/JavaScript
body: <p>I'm looking for a way to scan for a barcode and return a response based on whether it received the barcode or not. The only results I can find point to the Intel XDK. I can't use that for this particular project, so it is possible to do it without it? <strong>How do I scan for a barcode with HTML5/JavaScript?</strong></p>
  
  <p><a href="https://forums.html5dev-software.intel.com/viewtopic.php?f=9&amp;t=3913" rel="nofollow">Here is the link I found originally</a>, which looks like it could do the job if I was able to use the Intel XDK. Let me know what I can add to this question to be more clear, I just need to be pointed in the right direction as I don't know where to begin or how to actually scan once I've accessed the camera. Here's the code I'm using to access and show the device camera:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta content="stuff, to, help, search, engines, not" name="keywords"&gt;
  &lt;meta content="What this page is about." name="description"&gt;
  &lt;meta content="Display Webcam Stream" name="title"&gt;
  &lt;title&gt;Display Webcam Stream&lt;/title&gt;
  
  &lt;style&gt;
  #container {
      margin: 0px auto;
      width: 500px;
      height: 375px;
      border: 10px #333 solid;
  }
  #videoElement {
      width: 500px;
      height: 375px;
      background-color: #666;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id="container"&gt;
      &lt;video autoplay="true" id="videoElement" controls="true"&gt;
  
      &lt;/video&gt;
  &lt;/div&gt;
  &lt;script&gt;
  var video = document.querySelector("#videoElement");
  
  navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
  
  if (navigator.getUserMedia) 
  {       
      navigator.getUserMedia({video: true}, handleVideo, videoError);
  }
  
  function handleVideo(stream)
  {
      video.src = window.URL.createObjectURL(stream);
  }
  
  function videoError(e) 
  {
      alert("I don't understand. Why did you not allow it?");
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>