title: How to enable front camera in Phonegap
body: <p>Opening webcam on a website using HTML5 &amp; Js with the following code.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" href="headBoxingStyle.css"/&gt;
    &lt;/head&gt;
    &lt;body style="overflow: hidden"&gt;
      &lt;div id="headtrack"&gt;&lt;/div&gt;
      &lt;canvas id='canvas' width='100' height='100'&gt;&lt;/canvas&gt;
      &lt;video width="100" height="100"&gt;&lt;/video&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;script type="text/javascript"&gt;
  var onFailSoHard = function(e)
  {
      console.log('failed',e);
  }
  
  window.URL = window.URL || window.webkitURL;
  navigator.getUserMedia = navigator.getUserMedia ||  navigator.webkitGetUserMedia;
  
  var video = document.querySelector('video');
  
  if(navigator.getUserMedia)
  {
    navigator.getUserMedia({video: true},function(stream) {
      video.src = window.URL.createObjectURL(stream);
    }, onFailSoHard);
  }
  
  document.getElementById('snapshot').onclick = function() { 
    var canvas = document.getElementById('canvas'); 
    var ctx = canvas.getContext('2d'); 
    ctx.drawImage(video,0,0); 
  } 
  &lt;/script&gt;
  </code></pre>
  
  <p>But how do you open device front camera via Phonegap. No pictures or video recorder is going to be taken but just display the front camera view. At the moment Phonegap camera plugin is installed, permissions are added and tested the example code on Phonegap that works fine but the code above only shows a Play symbol like in the picture.</p>
  
  <p><strong>Here are the permissions</strong>
  </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-feature android:name="android.hardware.camera"android:required="false" /&gt;
  &lt;uses-feature android:name="android.hardware.camera.front" android:required="false" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/bSAXh.png" alt="Image that shows on device with the above code"></p>
  
  <p>Phonegap version 3.1.0 API</p>