useLobby

Acess the following methods & states joinLobby() leaveLobby() isLoading isLobbyJoined error .

NameTypeDescription
joinlobby(roomId: string, accessToken: string)Functionmoves the user to a pre-room lobby where they can toggle with audio/video controls before joining a room
leaveLobby()Functionremoves the user from the lobby back to the initialized state
isLoadingbooleanloading state
isLobbyJoinedbooleanstate for whether the user has joined the lobby
errorstringgives the error message

Sample Code

  import {Button, View} from 'react-native';
  import { useLobby } from '@huddle01/react-native/hooks';
  
  const App = () => {
    const { joinLobby, leaveLobby, isLoading, isLobbyJoined, error } = useLobby();
  
    return (
      <View>
        <View style={styles.button}>
          <Button
            title="JOIN_LOBBY"
            disabled={!joinLobby.isCallable}
            onPress={() => {
              joinLobby('YOUR_ROOM_ID');
            }}
          />
        </View>
 
        <View style={styles.button}>
          <Button
            title="LEAVE_LOBBY"
            disabled={!state.matches('Initialized.JoinedLobby')}
            onPress={leaveLobby}
          />
        </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.