title: Turn off webcam/camera after using getUserMedia
body: <p>I'm developing a Chrome Extension that uses the background page to access the user's webcam.</p>
  
  <p>Users are given the option to turn the camera off.</p>
  
  <p>The stream appears to be being turned off. The relevant functions are no longer receiving the stream. However the webcam light (currently being developed and tested on a mac book pro) does not turn off.</p>
  
  <p>Any ideas?</p>
  
  <p>Here's my code for setting up the stream:</p>
  
  <pre><code>if (navigator.webkitGetUserMedia!=null) {
  
      var options = { 
          video:true, 
          audio:false 
      };  
      navigator.webkitGetUserMedia(options, 
          function(stream) { 
          vid.src = window.webkitURL.createObjectURL(stream);
          localstream = stream;
          vid.play();
          console.log("streaming");
      }, 
          function(e) { 
          console.log("background error : " + e);
          }); 
  } 
  </code></pre>
  
  <p>And here's my method for turning off the stream:</p>
  
  <pre><code>function vidOff() {
      clearInterval(theDrawLoop);
      ExtensionData.vidStatus = 'off';
      vid.pause();
      vid.src = "";
      localstream.stop();
      DB_save();
      console.log("Vid off");
  }
  </code></pre>
  
  <p>Any obvious I'm missing?</p>