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 {Button, Text, View} from 'react-native';
  import {useRecording} from '@huddle01/react-native/hooks';
  
  const App = () => {
    const { startRecording, stoprecording, isStarting, inProgress isStopping, error } = useRecording();
 
    if(inProgress) return (<View><Text>Loading...</Text></View>)
  
    return (
      <View>
         <View style={styles.button}>
          <Button
            title="START_RECORDING"
            disabled={!startRecording.isCallable} 
            onPress={startRecording}
          />
        </View>
 
        {isStarting ? <Text>"live stream is starting"</Text>: error} 
 
        <View style={styles.button}>
          <Button
            title="STOP_RECORDING"
            disabled={!stopRecording.isCallable}
            onPress={stopRecording}
          />
        </View>
      </View>
    );
  };
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.