Call Control Actions

Preview of the Call controls component.

Call controls allow users to execute actions during a call (e.g., start recording) or before joining (e.g., mute/unmute). The built-in CallControls component displays controls based on user permissions. Each control is also available as a separate component.

Best Practices

  • Use CallControls for standard call UIs - it handles permissions automatically.
  • Use individual control components (e.g., ToggleAudioPublishingButton) for custom layouts.
  • Provide onLeave callback to handle post-call navigation.

General usage

CallControls displays available controls based on user permissions:

import "@stream-io/video-react-sdk/dist/css/styles.css";
import {
  Call,
  CallControls,
  StreamCall,
  SpeakerLayout,
} from "@stream-io/video-react-sdk";

const MyCallUI = () => {
  let call: Call;

  return (
    <StreamCall call={call}>
      <SpeakerLayout />
      <CallControls />
    </StreamCall>
  );
};

Props

onLeave

Type
() => void | undefined

A callback to be called after the call is left using the hangup button.

Built-in call controls

Each call control is available as a separate UI component. Each component takes care of authorization.

AcceptCallButton

This component is used in the ringing call component to accept an incoming call.

Props

NameDescriptionType
disabledSet true to disable the buttonboolean | undefined
onClickEvent handler to override the default click behaviorMouseEventHandler<HTMLButtonElement> | undefined
onAcceptCustom event handler to call after the call was joined() => void | undefined

CancelCallButton

This component can be used to leave a call or to reject an incoming/outgoing call.

Props

NameDescriptionType
disabledSet true to disable the buttonboolean | undefined
onClickEvent handler to override the default click behaviorMouseEventHandler<HTMLButtonElement> | undefined
onLeaveCustom event handler to call after the call was left() => void | undefined

CancelCallConfirmButton

Use this component to leave a call or end it for all participants, only if the participant has OwnCapability.END_CALL.

Props

NameDescriptionType
disabledSet true to disable the buttonboolean | undefined
onClickEvent handler to override the default click behaviorMouseEventHandler<HTMLButtonElement> | undefined
onLeaveCustom event handler to call after the call was left() => void | undefined

ReactionsButton

This component can be used to send reactions during a call. The following reactions are supported by default:

  • like 👍
  • raise hand ✋
  • fireworks 🎉

Props

NameDescriptionType
reactionsOverride or extend the default reactions/emojisStreamReaction[] | undefined

RecordCallButton

This component can be used to start/stop call recording. It's also used as a visual indicator to let participants know if there is an ongoing call recording.

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

RecordCallConfirmationButton

This component can be used to start/stop a call recording. A confirmation will be shown to let the participant cancel or confirm to ending the recording that is in progress.

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

ScreenShareButton

This component can be used to start/stop screen sharing. It's also used as a visual indicator to let participants know if there is an ongoing screen share. This component only allows a single ongoing screen share.

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

ToggleAudioPreviewButton

This component can be used to toggle the initial audio state in the lobby preview.

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

ToggleAudioPublishingButton

This component can be used to

  • mute/unmute the microphone during a call
  • select an audio input device during a call

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

ToggleAudioOutputButton

This component can be used to select the audio output device (if the currently used browser supports audio output selection).

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

ToggleVideoPreviewButton

This component can be used to toggle the initial video state in the lobby preview.

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

ToggleVideoPublishingButton

This component can be used to

  • mute/unmute the camera during a call
  • select a video input device during a call

Props

NameDescriptionType
captionThe explanatory text displayed under the control buttonstring | undefined

CallStatsButton

The component can be used to show/hide the call statistics.

Props

None

Customization

You can create your own custom component using the built-in call controls as building blocks.

If you want to create custom call controls, follow the Call Controls UI Cookbook guide for more information.