use-screen-recording
v2.0.0
Published
Easily create screen recordings using React Hooks.
Downloads
137
Readme
use-screen-recording
Easily create screen recordings using a React Hook.
Install
npm install --save use-screen-recording
Usage
import React from "react";
import useScreenRecording from "use-screen-recording";
export default function App() {
const { isRecording, recording, toggleRecording } = useScreenRecording();
return (
<div>
<button onClick={toggleRecording}>
{isRecording ? "Stop" : "Start Recording"}
</button>
{!!recording && (
<video autoPlay src={recording && URL.createObjectURL(recording)} />
)}
</div>
);
}
License
MIT © tylerbuchea
This hook is created using create-react-hook.