Call Preferences Configuration

Call preferences allow you to configure various aspects of call behavior and performance. These settings control timeouts, reaction behavior, statistics reporting, and other call-specific functionality that affects the user experience during video calls.

Accessing Call Preferences

You can access the current preferences through the call state:

var preferences = call.state.value.preferences;

Available Preference Properties

PropertyTypeDefault ValueDescription
connectTimeoutDurationDuration(seconds: 60)The maximum duration to wait when establishing a connection to the call. If the connection is not established within this timeout, the connection attempt will be cancelled.
reconnectTimeoutDurationDuration(seconds: 30)The maximum duration to wait when reconnecting to the call. If the connection is not established within this timeout, the reconnection attempt will be cancelled and the user will disconnect from the call.
networkAvailabilityTimeoutDurationDuration(seconds: 10)The maximum duration to wait for network availability before timing out. If the network is not available within this timeout, the call will be considered disconnected.
reactionAutoDismissTimeDurationDuration(seconds: 5)The duration after which call reactions (like emoji reactions) automatically disappear from the UI.
callStatsReportingIntervalDurationDuration(seconds: 2)The interval at which call statistics are reported and updated. This controls how frequently metrics like bandwidth, latency, and quality statistics are collected and reported.
dropIfAloneInRingingFlowbooltrueWhether to automatically drop the call if the user is alone in the ringing flow. When true, if all participants leave the call initiated by ringing, the call will be automatically ended.
closedCaptionsVisibilityDurationMsint2700The duration in milliseconds that closed captions remain visible on screen before being automatically hidden.
closedCaptionsVisibleCaptionsint2The maximum number of closed caption lines that can be visible simultaneously on screen.
clientPublishOptionsClientPublishOptions?nullConfiguration options for client-side publishing settings. Manually setting preferred codec can cause call stability/compatibility issues. Use with caution.

Setting Custom Call Preferences

You can customize call preferences when creating a call:

final call = streamVideo.makeCall(
  callType: StreamCallType.defaultType(),
  id: 'my-call-id',
  preferences: DefaultCallPreferences(
    connectTimeout: Duration(seconds: 30),
    reactionAutoDismissTime: Duration(seconds: 3),
    dropIfAloneInRingingFlow: false,
    closedCaptionsVisibleCaptions: 3,
    closedCaptionsVisibilityDurationMs: 5000,
  ),
);

Updating Call Preferences During a Call

You can update call preferences during an active call:

call.updateCallPreferences(
  DefaultCallPreferences(
    reactionAutoDismissTime: Duration(seconds: 10),
    closedCaptionsVisibleCaptions: 4,
  ),
);

Advanced Video Publishing Options

The clientPublishOptions property allows you to control prefered video codec selection. Don’t use it unless you know what you are doing. Manually setting preferred codec can cause call stability/compatibility issues. Use with caution.

Client Publish Options

Configure video codec and quality settings:

final call = streamVideo.makeCall(
  callType: StreamCallType.defaultType(),
  id: 'my-call-id',
  preferences: DefaultCallPreferences(
    clientPublishOptions: ClientPublishOptions(
      preferredCodec: PreferredCodec.h264,
      fmtpLine: 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f',
      preferredBitrate: 1500000,
      maxSimulcastLayers: 3,
    ),
  ),
);

Client Publish Options Properties

PropertyTypeDescription
preferredCodecPreferredCodec?Preferred video codec for publishing (VP8, H264, VP9, AV1).
fmtpLineString?Format parameters line for the video codec.
preferredBitrateint?Preferred bitrate in bits per second for video publishing.
maxSimulcastLayersint?Maximum number of simulcast layers to publish.
subscriberCodecPreferredCodec?Preferred codec for receiving video streams.
subscriberFmtpLineString?Format parameters line for the subscriber codec.
© Getstream.io, Inc. All Rights Reserved.