1.0.3 • Published 1 year ago
simple-react-webcam v1.0.3
simple-react-webcam
A simple react component to access your webcam in your React Project.
Installation
Install simple-react-webcam using NPM with the following command.
npm install simple-react-webcamUsage
import React from 'react';
import SimpleReactWebcam from 'simple-react-webcam';
const WebcamComponent = () => {
return (
<SimpleReactWebcam />
);
};Props
| Prop Name | Type | Default | Notes |
|---|---|---|---|
| className | string | className for the underlying video tag | |
| requestDeclinedCallback | function | () => {}; | Callback function which is triggerred when camera permission denied |
Methods
getCapturedImage - Returns a base64 encoded string of the current webcam image.
Example:
getCapturedImage();