title: TypeError: Cannot read property 'capture' of undefined
body: <p>I am using the cordova Media Capture plugin but no possibility to make it work and I can't sort it out. </p>
  
  <p>The error : <code>TypeError: Cannot read property 'capture' of undefined</code></p>
  
  <p>So here is the controller I am using for my Ionic app, nothing seems to work so far. Any idea ?</p>
  
  <pre><code>.controller('recordController', ['$scope', '$timeout', '$state', '$document', '$firebaseArray', 'CONFIG', function($scope, $timeout, $state, $document, $firebaseArray, CONFIG) {
  
    document.addEventListener("deviceready", onDeviceReady, false);
  function onDeviceReady() {
      console.log(navigator.device.capture);
  }
  
    var captureSuccess = function(e) {
        console.log('captureSuccess');console.dir(e);
        $scope.sound.file = e[0].localURL;
        $scope.sound.filePath = e[0].fullPath;
    }
  
    $scope.recordAudio = function() {
        navigator.device.capture.captureAudio(
            captureSuccess,captureError,{duration:10});
    }
  
  
  
  
    var a = document.getElementById('tags');
    a.addEventListener('keyup',addthis);
  
    function addthis() {
        b = a.value.replace('#','');
        a.value = '#'+b
  
        if (a.value.indexOf(' '))
        {
        a.value = a.value.replace(' ','#');
        }
    }    
  }])
  </code></pre>