useRecording

useRecording

useRecording hook allows you to use following methods & states.

NameTypeDescription
startRecording()Functionstarts recording the web app on the given sourceUrl
stoprecording()Functionstops the recording on the web app
isStartingbooleanstate whether the recording has started or not
inProgressbooleanstate whether the recording is in progress
isStoppingbooleanstate whether the recording has stopped or not
datadatadata of the recording
errorstringgives the error message

Sample code

 
  import { useRecording } from '@huddle01/react/hooks';
  
  const App = () => {
    const { startRecording,stoprecording, isStarting, inProgress isStopping, error } = useRecording();
 
    if(inProgress) return (<div>...loading</div>)
  
    return (
      <div>
        <button 
          disabled={!startRecording.isCallable} 
          onClick={startRecording};
        }>
          START_RECORDING
        </button>
 
        {isStarting ? "Recording is starting": error} 
 
 
        <button disabled={!stoprecording.isCallable} onClick={stoprecording}>
          STOP_RECORDING
        </button>
      </div>
    );
  };
 
 
 
 
Audio/Video Infrastructure designed for the developers to empower them ship simple yet powerful Audio/Video Apps.
support
company
Copyright © 2022 Graphene 01, Inc. All Rights Reserved.