1.0.0 • Published 6 years ago

@kylar101/recorder.js v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

Recorder.js

A media recording library that allows recording using video and audio

Usage

Install and Setup

npm install @kylar101/recorder.js
import Recorder from '@kylar101/recorder.js'

To create the recorder instance:

JavaScript

var rec = new Recorder({ containerID: 'recorderContainer' })

The recorder constructor takes one arguments, the id for the HTML container.

The constructor will add a start and stop button into the container that is specified.

HTML

<div id='recorderContainer'>
    <!-- Whatever you want - the recorder controls will be inserted after -->
</div>

Configuration

Media Type

The recorder default media type is audio. To set the instance to a particular type, use the following function

rec.setMediaType('video')
// or
rec.setMediaType('audio')

To toggle the media type, use the following function

rec.toggleMediaType()

Inialization

To inialize the recorder for use, use the following function

rec.initialiseMedia()

NOTE: If you change the media type after initialization, you will need to reinialize the recorder

rec.initialiseMedia()
rec.toggleMediaType()
rec.initialiseMedia()