setLayout

View as MarkdownOpen in Claude
1setLayout(layout, positions): Promise<void>

Switches the call to a named video layout and (optionally) places specific members into reserved positions.

The set of valid layout names depends on the call’s room configuration and is exposed reactively via layouts$. Member position values come from VideoPosition.

Requires the setLayout capability — inspect call.capabilities$ before exposing layout controls.

Parameters

layout
stringRequired

Layout name. Must be one of the names emitted by layouts$.

positions
Record<string, VideoPosition>Required

Map of member IDs to VideoPosition values. Pass an empty object to let the server assign positions automatically.

Returns

Promise<void> — resolves once the server has applied the layout.

Throws

Rejects if layout is not in the call’s available layouts.

Examples

Switch to a grid layout

1await call.setLayout('grid-responsive', {});

Pin a member to a reserved slot

1await call.setLayout('1x1-with-presenter', {
2 [participantId]: 'reserved-0',
3});

See

  • layouts$ — observable list of available layout names.
  • layout$ — currently active layout.
  • layoutLayers$ — observable of position assignments.