npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@devmartynov/react-media-recorder

v1.0.2

Published

> audio/video recorder which is used [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API), [Media Stream API](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream), [Media Devices API](https://developer.mozilla.org/en-US

Downloads

62

Readme

@devmartynov/react-media-recorder NPM

audio/video recorder which is used Web Audio API, Media Stream API, Media Devices API

In progress:

  • [ ] Video format support

Install

npm install --save @devmartynov/react-media-recorder

or

yarn add @devmartynov/react-media-recorder

Props

| Property name | Type | Return type | Default | Description | |-----------------| ------ |-------------|------------------------------|-------------------------------------------------| | status | string | - | RecordingStatusEnum.INACTIVE | RecordingStatusEnum.(INACTIVE,RECORDING,PAUSED) | | recording | string | - | - | Result blob url. | | timer | number | - | - | Record timer (in secs). | | startRecording | method | Promise | - | Call this method to start recording. | | stopRecording | method | Promise | - | Call this method to stop recording. | | pauseRecording | method | Promise | - | Call this method to pause recording. | | resumeRecording | method | Promise | - | Call this method to resume recording. |

Usage (Class Version)

import React, { Component } from 'react'

import { ReactMediaRecorder, RecordingStatusEnum } from '@devmartynov/react-media-recorder';

class Example extends Component {
    render() {
        return (
            <ReactAudioRecorder
                render={({
                    timer,
                    stopRecording,
                    startRecording,
                    resumeRecording,
                    pauseRecording,
                    recording,
                    status,
                }) => (
                    <div className='container'>
                        <div className='inner-container'>
                            <audio controls src={recording}/>
                            <p
                                className={`timer ${
                                    status === RecordingStatusEnum.PAUSED ? 'blink-animation' : ''
                                }`}
                            >
                                {new Date(timer * 1000).toISOString().substring(11, 19)}
                            </p>
                            <div className='buttons'>
                                <button
                                    className='btn-play'
                                    onClick={
                                        status === RecordingStatusEnum.RECORDING
                                            ? pauseRecording
                                            : resumeRecording
                                    }
                                >
                                    {status === RecordingStatusEnum.RECORDING ? '⏸' : '▶️'}
                                </button>
                                <button className='btn-record' onClick={startRecording}>
                                    🎤
                                </button>
                                <button className='btn-stop' onClick={stopRecording}>
                                    ⏹
                                </button>
                            </div>
                        </div>
                    </div>
                )}
            />
        )
    }
}

Usage (Hooks Version)

import React from 'react'

import { useMediaRecorder, RecordingStatusEnum } from '@devmartynov/react-media-recorder';

function Example() {
    const {
        recording,
        timer,
        startRecording,
        stopRecording,
        pauseRecording,
        resumeRecording,
        status,
    } = useMediaRecorder();

    return (
        <div className='container'>
            <div className='inner-container'>
                <audio controls src={recording}/>
                <p
                    className={`timer ${
                        status === RecordingStatusEnum.PAUSED ? 'blink-animation' : ''
                    }`}
                >
                    {new Date(timer * 1000).toISOString().substring(11, 19)}
                </p>
                <div className='buttons'>
                    <button
                        className='btn-play'
                        onClick={
                            status === RecordingStatusEnum.RECORDING
                                ? pauseRecording
                                : resumeRecording
                        }
                    >
                        {status === RecordingStatusEnum.RECORDING ? '⏸' : '▶️'}
                    </button>
                    <button className='btn-record' onClick={startRecording}>
                        🎤
                    </button>
                    <button className='btn-stop' onClick={stopRecording}>
                        ⏹
                    </button>
                </div>
            </div>
        </div>
    );
}

This project is based on @sarafhbk/react-audio-recorder but extends its functionality.

License

MIT © devmartynov