Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
react-vision-camera
Advanced tools
Camera component for React. We can use this component for computer vision tasks like barcode scanning, text recognition, etc.
Camera component for React using getUserMedia
. We can use this component for computer vision tasks like barcode scanning, text recognition, etc.
npm install react-vision-camera
import {VisionCamera} from 'react-vision-camera';
function App() {
const [isActive,setIsActive] = React.useState(true); //whether the camera is active
const [isPause,setIsPause] = React.useState(false); //whether the video is paused
const onOpened = (cam:HTMLVideoElement,camLabel:string) => { // You can access the video element in the onOpened event
console.log("opened");
}
const onClosed = () => {
console.log("closed");
}
const onDeviceListLoaded = (devices:MediaDeviceInfo[]) => {
console.log(devices);
}
return (
<div>
<VisionCamera
isActive={isActive}
isPause={isPause}
desiredCamera="back"
desiredResolution={{width:1280,height:720}}
onOpened={onOpened}
onClosed={onClosed}
onDeviceListLoaded={onDeviceListLoaded}
>
</VisionCamera>
</div>
)
}
How to specify which camera to use?
desiredCamera
prop. If one of the camera's name contains it, then it will be used. You can get the devices list in the onDeviceListLoaded
event.facingMode
prop. Set it to environment
to use the back camera. Set it to user
to use the front camera. Please note that this is not supported on Desktop.You can use the two props together. facingMode
has a higher priority.
MIT
FAQs
Camera component for React. We can use this component for computer vision tasks like barcode scanning, text recognition, etc.
The npm package react-vision-camera receives a total of 152 weekly downloads. As such, react-vision-camera popularity was classified as not popular.
We found that react-vision-camera demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.