Shinigami Hooks
useRoomControls

useRoomControls

The useRoomControls hook allows you to read and update the room's controls.

const {
    room,
    state,
    joinRoom,
    leaveRoom,
    closeRoom,
  } = useRoomControls({
    onJoin(data) {},
    onClose() {},
    onLeave() {},
  });

Props

The useRoomControls hook accepts an object with the following fields as props.

1. onRoomControlsUpdatedOptionalAdvanced
DescriptionReturn Type
This function will be called when the room controls have been updated.void
Parameter NameTypeDescriptionRequired
dataTNewRoomControlsObject containing the new room controls.Yes
Example Usage
const roomControls = useRoomControls({ onJoin: (data) => {
	console.log("Room controls updated!");
	console.log(data);
    // your code here
}});

Returns

The useRoomControls hook returns an object with the following fields.

1. roomControlsObjectAdvanced
DescriptionType
The state of the currently joined room.TRoomControls
2. updateControlsFunctionAdvanced
DescriptionReturn Type
Update the room control.void
Parameter NameTypeDescriptionRequired
dataTNewRoomControlsObject containing the type of room control to be updated and it’s new value.Yes
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.