title: Cordova Barcodescanner - Use front facing camera
body: <p>I am using this barcodescanner (<a href="https://github.com/wildabeast/BarcodeScanner" rel="nofollow">https://github.com/wildabeast/BarcodeScanner</a>) on an app made using Cordova, specifically aimed at using on an Android device.</p>
  
  <p>I have the following function set up in JavaScript:</p>
  
  <pre><code>$(document).ready(function(){    
      $('#scanner').click( function(){
  
          console.log('clicked'); //to see if the function is firing      
          cordova.plugins.barcodeScanner.scan(
  
          function (result) {
            alert("We got a barcode\n" +
                  "Result: " + result.text + "\n" +
                  "Format: " + result.format + "\n" +
                  "Cancelled: " + result.cancelled);
          }, 
          function (error) {
            alert("Scanning failed: " + error);
          }
      );
      });    
  });
  </code></pre>
  
  <p>as mentioned in the documentation provided for this plugin. I have added it into my project using the cordova CLI:</p>
  
  <pre><code>$ cordova add plugin https://github.com/wildabeast/BarcodeScanner.git
  </code></pre>
  
  <p>When I list the available plugins for my projects I can see that it is installed correctly. Also I can use the camera in my app with the button firing off the correct function and can scan using the back camera with no issues.</p>
  
  <p>Is there any way of using the front camera for the scan? If it is not in the plugin, is there any way of setting the default camera used by the device, in the code, to use the front facing camera by default? The app that we are developing needs to specifically use the front facing camera only and does not need the back facing camera.</p>
  
  <p>Any help will be appreciated.</p>