addExcludedShareWindow method

  1. @override
void addExcludedShareWindow(
  1. int windowId
)
override

Add specified windows to the exclusion list of screen sharing (for desktop systems only)

The excluded windows will not be shared. This feature is generally used to add a certain application's window to the exclusion list to avoid privacy issues. You can set the filtered windows before starting screen sharing or dynamically add the filtered windows during screen sharing.

Parameters:

  • windowID(int):
    • Window not to be shared (window ID on macOS or HWND on Windows).

Note:

  1. This API takes effect only if the type in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeScreen; that is, the feature of excluding specified windows works only when the entire screen is shared.
  2. The windows added to the exclusion list through this API will be automatically cleared by the SDK after room exit.
  3. On macOS, please pass in the window ID (CGWindowID), which can be obtained through the sourceId member in TRTCScreenCaptureSourceInfo.

Implementation

@override
void addExcludedShareWindow(int windowId) {
  TRTCLog(_tag, "addExcludedShareWindow: windowId: $windowId");
  if (Platform.isAndroid || Platform.isIOS) {
    debugPrint("trtc-api not support");
    return;
  }
  TRTCCloudNative.instance.addExcludedShareWindow(windowId);
}