title: Is there a way to access the camera over http in Angular 8
body: <p>Im using Angular 8 to access the webcam over the browser. </p>
  
  <pre><code>startCamera() {
      if (!!(navigator.mediaDevices &amp;&amp; navigator.mediaDevices.getUserMedia)) { 
        navigator.mediaDevices.getUserMedia(this.constraints).then(this.attachVideo.bind(this)).catch(this.handleError);
      } else {
          alert('Sorry, camera not available.');
      }
    }
    handleError(error) {
      console.log('Error: ', error);
    }
  
    attachVideo(stream) {
      this.renderer.setProperty(this.videoElement.nativeElement, 'srcObject', stream);
      this.renderer.listen(this.videoElement.nativeElement, 'play', (event) =&gt; {
          this.videoHeight = this.videoElement.nativeElement.videoHeight;
          this.videoWidth = this.videoElement.nativeElement.videoWidth;
      });
  
    }
  
    capture() {
      this.renderer.setProperty(this.canvas.nativeElement, 'width', this.videoWidth);
      this.renderer.setProperty(this.canvas.nativeElement, 'height', this.videoHeight);
      this.canvas.nativeElement.getContext('2d').drawImage(this.videoElement.nativeElement, 0, 0);
      var data_uri = this.canvas.nativeElement.toDataURL("image/png")
      this.visitor.photoFileName = data_uri
  
    }
  </code></pre>
  
  <p>when I start my app on localhost it works but over Http it doesn't. is there a way or a library to make this work?</p>