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:
 Start Share a window.
 
(BOOL) - isShareViewValid:
 Determine if the application's window ID can be shared.
 
(ZMVideoSDKErrors- startShareScreen:shareOption:
 Start share screen.
 
(ZMVideoSDKErrors- startShareMultiScreen:shareOption:
 Start share multi-screen.
 
(ZMVideoSDKErrors- startShareComputerAudio
 Start sharing the computer audio only.
 
(ZMVideoSDKErrors- stopShare
 Stop view or screen share.
 
(ZMVideoSDKErrors- pauseShare
 Pause share.
 
(ZMVideoSDKErrors- resumeShare
 Resume share.
 
(BOOL) - isSharingOut
 Determine whether the current user is sharing.
 
(BOOL) - isScreenSharingOut
 Determine whether the current user is sharing the screen.
 
(BOOL) - isOtherSharing
 Determine whether other user is sharing.
 
(ZMVideoSDKErrors- lockShare:
 Lock sharing the view or screen. Only the host can call this method.
 
(BOOL) - isShareLocked
 Determine whether sharing the view or screen is locked.
 
(ZMVideoSDKErrors- enableMultiShare:
 Enable or disable participants can share simultaneously.
 
(BOOL) - isMultiShareEnabled
 Determine whether multi share is enabled or not.
 
(ZMVideoSDKErrors- enableShareDeviceAudio:
 Enable or disable the computer sound when sharing, the SDK does not support sharing raw data audio, for example, when you've enabled virtual speaker.
 
(BOOL) - isShareDeviceAudioEnabled
 Determine if the SDK has enabled share computer sound. This reflects the execution status of 'enableShareDeviceAudio' instead of 'startShareComputerAudio'.
 
(ZMVideoSDKErrors- enableOptimizeForSharedVideo:
 Enable or disable the optimization of frame rate, you can enable it when there is video in shared content.
 
(BOOL) - isOptimizeForSharedVideoEnabled
 Determine if optimization for video is enabled.
 
(ZMVideoSDKErrors- startShare2ndCamera:
 Start sharing a camera feed specified by the cameraID as the second camera.
 
(ZMVideoSDKErrors- subscribeMyShareCamera:
 Subscribe to the raw data stream of the camera that is shared as the second camera.
 
(ZMVideoSDKErrors- unSubscribeMyShareCamera
 Unsubscribe to the raw data stream of the camera 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:
 Disable or enable 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- enablePlaySharingAudioRawdata:
 Enable or disable local playback of shared audio raw data.
 
(ZMVideoSDKErrors- startShareWithPreprocessing:sharePreprocessor:
 Start share preprocessing.
 

Detailed Description

Main helper class managing sharing.

Definition at line 233 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 will return the helper for self sharing.
Returns
If the function succeeds, it will return the object of ZMVideoSDKAnnotationHelper. Otherwise 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 will return nil.

◆ destroyAnnotationHelper:

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

Destroys annotation helper.

Parameters
helperThe object of ZMVideoSDKAnnotationHelper.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.

◆ disableViewerAnnotation:

- (ZMVideoSDKErrors) disableViewerAnnotation: (BOOL) disable

Disable or enable viewer's annotation by the share owner.

Parameters
disableYES mean disable, NO, mean enable.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.
Warning
Only the share owner can call this function.

◆ enableMultiShare:

- (ZMVideoSDKErrors) enableMultiShare: (BOOL) enable

Enable or disable participants can share simultaneously.

Parameters
enableTrue to enable. False to disable.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed.
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

Enable or disable the optimization of frame rate, you can enable it when there is video in shared content.

Parameters
enableYES indicates to enable. NO disable.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ enablePlaySharingAudioRawdata:

- (ZMVideoSDKErrors) enablePlaySharingAudioRawdata: (BOOL) bPlay

Enable or disable local playback of shared audio raw data.

Parameters
bPlayYES to play shared audio raw data, false not to play it.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.

◆ enableShareDeviceAudio:

- (ZMVideoSDKErrors) enableShareDeviceAudio: (BOOL) enable

Enable or disable 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 will return ZMVideoSDKErrors_Success.

◆ isAnnotationFeatureSupport

- (BOOL) isAnnotationFeatureSupport

Whether annotation feature is supported or not.

Returns
YES if support. Otherwise not.

◆ isMultiShareEnabled

- (BOOL) isMultiShareEnabled

Determine whether multi share is enabled or not.

Returns
YES indicates enabled, otherwise NO.

◆ isOptimizeForSharedVideoEnabled

- (BOOL) isOptimizeForSharedVideoEnabled

Determine if optimization for video is enabled.

Returns
YES means enabled. Otherwise not.

◆ isOtherSharing

- (BOOL) isOtherSharing

Determine whether other user is sharing.

Returns
YES indicates another user is sharing, otherwise NO.

◆ isScreenSharingOut

- (BOOL) isScreenSharingOut

Determine whether the current user is sharing the screen.

Returns
YES indicates the current user is sharing the screen, otherwise NO.

◆ isShareDeviceAudioEnabled

- (BOOL) isShareDeviceAudioEnabled

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

Returns
YES if enabled, otherwise not.

◆ isShareLocked

- (BOOL) isShareLocked

Determine whether sharing the view or screen is locked.

Returns
YES indicates that sharing is locked, otherwise NO.

◆ isShareViewValid:

- (BOOL) isShareViewValid: (CGWindowID) windowID

Determine if the application's window ID can be shared.

Returns
YES indicates the current application window can be shared, otherwise means the app's window handle can't be shared.

◆ isSharingOut

- (BOOL) isSharingOut

Determine whether the current user is sharing.

Returns
YES indicates the current user is sharing, otherwise NO.

◆ isViewerAnnotationDisabled

- (BOOL) isViewerAnnotationDisabled

Whether annotation on current sharing is disabled or not.

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

◆ lockShare:

- (ZMVideoSDKErrors) lockShare: (BOOL) lock

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

Parameters
lockYES to lock sharing.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed.

◆ pauseShare

- (ZMVideoSDKErrors) pauseShare

Pause share.

Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed.

◆ resumeShare

- (ZMVideoSDKErrors) resumeShare

Resume share.

Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed.

◆ startShare2ndCamera:

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

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

Parameters
cameraIDThe camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.
Note
This cameraID must be a different camera than the one sending your primary video.

◆ startShareComputerAudio

- (ZMVideoSDKErrors) startShareComputerAudio

Start sharing the computer audio only.

Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed.

◆ startShareMultiScreen:shareOption:

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

Start share multi-screen.

Parameters
monitorIDsThe IDs of the monitor that you want to display the shared content.
optionIt is a share option object, contain all option of share.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed.

◆ 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 will return ZMVideoSDKErrors_Success. Otherwise failed.
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, false not to play.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.

◆ startShareScreen:shareOption:

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

Start share screen.

Parameters
monitorIDThe ID of the monitor that you want to display the shared content.
optionIt is a share option object, contain all option of share.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed.

◆ startShareView:shareOption:

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

Start Share a window.

Parameters
windowIDThe App window id.
optionIt is a share option object, contain all option of share.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success, otherwise failed.
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 

Start share preprocessing.

Parameters
paramThe share preprocessing parameters.
preprocessorObject that handles preprocessing events.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.

◆ 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 will return ZMVideoSDKErrors_Success. Otherwise failed.
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, false not to play.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success. Otherwise failed.
Note
If audioSource is non-null, it means share user-defined audio at the same time.

◆ stopShare

- (ZMVideoSDKErrors) stopShare

Stop view or screen share.

Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise failed.

◆ subscribeMyShareCamera:

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

Subscribe to the raw data stream of the camera that is shared as the second camera.

Parameters
dataHandlerThe callback sink object.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.
Deprecated
Use ZMVideoSDKRawDataPipe::subscribe:listener: instead.

◆ unSubscribeMyShareCamera

- (ZMVideoSDKErrors) unSubscribeMyShareCamera

Unsubscribe to the raw data stream of the camera that is shared as the second camera.

Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.
Deprecated
Use ZMVideoSDKRawDataPipe::unSubscribe: instead.