ScreenCaptureParameters
Parameter configuration for screen sharing.
export class ScreenCaptureParameters {
dimensions?: VideoDimensions;
frameRate?: number;
bitrate?: number;
captureMouseCursor?: boolean;
windowFocus?: boolean;
excludeWindowList?: any[];
excludeWindowCount?: number;
highLightWidth?: number;
highLightColor?: number;
enableHighLight?: boolean;
}
Properties
- dimensions
-
Note: When setting the encoding resolution in a document sharing scenario (Video encoding resolution of the screen sharing stream. See VideoDimensions. Default value is 1920 × 1080, i.e., 2073600 pixels. This pixel value is used for billing.When the aspect ratio of the shared screen resolution differs from this setting, the SDK encodes based on the following strategy. Assuming
ScreenScenarioDocument), choose one of the following:- For optimal image quality, set the encoding resolution equal to the capture resolution.
- To balance image quality, bandwidth, and system performance:
- If the capture resolution is greater than 1920 × 1080, set the encoding resolution no lower than 1920 × 1080.
- If the capture resolution is less than 1920 × 1080, set the encoding resolution no lower than 1280 × 720.
dimensionsis set to 1920 × 1080:- If the screen resolution is smaller than
dimensions, such as 1000 × 1000, the SDK encodes at 1000 × 1000. - If the screen resolution is larger than
dimensions, such as 2000 × 1500, the SDK encodes at the maximum resolution withindimensionsthat matches the screen's aspect ratio, i.e., 1440 × 1080.
- frameRate
- On Windows and macOS, indicates the video encoding frame rate of the screen sharing stream. Unit: fps; default is 5. It is recommended not to exceed 15.
- bitrate
- On Windows and macOS, indicates the video encoding bitrate of the screen sharing stream. Unit: Kbps; default is 0, which means the SDK calculates a reasonable value based on the current shared screen resolution.
- captureMouseCursor
-
Note: Due to macOS system limitations, setting this parameter to false has no effect when sharing the screen (no effect when sharing a window).Whether to capture the mouse for screen sharing:
- true: (Default) Capture the mouse.
- false: Do not capture the mouse.
- windowFocus
-
Note: Due to macOS system limitations, when setting this member to bring the window to the front, only the main window is brought to the front if the application has multiple windows.When calling startScreenCaptureByWindowId to share a window, whether to bring the window to the front:
- true: Bring the window to the front.
- false: (Default) Do not bring the window to the front.
- excludeWindowList
- List of IDs of windows to be excluded. When calling startScreenCaptureByDisplayId to start screen sharing, you can use this parameter to exclude specified windows. You can also dynamically exclude windows by using this parameter when calling updateScreenCaptureParameters to update screen sharing configuration.
Note: This parameter is not supported in Electron for UnionTech OS SDK.
- 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.Whether to highlight the shared window or screen:
- true: Highlight.
- false: (Default) Do not highlight.
- highLightColor
-
- On Windows, specifies the ARGB color of the highlight. Default value is 0xFF8CBF26.
- On macOS,
COLOR_CLASSrefers toNSColor.
- highLightWidth
- Highlight border width (px). Default is 5. Value range: (0,50].
Note: This parameter takes effect only when
highLightedis set to true. - excludeWindowCount
- Number of windows to be excluded.
Note: On Windows, the maximum value of this parameter is 24. If it exceeds this value, the window exclusion feature becomes invalid. This parameter is not supported in Electron for Kylin OS SDK.