React library selecting webcam
React library for Webcam Selection. Please see document for further information. This project is created using create-react-library.
Install
npm install --save @rubenchoi/webcam
Usage
import React from 'react'
import { WebcamComponent } from '@rubenchoi/webcam';
import '@rubenchoi/webcam/dist/index.css'
const App = () => {
const onStream = (stream) => console.log(stream);
const onMute = (muted) => console.log(muted ? 'muted' : 'unmuted')
return (
<div>
<h2>React App Webcam Test</h2>
<div style={{ width: '40vw', margin: '1em' }}>
<WebcamComponent onStream={onStream} onMute={onMute} audioTest={true} />
</div>
</div >
)
}
export default App
License
MIT © rubenchoi