Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mage-react-cam

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mage-react-cam - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

LICENSE

2

package.json
{
"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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc