Use getUserMedia with ionic get only black screen
<p>Im testing some media features with ionic and im stuck while trying to set the camera output into a video tag using getUserMedia using this code:</p>

<pre><code>navigator.getUserMedia = navigator.getUserMedia ||
                     navigator.webkitGetUserMedia ||
                     navigator.mozGetUserMedia;

if (navigator.getUserMedia) {
   navigator.getUserMedia({ audio: false, video: { width: 500, height: 500 } },
      function(stream) {
         console.log("Im streaming!!", stream);
         var video = document.querySelector('video');
         console.log("video element", video);
         video.src = window.URL.createObjectURL(stream);
         video.onloadedmetadata = function(e) {
            console.log("stream start");
            video.play();
         };
      },
      function(err) {
         console.log("The following error occurred: " + err.name);
      }
   );
} else {
   console.log("getUserMedia not supported");
}
</code></pre>

<p>this is the html:</p>

<pre><code>    &lt;ion-pane&gt;
      &lt;ion-header-bar class="bar-stable"&gt;
        &lt;h1 class="title"&gt;Ionic Blank Starter&lt;/h1&gt;
      &lt;/ion-header-bar&gt;
      &lt;ion-content&gt;
        &lt;video  id="video" autoplay="autoplay" width="500" height="500"&gt;&lt;/video&gt;
      &lt;/ion-content&gt;
    &lt;/ion-pane&gt;
</code></pre>

<p>i can actually get only a black screen. Is my approach right or im missing something?</p>