react-barcode-qrcode-scanner alternatives and similar libraries
Based on the "Audio / Video" category.
Alternatively, view react-barcode-qrcode-scanner alternatives based on common mentions on social networks and blogs.
-
react-player
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion -
video-react
A web video player built for the HTML5 world using React library. -
react-youtube
react.js powered YouTube player component -
react-soundplayer
๐ป Create custom web audio players with React -
react-video
๐ React component to load video from Vimeo or Youtube across any device. -
material-ui-audio-player
Audio player react component for material ui design -
react-dailymotion
Dailymotion player component for React. -
react-vision-camera
React Camera component
AWS Cloud-aware infrastructure-from-code toolbox [NEW]
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of react-barcode-qrcode-scanner or a related project?
README
react-barcode-qrcode-scanner
Barcode and QR Code Scanner Component for React. It uses react-vision-camera to access the camera and Dynamsoft Barcode Reader to read barcodes.
Installation
npm install react-barcode-qrcode-scanner
Usage
import { BarcodeScanner } from "react-barcode-qrcode-scanner";
import { TextResult } from "dynamsoft-javascript-barcode";
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 [runtimeSettings,setRuntimeSettings] = React.useState("{\"ImageParameter\":{\"BarcodeFormatIds\":[\"BF_QR_CODE\"],\"Description\":\"\",\"Name\":\"Settings\"},\"Version\":\"3.0\"}"); //use JSON template to decode QR codes only
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);
}
const onScanned = (results:TextResult[]) => { // barcode results
console.log(results);
}
const onClicked = (result:TextResult) => { // when a barcode overlay is clicked
alert(result.barcodeText);
}
const onInitialized = () => { // when the Barcode Reader is initialized
setInitialized(true);
}
return (
<div>
<BarcodeScanner
isActive={isActive}
isPause={isPause}
license="license key for Dynamsoft Barcode Reader"
drawOverlay={true}
desiredCamera="back"
desiredResolution={{width:1280,height:720}}
runtimeSettings={runtimeSettings}
onScanned={onScanned}
onClicked={onClicked}
onOpened={onOpened}
onClosed={onClosed}
onInitialized={onInitialized}
onDeviceListLoaded={onDeviceListLoaded}
>
</BarcodeScanner>
</div>
)
}
FAQ
How to specify which camera to use?
- Use the
desiredCamera
prop. If one of the camera's name contains it, then it will be used. You can get the devices list in theonDeviceListLoaded
event. - Use the
facingMode
prop. Set it toenvironment
to use the back camera. Set it touser
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.
License
MIT
*Note that all licence references and agreements mentioned in the react-barcode-qrcode-scanner README section above
are relevant to that project's source code only.