addExcludedShareWindow method
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:
- This API takes effect only if the
typein TRTCScreenCaptureSourceInfo is specified asTRTCScreenCaptureSourceTypeScreen; that is, the feature of excluding specified windows works only when the entire screen is shared. - The windows added to the exclusion list through this API will be automatically cleared by the SDK after room exit.
- On macOS, please pass in the window ID (CGWindowID), which can be obtained through the
sourceIdmember 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);
}