1.2.21 • Published 3 years ago

decooda-media-recorder v1.2.21

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

decooda-media-recorder

Description

The decooda-media-recorder or media visualizer is a js library for recording video (h.264) and audio (opus) in frontend applications. The base component has four main stages: initial, recording, playback, and submission. It also serves as a media player to either play only audio with visualizer bars or only video.

Demo

https://decooda-media-recorder.netlify.app/

NPM site with latest version

https://www.npmjs.com/package/decooda-media-recorder

Installation and run commands for local testing

Node version v14.8.0 and npm version 6.14.11 are used for development.

First run

npm install

to in install all packages. Finally run

npm start

to open a webpage of the decooda-media-recorder dashboard

Installation in app (React)

In root directory of app run:

npm install decooda-media-recorder

Usage (React)

Import the library

import MediaRecorder from 'decooda-media-recorder'

The media recorder (visualizer) accepts the following props:

NameTypeDefaultDescription
audioIDstringnullRequired if audioVisualizer is set to true; Also, for multiple renders of the audio visualizer, please provide a unique audioID
audioLinkDataobject {}audio link data to display; please follow the example below
audioOnlyboolfalseif true, audio recording only; also, only audio option in media upload
audioVisualizerboolfalseif true, no recording; only play audio with visualizer bars; MUST include audioLinkData
barsIDstringnullRequired if audioVisualizer is set to true; Also, for multiple renders of the audio visualizer, please provide a unique barsID
fileOnlyboolfalseif true, file upload only option in media upload
getRecordedBlobfuncfunction passed by host to library to retrieve the recorded blob
heightstring"auto"set height of media recorder
insertTitleboolfalseif true, will prompt user for title of media
recordingControlsbooltrueif true, it will display controls during video recording
showLinkBtnbooltrueif true, will show insert link button
showUploadBtnbooltrueif true, will show upload media button
videoOnlyboolfalseif true, video recording only; also only video option in media upload
widthstring"100%"set width of media recorder

To ONLY play audio with visualizer bars:

Set the audioVisualizer to true

<MediaRecorder
  ...
 audioVisualizer={true} 
  ...
/>

Supply the audio data; please follow this example:

const audioLinkData = 
{ 
  "name": "test", 
  "type": "ogg", 
  "date": "April 30, 2021 9:00AM", 
  "link": "https://actions.google.com/sounds/v1/ambiences/dmv_background_noise.ogg"
}

Supply a unique barsID

<MediaRecorder
  ...
  barsID="audio-bars"
  ...
/>

To do something with the recorded blob, pass a function:

//sends the recorded blob obj to the host to save, upload, etc:
const getRecordedBlob = (blob) => {
  console.log(blob)
  /*
  output:
  {
    //title if user prompted
    title: "test"
    time: date,
    //the raw recorded blob
    blobRaw: recordedBlob,
    //the blob url
    blobURL: url
    //the blob as a data url
    blobFile: file
  }
  */
  //do something with blob
}
1.2.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.0.9

3 years ago

1.2.6

3 years ago

1.0.8

3 years ago

1.2.5

3 years ago

1.0.7

3 years ago

1.2.4

3 years ago

1.0.6

3 years ago

1.2.3

3 years ago

1.0.5

3 years ago

1.2.2

3 years ago

1.0.4

3 years ago

1.2.1

3 years ago

1.0.3

3 years ago

0.3.0

3 years ago

1.2.12

3 years ago

1.2.13

3 years ago

1.2.10

3 years ago

1.2.11

3 years ago

1.2.16

3 years ago

0.3.2

3 years ago

1.2.17

3 years ago

0.3.1

3 years ago

1.2.14

3 years ago

1.2.15

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.2.18

3 years ago

1.2.19

3 years ago

1.2.20

3 years ago

1.2.21

3 years ago

1.2.9

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago