githubEdit

GridClient

const grid = client.getGrid()

RoomConnectionClient manages entire room connection. It exposes state subscriptions and provides actions to manage and observe remoteParticipants and in room actions. Room connection s retrieved from the WherebyClient.

Utilities

Method
Returns
Description

getState

GridState

Returns the entire grid state

destroy

void

Destroy the RoomConnectionClient instance.

State Subscriptions

All subscribe methods follow this format:

  • Call signature: subscribeX(callback: (payload: T) => void: () => void

  • Contract: Invokes a callback on initial subscription and whenever the state changes.

  • Returns: an unsubscribe function

Methods

Method
Payload Type
Description

subscribeClientViews

clientViews: ClientView[]

Emits client views

subscribeSpotlightedParticipants

spotlighted:ClientView[]

Emits spotlighted client views

subscribeNumberOfClientViews

num:number

Emits number of client views

Actions

Method
Parameters
Returns
Description

spotlightParticipant

id: string

void

Spotlights the specified participant

removeSpotlight

id: string

void

Removes spotlight on specified participant (if spotlighted)

Events

GridClient extends EventEmitter . You can listen to lifecycle and state change events directly:

Event (constant)
Event name (string)
Payload
Emitted when

CLIENT_VIEW_CHANGED

grid:client-view-changed

clientViews: ClientView[]

Client view changes

CLIENT_VIEW_SPOTLIGHTS_CHANGED

grid:client-view-spotlights-changed

clientViews: ClientView[]

Client is spotlighted

NUMBER_OF_CLIENT_VIEWS_CHANGED

grid:number-of-client-views-changed

numClients: number

Number of client views change

Last updated

Was this helpful?