ZegoScreenCaptureSource
ZegoScreenCaptureSource
Declared in ZegoExpressDefines.h
Methods
setEventHandler:
- (void)setEventHandler:(nullable id<ZegoScreenCaptureSourceEventHandler>) handler;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| handler | nullable 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:
- (void)updateCaptureSource:(unsigned int) sourceId sourceType:(ZegoScreenCaptureSourceType) sourceType;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| sourceId | unsigned int | The specified screen ID or window ID. |
| sourceType | ZegoScreenCaptureSourceType | The 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
- (void)startCapture;ZegoExpressDefines.hStart screen capture.
- When to call: It can be called after the engine by [createScreenCaptureSource] has been initialized.
- Available since: 3.1.0
stopCapture
- (void)stopCapture;ZegoExpressDefines.hStop screen capture.
- Available since: 3.1.0
getCaptureSourceRect
- (CGRect)getCaptureSourceRect;ZegoExpressDefines.hGets 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:
- (void)updateCaptureRegion:(CGRect) rect;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| rect | CGRect | The 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:
- (void)updatePublishRegion:(CGRect) rect;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| rect | CGRect | The 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:
- (void)setExcludeWindowList:(NSArray<NSNumber *> *) list;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| list | NSArray<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:
- (void)enableWindowActivate:(BOOL) active;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| active | BOOL | Whether 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:
- (void)enableCursorVisible:(BOOL) visible;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| visible | BOOL | Whether 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:
- (void)enableHightLight:(BOOL) enable config:(ZegoLayerBorderConfig *) config;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to highlight the capture area. true to highlight, false to not highlight, the default is false. |
| config | ZegoLayerBorderConfig * | 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:
- (void)enableAudioCapture:(BOOL) enable config:(ZegoScreenCaptureAudioConfig *) config;ZegoExpressDefines.hParameters
| Name | Type | Description |
|---|---|---|
| enable | BOOL | Whether to collect sound. true for collection, false for no collection, default false. |
| config | ZegoScreenCaptureAudioConfig * | 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
- (NSNumber *)getIndex;ZegoExpressDefines.hIndex of the screen capture source.
