use-screen-recorder
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

use-screen-recorder

React hook for easily recording screen using MediaStream APIs.

NPM JavaScript Style Guide

Demo

Install

yarn add use-screen-recorder

Usage

import * as React from "react";

import useScreenRecorder from "use-screen-recorder";

const Example = () => {
  const {
    blobUrl,
    pauseRecording,
    resetRecording,
    resumeRecording,
    startRecording,
    status,
    stopRecording,
  } = useScreenRecorder();

  return (
    <div>
      <video src={blobUrl} />

      <small>Status: {status}</small>

      <button onClick={startRecording}>Start Recording</button>
      <button onClick={stopRecording}>Stop Recording</button>
      <button onClick={pauseRecording}>Pause Recording</button>
      <button onClick={resumeRecording}>Resume Recording</button>
      <button onClick={resetRecording}>Reset Recording</button>
    </div>
  );
};

Props

audio

A boolean value indicating if audio track should be added.

type: boolean
default: false

options

A MediaRecorderOptions object.

type: object
default: {}

License

MIT © ishan-chhabra See the LICENSE file for more information


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i use-screen-recorder

Weekly Downloads

36

Version

1.0.2

License

MIT

Unpacked Size

3.33 MB

Total Files

28

Last publish

Collaborators

  • ishan-chhabra