logo
On this page

ZegoScreenCaptureSource

ZegoScreenCaptureSource

Declared in ZegoExpressDefines.h

Methods

setEventHandler:

setEventHandler:
- (void)setEventHandler:(nullable id<ZegoScreenCaptureSourceEventHandler>) handler;
Sets up the screen capture source event handler.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
handlernullable id<ZegoScreenCaptureSourceEventHandler>Event handler for real-time sequential data.

Details

Set up screen capture source callback to monitor callbacks such as capture data, etc.

  • When to call: After create the [ZegoScreenCaptureSource] instance.
  • Caution: Calling this function will overwrite the callback set by the last call to this function.
  • Available since: 3.1.0
  • Restrictions: None.

updateCaptureSource:sourceType:

updateCaptureSource:sourceType:
- (void)updateCaptureSource:(unsigned int) sourceId sourceType:(ZegoScreenCaptureSourceType) sourceType;
Create the screen capture source
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
sourceIdunsigned intThe specified screen ID or window ID.
sourceTypeZegoScreenCaptureSourceTypeThe specified screen source type.

Details

Update a screen capture source object based on the provided source ID and source type.

  • Use cases: It is used when you need to record and share the screen or window.
  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Restrictions: Only available on Windows/macOS.

startCapture

startCapture
- (void)startCapture;
Start screen capture.
Declared in ZegoExpressDefines.h

Start screen capture.

  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Available since: 3.1.0

stopCapture

stopCapture
- (void)stopCapture;
Stop screen capture.
Declared in ZegoExpressDefines.h

Stop screen capture.

  • Available since: 3.1.0

getCaptureSourceRect

getCaptureSourceRect
- (CGRect)getCaptureSourceRect;
Gets the rectangle of the screen capture source.
Declared in ZegoExpressDefines.h

Gets the rectangle of the screen capture source.

  • Available since: 3.6.0
  • Restrictions: Called after starting [startScreenCapture] acquisition, only support in Windows/macOS.

Rect information about the capture resource.

updateCaptureRegion:

updateCaptureRegion:
- (void)updateCaptureRegion:(CGRect) rect;
Update the area captured by the screen.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
rectCGRectThe position of the area to be captured relative to the entire screen or window.

Details

Update the area captured by the screen.

  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Available since: 3.1.0
  • Restrictions: Only support in Windows/macOS.

updatePublishRegion:

updatePublishRegion:
- (void)updatePublishRegion:(CGRect) rect;
Update the streaming area of ​​the screen capture.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
rectCGRectThe position of the area to be pushed relative to the upper left corner of the capture screen, the actual capture screen size can be obtained through [onAvailableFrame].

Details

Update the streaming area of ​​the screen capture.

  • When to call: After updating the screen capture source [updateScreenCaptureSource].
  • Caution: The set area cannot exceed the size returned by [onAvailableFrame], otherwise the setting will fail and the original frame will be pushed. The failure of the streaming area will be notified through [onExceptionOccurred].
  • Available since: 3.8.0
  • Restrictions: Every time the screen capture source [updateScreenCaptureSource] is updated, the area will be cleared and needs to be reset, only support in Windows/macOS.

setExcludeWindowList:

setExcludeWindowList:
- (void)setExcludeWindowList:(NSArray<NSNumber *> *) list;
Sets the filtered list of windows.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
listNSArray<NSNumber *> *List of IDs to filter windows.

Details

Specify a list of windows, and filter these windows when capturing the screen, and not display them on the screen.

  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Available since: 3.1.0
  • Restrictions: Only available on Windows/macOS.

enableWindowActivate:

enableWindowActivate:
- (void)enableWindowActivate:(BOOL) active;
Whether to activate the promotion of the window to the foreground.
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
activeBOOLWhether to activate the window. true to activate the window, false to not activate the window, the default is true.

Details

When the capture target is a window, set whether to activate the window to be displayed in the foreground during the first capture.

  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Available since: 3.1.0
  • Restrictions: Only available on Windows/macOS.

enableCursorVisible:

enableCursorVisible:
- (void)enableCursorVisible:(BOOL) visible;
Set whether to show the cursor
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
visibleBOOLWhether to show the cursor. true to show the cursor, false to not show the cursor, the default is true.

Details

Set whether to show the cursor.

  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Available since: 3.1.0
  • Restrictions: Only available on Windows/macOS.

enableHightLight:config:

enableHightLight:config:
- (void)enableHightLight:(BOOL) enable config:(ZegoLayerBorderConfig *) config;
Set whether to highlight the capture area
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
enableBOOLWhether to highlight the capture area. true to highlight, false to not highlight, the default is false.
configZegoLayerBorderConfig *Highlight capture area border configuration.

Details

Set whether to highlight the capture area.

  • When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
  • Available since: 3.21.0
  • Restrictions: Only available on Windows/macOS.

enableAudioCapture:config:

enableAudioCapture:config:
- (void)enableAudioCapture:(BOOL) enable config:(ZegoScreenCaptureAudioConfig *) config;
Set whether to collect sound
Declared in ZegoExpressDefines.h

Parameters

NameTypeDescription
enableBOOLWhether to collect sound. true for collection, false for no collection, default false.
configZegoScreenCaptureAudioConfig *Audio collection parameters.

Details

Set whether to collect sound.

  • When to call: At any time, it takes effect after starting screen capture. [setAudioSource] Set the acquisition source to ZegoAudioSourceTypeScreenCapture, and the screen acquisition and streaming channels are the same.
  • Available since: 3.23.0
  • Restrictions: Only applicable to Windows 8 and above versions.

getIndex

getIndex
- (NSNumber *)getIndex;
Get screen capture source index.
Declared in ZegoExpressDefines.h

Index of the screen capture source.

Previous

zegoscreencaptureconfig

Next

zegoscreencapturesourceeventhandler

On this page

Back to top