Record Screen Using MediaStream APIs – use-screen-recorder

use-screen-recorder is a React hook for easily recording screen using MediaStream APIs.

How to use it:

1. Install and import the use-screen-recorder.

# Yarn
$ yarn add use-screen-recorder

# NPM
$ npm i use-screen-recorder --save
import * as React from "react";
import useScreenRecorder from "use-screen-recorder";

2. Basic usage.

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>
  );
};

Preview:

Record Screen Using MediaStream APIs - use-screen-recorder

Download Details:

Author: ishan-chhabra

Live Demo: View The Demo

Download Link: Download The Source Code

Official Website: https://github.com/ishan-chhabra/use-screen-recorder

License: MIT

You Might Be Interested In:

Add Comment