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)Timeout duration for establishing a connection to the call.
reactionAutoDismissTimeDurationDuration(seconds: 5)Duration after which reactions are automatically dismissed.
callStatsReportingIntervalDurationDuration(seconds: 2)Interval for reporting call statistics.
dropIfAloneInRingingFlowbooltrueWhether to drop the call if you’re alone in a ringing flow.
closedCaptionsVisibilityDurationMsint2700Duration (in ms) that closed captions remain visible.
closedCaptionsVisibleCaptionsint2Number of closed caption lines to display simultaneously.
clientPublishOptionsClientPublishOptions?nullAdvanced video publishing options.

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.