Easily create screen recordings using a React Hook.
npm install --save use-screen-recording
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>
);
}
If you'd like to contribute you can start hacking on the library right away using the CodeSandbox Project.
MIT © tylerbuchea
This hook is created using create-react-hook.