mage-react-cam
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "mage-react-cam", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A React component for capturing camera input", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -13,2 +13,6 @@ ## Mage React Cam | ||
Here is a basic example of how to use mage-react-cam in your React project. | ||
Import and Basic Usage: | ||
``` | ||
@@ -47,3 +51,3 @@ import { MageReactCam } from 'mage-react-cam'; | ||
const handleZoomIn = () => { // use if need zoom + | ||
const handleZoomIn = () => { | ||
const zoomIn = videoRef?.current?.zoomIn; | ||
@@ -53,3 +57,3 @@ if (zoomIn) zoomIn(); | ||
const handleZoomOut = () => { // use if need zoom - | ||
const handleZoomOut = () => { | ||
const zoomOut = videoRef?.current?.zoomOut; | ||
@@ -124,2 +128,5 @@ if (zoomOut) zoomOut(); | ||
/> | ||
<button onClick={handlerSnapshot}>Take Snapshot</button> | ||
<button onClick={handleZoomIn}>Zoom In</button> | ||
<button onClick={handleZoomOut}>Zoom Out</button> | ||
</div> | ||
@@ -131,1 +138,15 @@ ); | ||
``` | ||
# Props | ||
- onUserMediaError: Function called when there is an error accessing the camera. | ||
- videoConstraints: Media constraints for the video. | ||
- width: Width of the video. | ||
- height: Height of the video. | ||
- facingMode: Defines which camera to use ("environment" for the back camera and "user" for the front camera). | ||
# Methods | ||
- snapshot: Takes a snapshot of the current video stream and returns the image as a data URL. | ||
- zoomIn: Increases the camera zoom. | ||
- zoomOut: Decreases the camera zoom. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9635
7
148