toggleLock

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

Toggles the call’s locked state. While locked, the server rejects new join requests; participants already on the call are unaffected. Useful for closing the door on a meeting once everyone expected has arrived.

The current state is reflected by locked$. Requires the lock capability — inspect call.capabilities$ before exposing the control in your UI.

Returns

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

Examples

Toggle from a UI button

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

Reflect lock state in the UI

1call.locked$.subscribe((locked) => {
2 lockButton.textContent = locked ? 'Unlock' : 'Lock';
3});

See

  • locked$ — observable of the current lock state.