1.0.1 • Published 8 years ago

pitchly-webcamjs v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Webcam.js

Webcam interface, written entirely in ECMAScript 6 using HTML5's getUserMedia and MediaDevices APIs. No external dependencies. Each call returns a Promise. Works in Chrome and Firefox.

Example:

<video id="videoElement" muted="true" >
<script src="https://raw.githubusercontent.com/pitchly/webcamjs/master/webcam.js"></script>
<script>
  window.webcam.init().then(function() {
    var videoElement = document.getElementById("videoElement");
    videoElement.src = window.webcam.videoStream;
    videoElement.play();
  }).catch(function(error){
    console.log(error);
  });
</script>