Function: usePeers()
usePeers<
PeerMetadata
,ServerMetadata
>():object
Hook that provides live updates of room peers.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
PeerMetadata extends GenericMetadata | GenericMetadata | Type for peer-specific metadata |
ServerMetadata extends GenericMetadata | GenericMetadata | Type for server-specific metadata |
Returns
object
localPeer
localPeer:
null
|PeerWithTracks
<PeerMetadata
,ServerMetadata
>
The local peer with distinguished tracks (camera, microphone, screen share). Will be null if the local peer is not found.
peers
peers:
Peer
<PeerMetadata
,ServerMetadata
>[]
Deprecated
Use localPeer and remotePeers instead Legacy array containing all peers (both local and remote) without distinguished tracks. This property will be removed in future versions.
remotePeers
remotePeers:
PeerWithTracks
<PeerMetadata
,ServerMetadata
>[]
Array of remote peers with distinguished tracks (camera, microphone, screen share).