Call Control Actions

Preview of the Call controls component.

Call control actions allow users to execute actions during a call (for example, start recording), and/or before joining (for example, mute/unmute microphone). The built-in CallControls component displays all relevant call controls during a call. Each call control is available to use as separate component.

General usage

The CallControls component displays the available call 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

This component can be used to leave a call or end the call for all participants but only if the particpant has the requiredGrants 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 show to let the particpant 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.

© Getstream.io, Inc. All Rights Reserved.