Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

recorder-capture

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recorder-capture

Using this library, you can record a screen with audio, stream a user cam, and take a screenshot of a webpage.

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

screencastify

Using this library, you can record a screen with audio, stream a user cam, and take a screenshot of a webpage.

🎁 Features

  • Easy to use
  • Compatible with both JavaScript and TypeScript
  • Record the screen with audio
  • Stream the user cam
  • Take a screenshot of the webpage's screen or part of the screen

🔧 Installation

npm i screencastify

🔰 Methods

MethodDescription
startRecording()To start screen recording and get screen stream object.
stopRecording()To end screen recording and get base64 source.
takeScreenshot()To capture the screenshot and get base64 source.
streamUserCam()To stream user cam and get the stream object

💡 Usage

1) To take the screenshot

takeScreenshot() method is used for taking the screenshot

import { takeScreenshot } from "screencastify";

const handleScreenshot = () => {
  const screenshot = takeScreenshot();
  // in this variable you get the screenshot captured
};
<button onClick={() => handleScreenshot()}>Take ScreenShot</button>;

2) To Record the screen

startRecording method is used for start the screen recording and startRecording method is used for stop the screen recording and it gives the video in base64 format.

import { startRecording, stopRecording } from "screencastify";

const handleStopRecording = () => {
  const recording = stopRecording();
  // in this variable you get the screen recoding
};
<button onClick={() => startRecording()}>start recording</button>;

3) To Stream user camera

streamUserCam() method is used for stream the user cam

import React, { useEffect, useRef } from "react";
import { streamUserCam } from "recorder-capture";

const UserCam = () => {
  let videoRef = useRef(null);

  const getUserVideo = async () => {
    const stream = await streamUserCam();
    //in this variable you get the stream object
    let video = videoRef.current;
    video.srcObject = stream;
    video.play();
  };

  useEffect(() => {
    getUserVideo();
  }, [videoRef]);

  return (
    <div>
      {/* In this video tag you get the the stream of user cam */}
      <video ref={videoRef}></video>
    </div>
  );
};

export default UserCam;

🤝Contributing

Feel free to submit a PR on github if you found a bug or if you want to enhance it further.

Thanks!. Happy Recording!

Keywords

FAQs

Package last updated on 10 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc