Video SDK for MacOS API Reference
Loading...
Searching...
No Matches
ZMVideoSDKShareHelper Class Reference

Main helper class managing sharing. More...

#include <ZMVideoSDKShareHelper.h>

Inherits NSObject.

Instance Methods

(ZMVideoSDKErrors- startShareView:shareOption:
 Starts Share a window.
 
(ZMVideoSDKErrors- startShareApplication:shareOption:
 Starts sharing a specific application process.
 
(BOOL) - isShareViewValid:
 Determines if the application's window ID supports sharing.
 
(ZMVideoSDKErrors- startShareScreen:shareOption:
 Starts share screen.
 
(ZMVideoSDKErrors- startShareMultiScreen:shareOption:
 Starts share multi-screen.
 
(ZMVideoSDKErrors- startShareComputerAudio
 Starts sharing the computer audio only.
 
(ZMVideoSDKErrors- stopShare
 Stops view or screen share.
 
(ZMVideoSDKErrors- pauseShare
 Pauses share.
 
(ZMVideoSDKErrors- resumeShare
 Resumes share.
 
(BOOL) - isSharingOut
 Determines whether the current user is sharing.
 
(BOOL) - isScreenSharingOut
 Determines whether the current user is sharing the screen.
 
(BOOL) - isOtherSharing
 Determines whether other user is sharing.
 
(ZMVideoSDKErrors- lockShare:
 Locks sharing the view or screen. Only the host can call this method.
 
(BOOL) - isShareLocked
 Determines whether sharing the view or screen is locked.
 
(ZMVideoSDKErrors- enableMultiShare:
 Enables or disables participants can share simultaneously.
 
(BOOL) - isMultiShareEnabled
 Determines whether multi share is enabled or not.
 
(ZMVideoSDKErrors- enableShareDeviceAudio:
 Enables or disables the computer sound when sharing, the SDK does not support sharing raw data audio, for example, when you've enabled virtual speaker.
 
(BOOL) - isShareDeviceAudioEnabled
 Determines if the SDK has enabled share computer sound. This reflects the execution status of 'enableShareDeviceAudio' instead of 'startShareComputerAudio'.
 
(ZMVideoSDKErrors- enableOptimizeForSharedVideo:
 Enables or disables the optimization of frame rate. Enable it when there is video in shared content.
 
(BOOL) - isOptimizeForSharedVideoEnabled
 Determines if optimization for video is enabled.
 
(ZMVideoSDKErrors- startShare2ndCamera:
 Starts sharing a camera feed specified by the cameraID as the second camera.
 
(ZMVideoSDKErrors- subscribeMyShareCamera:
 Subscribes to the camera's raw data stream that is shared as the second camera.
 
(ZMVideoSDKErrors- unSubscribeMyShareCamera
 Unsubscribes to the camera's raw data stream that is shared as the second camera.
 
(ZMVideoSDKErrors- startSharingExternalSource:audioSource:
 Shares an external source.
 
(ZMVideoSDKErrors- startSharingExternalSource:audioSource:isPlaying:
 Shares an external source.
 
(ZMVideoSDKErrors- startSharePureAudioSource:
 Starts sharing the pure external audio source.
 
(ZMVideoSDKErrors- startSharePureAudioSource:isPlaying:
 Starts sharing the pure external audio source.
 
(BOOL) - isAnnotationFeatureSupport
 Whether annotation feature is supported or not.
 
(ZMVideoSDKErrors- disableViewerAnnotation:
 Disables or enables viewer's annotation by the share owner.
 
(BOOL) - isViewerAnnotationDisabled
 Whether annotation on current sharing is disabled or not.
 
(ZMVideoSDKAnnotationHelper *_Nullable) - createAnnotationHelper:
 Creates annotation helper based on shared view.
 
(ZMVideoSDKErrors- destroyAnnotationHelper:
 Destroys annotation helper.
 
(ZMVideoSDKErrors- setAnnotationVanishingToolTime:vanishingTime:
 Sets the vanishing tool time.
 
(ZMVideoSDKErrors- getAnnotationVanishingToolTime:vanishingTime:
 Gets the current vanishing tool time settings.
 
(ZMVideoSDKErrors- enablePlaySharingAudioRawdata:
 Enables or disables local playback of shared audio raw data.
 
(ZMVideoSDKErrors- startShareWithPreprocessing:sharePreprocessor:
 Starts share preprocessing.
 
(ZMVideoSDKWhiteboardHelper *_Nullable) - getWhiteboardHelper
 Returns an instance to manage whiteboard during a video SDK session.
 

Detailed Description

Main helper class managing sharing.

Definition at line 243 of file ZMVideoSDKShareHelper.h.

Method Documentation

◆ createAnnotationHelper:

- (ZMVideoSDKAnnotationHelper *_Nullable) createAnnotationHelper: (NSView *_Nullable) view

Creates annotation helper based on shared view.

Parameters
viewThe shared view. Pass the nil returns the helper for self sharing.
Returns
If the function succeeds, it returns the object of ZMVideoSDKAnnotationHelper. Otherwise, this function fails and returns nil.
Warning
When the share owner not support the feature of annotate, the others should not do annotate in that case.
If the video aspect mode is set to ZMVideoSDKVideoAspect_Full_Filled, this function returns nil.

◆ destroyAnnotationHelper:

- (ZMVideoSDKErrors) destroyAnnotationHelper: (ZMVideoSDKAnnotationHelper *_Nonnull) helper

Destroys annotation helper.

Parameters
helperThe object of ZMVideoSDKAnnotationHelper.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ disableViewerAnnotation:

- (ZMVideoSDKErrors) disableViewerAnnotation: (BOOL) disable

Disables or enables viewer's annotation by the share owner.

Parameters
disableYES mean disable, NO, mean enable.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Warning
Only the share owner can call this function.

◆ enableMultiShare:

- (ZMVideoSDKErrors) enableMultiShare: (BOOL) enable

Enables or disables participants can share simultaneously.

Parameters
enableYES to enable, NO to disable.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Warning
When you switch multi share from enable to disable, all sharing will be stopped when session has two or more users is sharing.

◆ enableOptimizeForSharedVideo:

- (ZMVideoSDKErrors) enableOptimizeForSharedVideo: (BOOL) enable

Enables or disables the optimization of frame rate. Enable it when there is video in shared content.

Parameters
enableYES indicates to enable, NO disable.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ enablePlaySharingAudioRawdata:

- (ZMVideoSDKErrors) enablePlaySharingAudioRawdata: (BOOL) bPlay

Enables or disables local playback of shared audio raw data.

Parameters
bPlayYES to play shared audio raw data, NO not to play it.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ enableShareDeviceAudio:

- (ZMVideoSDKErrors) enableShareDeviceAudio: (BOOL) enable

Enables or disables the computer sound when sharing, the SDK does not support sharing raw data audio, for example, when you've enabled virtual speaker.

Parameters
enableYES to enable, NO to disable.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ getAnnotationVanishingToolTime:vanishingTime:

- (ZMVideoSDKErrors) getAnnotationVanishingToolTime: (unsigned int *) displayTime
vanishingTime: (unsigned int *) vanishingTime 

Gets the current vanishing tool time settings.

Parameters
displayTime[out] The time in milliseconds the tool remains visible before fading.
vanishingTime[out] The time in milliseconds for the tool to fade out after displayTime.
Note
This function can only retrieve the timer settings for your own share.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ getWhiteboardHelper

- (ZMVideoSDKWhiteboardHelper *_Nullable) getWhiteboardHelper

Returns an instance to manage whiteboard during a video SDK session.

Returns
If the function succeeds, it returns the whiteboard helper object. Otherwise, this function fails and returns nil.

◆ isAnnotationFeatureSupport

- (BOOL) isAnnotationFeatureSupport

Whether annotation feature is supported or not.

Returns
YES if support. Otherwise, NO.

◆ isMultiShareEnabled

- (BOOL) isMultiShareEnabled

Determines whether multi share is enabled or not.

Returns
YES if enabled. Otherwise, NO.

◆ isOptimizeForSharedVideoEnabled

- (BOOL) isOptimizeForSharedVideoEnabled

Determines if optimization for video is enabled.

Returns
YES if enabled. Otherwise, NO.

◆ isOtherSharing

- (BOOL) isOtherSharing

Determines whether other user is sharing.

Returns
YES if another user is sharing. Otherwise, NO.

◆ isScreenSharingOut

- (BOOL) isScreenSharingOut

Determines whether the current user is sharing the screen.

Returns
YES if the current user is sharing the screen. Otherwise, NO.

◆ isShareDeviceAudioEnabled

- (BOOL) isShareDeviceAudioEnabled

Determines if the SDK has enabled share computer sound. This reflects the execution status of 'enableShareDeviceAudio' instead of 'startShareComputerAudio'.

Returns
YES if enabled. Otherwise, NO.

◆ isShareLocked

- (BOOL) isShareLocked

Determines whether sharing the view or screen is locked.

Returns
YES if that sharing is locked. Otherwise, NO.

◆ isShareViewValid:

- (BOOL) isShareViewValid: (CGWindowID) windowID

Determines if the application's window ID supports sharing.

Parameters
windowIDThe App window ID to be checked.
Returns
YES if the current application window supports sharing. Otherwise, NO.

◆ isSharingOut

- (BOOL) isSharingOut

Determines whether the current user is sharing.

Returns
YES if the current user is sharing. Otherwise, NO.

◆ isViewerAnnotationDisabled

- (BOOL) isViewerAnnotationDisabled

Whether annotation on current sharing is disabled or not.

Returns
YES if disable. Otherwise, NO.
Warning
Only the share owner can call this function.

◆ lockShare:

- (ZMVideoSDKErrors) lockShare: (BOOL) lock

Locks sharing the view or screen. Only the host can call this method.

Parameters
lockYES to lock sharing, NO to unlock.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ pauseShare

- (ZMVideoSDKErrors) pauseShare

Pauses share.

Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ resumeShare

- (ZMVideoSDKErrors) resumeShare

Resumes share.

Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ setAnnotationVanishingToolTime:vanishingTime:

- (ZMVideoSDKErrors) setAnnotationVanishingToolTime: (unsigned int) displayTime
vanishingTime: (unsigned int) vanishingTime 

Sets the vanishing tool time.

Parameters
displayTimeThe time in milliseconds the tool remains visible before fading.
vanishingTimeThe time in milliseconds for the tool to fade out after displayTime.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
This setting only takes effect for the user's own share. The displayTime can be 0 or up to 15000 milliseconds (15 seconds). The vanishingTime must be greater than 1000 milliseconds (1 second) and less than or equal to 15000 milliseconds (15 seconds).

◆ startShare2ndCamera:

- (ZMVideoSDKErrors) startShare2ndCamera: (NSString *_Nullable) cameraID

Starts sharing a camera feed specified by the cameraID as the second camera.

Parameters
cameraIDThe camera ID.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
This cameraID must be a different camera than the one sending your primary video.

◆ startShareApplication:shareOption:

- (ZMVideoSDKErrors) startShareApplication: (pid_t) processID
shareOption: (ZMVideoSDKShareOption *_Nullable) option 

Starts sharing a specific application process.

Parameters
processIDThe target application's process identifier. Must be valid in the current user session.
optionAn optional share settings object containing configuration options for the share.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise the method failed.
Note
The processID must be a valid process identifier in the current user session.

◆ startShareComputerAudio

- (ZMVideoSDKErrors) startShareComputerAudio

Starts sharing the computer audio only.

Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startShareMultiScreen:shareOption:

- (ZMVideoSDKErrors) startShareMultiScreen: (NSArray< NSNumber * > *) monitorIDs
shareOption: (ZMVideoSDKShareOption *_Nullable) option 

Starts share multi-screen.

Parameters
monitorIDsThe monitor IDs that you want to display the shared content.
optionIt is a share option object, contain all option of share.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startSharePureAudioSource:

- (ZMVideoSDKErrors) startSharePureAudioSource: (id< ZMVideoSDKShareAudioSource > _Nonnull) audioSource

Starts sharing the pure external audio source.

Parameters
audioSourceThe pointer of external audio source object.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Deprecated
Use ZMVideoSDKShareHelper::startSharePureAudioSource:isPlaying: instead.

◆ startSharePureAudioSource:isPlaying:

- (ZMVideoSDKErrors) startSharePureAudioSource: (id< ZMVideoSDKShareAudioSource > _Nonnull) audioSource
isPlaying: (BOOL) isPlaying 

Starts sharing the pure external audio source.

Parameters
audioSourceThe pointer of external audio source object.
isPlayingYES to play shared audio raw data, NO not to play.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startShareScreen:shareOption:

- (ZMVideoSDKErrors) startShareScreen: (CGDirectDisplayID) monitorID
shareOption: (ZMVideoSDKShareOption *_Nullable) option 

Starts share screen.

Parameters
monitorIDThe monitor's ID that you want to display the shared content.
optionIt is a share option object, contain all option of share.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startShareView:shareOption:

- (ZMVideoSDKErrors) startShareView: (CGWindowID) windowID
shareOption: (ZMVideoSDKShareOption *_Nullable) option 

Starts Share a window.

Parameters
windowIDThe App window ID.
optionIt is a share option object, contain all option of share.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
The CGWindowID contains a unique value within the user session representing a window.

◆ startShareWithPreprocessing:sharePreprocessor:

- (ZMVideoSDKErrors) startShareWithPreprocessing: (ZMVideoSDKSharePreprocessParam *_Nonnull) param
sharePreprocessor: (id< ZMVideoSDKSharePreprocessor > _Nonnull) preprocessor 

Starts share preprocessing.

Parameters
paramThe share preprocessing parameters.
preprocessorObject that handles preprocessing events.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startSharingExternalSource:audioSource:

- (ZMVideoSDKErrors) startSharingExternalSource: (id< ZMVideoSDKShareSource > _Nonnull) shareSource
audioSource: (id< ZMVideoSDKShareAudioSource > _Nullable) audioSource 

Shares an external source.

Parameters
shareSourceExternal share source.
audioSourceExternal audio source.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
If audioSource is non-null, it means share user-defined audio at the same time.
Deprecated
Use ZMVideoSDKShareHelper::startSharingExternalSource:audioSource:isPlaying: instead.

◆ startSharingExternalSource:audioSource:isPlaying:

- (ZMVideoSDKErrors) startSharingExternalSource: (id< ZMVideoSDKShareSource > _Nonnull) shareSource
audioSource: (id< ZMVideoSDKShareAudioSource > _Nullable) audioSource
isPlaying: (BOOL) isPlaying 

Shares an external source.

Parameters
shareSourceExternal share source.
audioSourceExternal audio source.
isPlayingYES to play shared audio raw data, NO not to play.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
If audioSource is non-null, it means share user-defined audio at the same time.

◆ stopShare

- (ZMVideoSDKErrors) stopShare

Stops view or screen share.

Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ subscribeMyShareCamera:

- (ZMVideoSDKErrors) subscribeMyShareCamera: (id< ZMVideoSDKRawDataPipeDelegate > _Nonnull) dataHandler

Subscribes to the camera's raw data stream that is shared as the second camera.

Parameters
dataHandlerThe callback sink object.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Deprecated
Use ZMVideoSDKRawDataPipe::subscribe:listener: instead.

◆ unSubscribeMyShareCamera

- (ZMVideoSDKErrors) unSubscribeMyShareCamera

Unsubscribes to the camera's raw data stream that is shared as the second camera.

Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Deprecated
Use ZMVideoSDKRawDataPipe::unSubscribe: instead.