startScreenCaptureByScreenRect abstract method
- required Rectangle screenRect,
- required Rectangle regionRect,
- required ScreenCaptureParameters captureParams,
Starts capturing the video stream of a specified screen region.
Deprecated Deprecated: This method is deprecated. Use startScreenCaptureByDisplayId instead. If you need to enable screen sharing with external displays, it is strongly recommended to use startScreenCaptureByDisplayId. Shares a screen or a specific region of the screen. You need to specify the screen region to be shared in this method. This method can be called before or after joining a channel, with the following differences: If you call this method before joining a channel, then call joinChannel to join the channel and set publishScreenTrack or publishSecondaryScreenTrack to true, screen sharing will start. If you call this method after joining a channel, then call updateChannelMediaOptions to update the channel media options and set publishScreenTrack or publishSecondaryScreenTrack to true, screen sharing will start. This method is only applicable to Windows.
screenRectSpecifies the position of the screen to be shared relative to the virtual screen.regionRectSpecifies the position of the region to be shared relative to the entire screen. If not set, the entire screen is shared. See Rectangle. If the specified region exceeds the screen boundary, only the content within the screen is shared. If width or height is set to 0, the entire screen is shared.captureParamsConfiguration parameters for screen sharing encoding. The default resolution is 1920 x 1080, i.e., 2,073,600 pixels. This pixel count is used for billing. See ScreenCaptureParameters.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> startScreenCaptureByScreenRect(
{required Rectangle screenRect,
required Rectangle regionRect,
required ScreenCaptureParameters captureParams});