
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
react-webcam-capture
Advanced tools
react-webcam-capture is Multimedia capturing module via React, using HTML5 MediaDevice and MediaRecorder API
react-webcam-capture is module for capturing multimedia from WebBrowser via React. It uses navigator.mediaDevices.getUserMedia and MediaRecorder API, so make sure that your browser supports.
yarn add react-webcam-capture
import ReactWebCamCapture from 'react-webcam-capture';
class VideoExample extends Component {
...
render() {
return (
<div ref='app'>
...
<h1>Video Recording Example</h1>
<hr />
<ReactWebCamCapture
constraints={{ audio: true, video: true }}
timeSlice={10}
onGranted={this.handleGranted}
onDenied={this.handleDenied}
onStart={this.handleStart}
onStop={this.handleStop}
onPause={this.handlePause}
onResume={this.handleResume}
onError={this.handleError}
render={({ start, stop, pause, resume }) =>
<div>
<p>Granted: {granted.toString()}</p>
<p>Rejected Reason: {rejectedReason}</p>
<p>Recording: {recording.toString()}</p>
<p>Paused: {paused.toString()}</p>
<button onClick={start}>Start</button>
<button onClick={stop}>Stop</button>
<button onClick={pause}>Pause</button>
<button onClick={resume}>Resume</button>
<p>Streaming test</p>
<video autoPlay></video>
</div>
} />
</div>
);
}
}
Set the getUserMedia constraints. Default is { video: true, audio: true }.
Set the class name of the element.
Set mimeType for MediaRecorder API. It uses 'video/webm;codecs=vp8' by default. If you are trying to record Audio, you should use 'audio/webm' instead.
Set time slice of mediaRecorder.start.
Handler that fires on browser acquired permission to access media devices.
Handler that fires on browser denied permission to access media devices.
Handler that fires on user started recording.
Handler that fires on user stopped recording.
Handler that fires on user paused recording.
Handler that fires on user resumed recording.
Handler that fires on error occurs. This also could be fired if the browser not support getUserMedia and mediaRecorder API.
Render the child components with functions. Each function actually manipulate recording related jobs into parent like VideoRecorder or AudioRecorder.
FAQs
react-webcam-capture is Multimedia capturing module via React, using HTML5 MediaDevice and MediaRecorder API
The npm package react-webcam-capture receives a total of 34 weekly downloads. As such, react-webcam-capture popularity was classified as not popular.
We found that react-webcam-capture 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.