fss-audio-recorder-plugin
v1.2.12-a
Published
This plugin provides a hook used only by the frt user to record and upload to the fss server
Downloads
600
Readme
FSS Audio Recorder Plugin
This plugin provides a hook used only by the frt user to record and upload to the fss server
- Example:
import useFssAudioRecord from "fss-audio-recorder-plugin";
const code = "eyJhb..."; // jwt code from fss
const Audio = () => {
const { startRecording, stopRecording, recordingTime } =
useFssAudioRecord(code, (err) => console.log(err));
return (
<div>
<span>{recordingTime}</span>
<br />
<button onClick={() => startRecording()}>
start
</button>
<button onClick={() => stopRecording()}>stop</button>
</div>
);
};
export default Audio;
| Params | Description | Require |
| :------------ |:---------------|:---------------|
| code
| jwt code provided by fss | True |
| callback
| The function will execute when an error occurs during recording | False |
The hook returns the following:
| Identifiers | Description |
| :------------ |:---------------|
| startRecording
| Invoking this method starts the recording. Sets isRecording
to true
|
| stopRecording
| Invoking this method stops the recording in progress. Sets isRecording
to false
|
| recordingTime
| Number of seconds that the recording has gone on. This is updated every second |
| isRecording
| Status reflects whether the user is recording or not |
| mediaRecorder
| The current mediaRecorder in use. Can be undefined in case recording is not in progress |
Release Notes
Version 1.2.12a
Feature:
- Update the callbackOnError structure to return an error object instead of a string.
- Add jwt token to callbackOnError.