HTML5 webcam streaming javascript library, with front and back camera switch, also have take photo function.
npm install webcam-easy shell
git https://github.com/bensonruan/webcam-easy.git
`
#### OR Use NPM

` shell
npm install webcam-easy
`
Usage
#### 1. Include script tag in html
`html
`
or Import into javascript
` js
import Webcam from 'webcam-easy';
`
#### 2. Place elements in HTML
`html
`
#### 3. Call constructor in javascript
` js
const webcamElement = document.getElementById('webcam');
const canvasElement = document.getElementById('canvas');
const snapSoundElement = document.getElementById('snapSound');
const webcam = new Webcam(webcamElement, 'user', canvasElement, snapSoundElement);
`
#### 4. Start Webcam
` js
webcam.start()
.then(result =>{
console.log("webcam started");
})
.catch(err => {
console.log(err);
});
`
#### 5. Take Photo
` js
var picture = webcam.snap();
`
#### 6. Stop Webcam
` js
webcam.stop();
``