ScreenCaptureParameters

Parameter configuration for screen sharing.

class ScreenCaptureParameters {
  const ScreenCaptureParameters(
      {this.dimensions,
      this.frameRate,
      this.bitrate,
      this.captureMouseCursor,
      this.windowFocus,
      this.excludeWindowList,
      this.excludeWindowCount,
      this.highLightWidth,
      this.highLightColor,
      this.enableHighLight});

  @JsonKey(name: 'dimensions')
  final VideoDimensions? dimensions;

  @JsonKey(name: 'frameRate')
  final int? frameRate;

  @JsonKey(name: 'bitrate')
  final int? bitrate;

  @JsonKey(name: 'captureMouseCursor')
  final bool? captureMouseCursor;

  @JsonKey(name: 'windowFocus')
  final bool? windowFocus;

  @JsonKey(name: 'excludeWindowList')
  final List<int>? excludeWindowList;

  @JsonKey(name: 'excludeWindowCount')
  final int? excludeWindowCount;

  @JsonKey(name: 'highLightWidth')
  final int? highLightWidth;

  @JsonKey(name: 'highLightColor')
  final int? highLightColor;

  @JsonKey(name: 'enableHighLight')
  final bool? enableHighLight;

  factory ScreenCaptureParameters.fromJson(Map<String, dynamic> json) =>
      _$ScreenCaptureParametersFromJson(json);

  Map<String, dynamic> toJson() => _$ScreenCaptureParametersToJson(this);
}

Properties

dimensions
Note: When setting encoding resolution in a document sharing scenario (screenScenarioDocument), choose one of the following:
  • For optimal image quality, set the encoding resolution the same as the capture resolution.
  • For a balance between quality, bandwidth, and performance:
  • If capture resolution is greater than 1920 × 1080, set encoding resolution no lower than 1920 × 1080.
  • If capture resolution is less than 1920 × 1080, set encoding resolution no lower than 1280 × 720.
Video encoding resolution of the screen sharing stream. See VideoDimensions. Default is 1920 × 1080, i.e., 2073600 pixels. This pixel count is used for billing.If the aspect ratio of the shared screen resolution differs from this setting, the SDK encodes according to the following strategy. Assuming dimensions is set to 1920 × 1080:
  • If the screen resolution is smaller than dimensions, e.g., 1000 × 1000, the SDK encodes at 1000 × 1000.
  • If the screen resolution is larger than dimensions, e.g., 2000 × 1500, the SDK encodes at the maximum resolution within dimensions that matches the screen's aspect ratio (4:3), i.e., 1440 × 1080.
frameRate
Frame rate of the shared video, in fps. Default is 5. It is recommended not to exceed 15.
bitrate
Bitrate of the shared video, in Kbps. Default is 0, meaning the SDK calculates a reasonable value based on the current screen resolution.
captureMouseCursor
Note: Due to macOS system limitations, setting this parameter to false has no effect when sharing the screen (no impact when sharing a window).
Whether to capture the mouse cursor during screen sharing:
  • true: (Default) Capture mouse.
  • false: Do not capture mouse.
windowFocus
Note: Due to macOS system limitations, when setting this member to bring a window to the front, only the main window is brought to the front if the app has multiple windows.
When calling startScreenCaptureByWindowId to share a window, whether to bring the window to the front:
  • true: Bring to front.
  • false: (Default) Do not bring to front.
excludeWindowList
List of window IDs to exclude. When calling startScreenCaptureByDisplayId to start screen sharing, you can use this parameter to exclude specific windows. You can also dynamically exclude windows by passing this parameter when calling updateScreenCaptureParameters to update screen sharing configuration.
enableHighLight
Note: When sharing a partial region of a window or screen, if this parameter is set to true, the SDK highlights the entire window or screen.
(macOS and Windows only) Whether to highlight the shared window or screen:
  • true: Highlight.
  • false: (Default) Do not highlight.
highLightColor
(macOS and Windows only)
  • On Windows, specifies the ARGB color of the highlight. Default is 0xFF8CBF26.
  • On macOS, COLOR_CLASS refers to NSColor.
highLightWidth
(macOS and Windows only) Width of the highlight border (px). Default is 5. Valid range is (0,50].
Note: This parameter takes effect only when highLighted is set to true.
excludeWindowCount
Number of windows to exclude.
Note: On Windows, the maximum value is 24. If exceeded, window exclusion does not take effect.