Angular 2 and instantiation of a camera stream with html 5 video
<p>I'm new to Angular 2.</p>

<p>If I have a video tag, like : </p>

<pre><code>&lt;video width="480" height="480" autoplay&gt;&lt;/video&gt;    
</code></pre>

<p>And a javascript example snippet to open the camera stream :</p>

<pre><code>var video = document.getElementById('video');
if(navigator.mediaDevices &amp;&amp; navigator.mediaDevices.getUserMedia) {
  navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
      video.src = window.URL.createObjectURL(stream);
      video.play();
  });
}
</code></pre>

<p>In Angular 2 + Typescript I suppose I can access the video tag like : </p>

<pre><code>@Component({
  selector: 'video-component',
  template: `
    &lt;video #videoplayer autoplay&gt;&lt;/video&gt;
  `
})
export class Video {
 @ViewChild('videoplayer') videoPlayer;
  ngAfterViewInit() {
    let video = document.getElementById('video');

    // How to access the mediadevice ??

  }
}
</code></pre>

<p>How can I access the media device and instantiate the stream like illustrated in the javascript snippet ? </p>