toggleHold

View as MarkdownOpen in Claude
1toggleHold(): Promise<void>

Toggles the call between active and on-hold. When on hold, the local peer stops sending audio and video, and the remote side typically hears hold music played by the server.

Hold is a call-level state distinct from per-track muting. To silence just the local microphone without affecting the call’s hold status, use the Participant audio-mute methods on call.self.

The action requires the hold capability on the call — inspect call.capabilities$ before exposing the control in your UI.

Returns

Promise<void> — resolves once the server has acknowledged the state change.

Examples

Toggle on a button click

1holdButton.addEventListener('click', async () => {
2 await call.toggleHold();
3});

Conditional UI based on capability

1import { combineLatest } from 'rxjs';
2
3combineLatest([call.capabilities$, call.status$]).subscribe(([caps, status]) => {
4 holdButton.disabled = !caps.includes('hold') || status !== 'connected';
5});