Function: useConnection()
useConnection():
object
Defined in: packages/react-client/src/hooks/useConnection.ts:28
Hook allows to join or leave a room and check the current connection status.
Returns
object
joinRoom()
joinRoom: <
PeerMetadata
>(__namedParameters
) =>Promise
<void
>
Join room and start streaming camera and microphone
Type Parameters
Type Parameter | Default type |
---|---|
PeerMetadata extends GenericMetadata | GenericMetadata |
Parameters
Parameter | Type |
---|---|
__namedParameters | JoinRoomConfig <PeerMetadata > |
Returns
Promise
<void
>
leaveRoom()
leaveRoom: () =>
void
Leave room and stop streaming
Returns
void
peerStatus
peerStatus:
PeerStatus
Current peer connection status
reconnectionStatus
reconnectionStatus:
ReconnectionStatus
Current reconnection status