Skip to content

Interface: UseViewportResult

@roomful/react


@roomful/react / UseViewportResult

Defined in: react/src/index.ts:200

Describes the return value of useViewport.

broadcast: () => void

Defined in: react/src/index.ts:214

Starts streaming the local viewport to all peers.

Starts streaming the local viewport to all peers.

void

Nothing.


follow: (peerId) => void

Defined in: react/src/index.ts:234

Follows a specific peer’s viewport.

Follows a specific peer’s viewport, applying their scroll position to the mounted element as their viewport changes. Zoom is exposed in state for the app to apply.

string

The peer whose viewport to follow.

void

Nothing.


present: () => void

Defined in: react/src/index.ts:224

Enters present mode, forcing peers to follow the local viewport.

Enters present mode: broadcasts the local viewport and signals peers to follow it until ViewportEngine.stopPresenting is called.

void

Nothing.


ref: RefCallback<HTMLElement>

Defined in: react/src/index.ts:204

Callback ref that mounts the viewport engine on a scrollable container.


states: ViewportState[]

Defined in: react/src/index.ts:209

Exposes remote peer viewport states only.


stopBroadcast: () => void

Defined in: react/src/index.ts:219

Stops streaming the local viewport.

Stops streaming the local viewport.

void

Nothing.


stopPresenting: () => void

Defined in: react/src/index.ts:229

Leaves present mode and releases following peers.

Leaves present mode and releases peers that were following.

void

Nothing.


unfollow: () => void

Defined in: react/src/index.ts:239

Stops following any peer and resumes independent scrolling.

Stops following any peer and resumes independent scrolling.

void

Nothing.