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

Provides functions to control virtual background. More...

#include <ZMVideoSDKVideoHelper.h>

Inherits NSObject.

Instance Methods

(ZMVideoSDKErrors- startVideo
 Call this method to start sending local video data from the camera.
 
(ZMVideoSDKErrors- stopVideo
 Call this method to stop sending local video data from the camera.
 
(BOOL) - rotateMyVideo:
 Call this method to rotate the video when the device is rotated.
 
(BOOL) - switchCamera
 Switch to the next available camera.
 
(BOOL) - selectCamera:
 Switch to the camera passed in as cameraDevice.
 
(unsigned int) - getNumberOfCameras
 Returns number of cameras available to share the video.
 
(NSArray< ZMVideoSDKCameraDevice * > *_Nullable) - getCameraList
 Returns a collection of camera devices available to share the video as an object of ZMVideoSDKCameraDevice.
 
(ZMVideoSDKErrors- canControlCamera:deviceID:
 Check whether the current user has permission to control the camera.
 
(ZMVideoSDKErrors- turnCameraLeft:deviceID:
 Pan the camera to the left.
 
(ZMVideoSDKErrors- turnCameraRight:deviceID:
 Pan the camera to the right.
 
(ZMVideoSDKErrors- turnCameraUp:deviceID:
 Tilt the camera up.
 
(ZMVideoSDKErrors- turnCameraDown:deviceID:
 Tilt the camera down.
 
(ZMVideoSDKErrors- zoomCameraIn:deviceID:
 Zoom the camera in.
 
(ZMVideoSDKErrors- zoomCameraOut:deviceID:
 Zoom the camera out.
 
(ZMVideoSDKErrors- setVideoQualityPreference:
 Adjust user's video solution and frame-rate.
 
(BOOL) - enableMultiStreamVideo:customDeviceName:
 Enable multiple stream video if you have multiple cameras, and other participants can see multiple videos of you.
 
(BOOL) - disableMultiStreamVideo:
 Disable multiple stream video.
 
(BOOL) - muteMultiStreamVideo:
 Turn off multiple stream video.
 
(BOOL) - unmuteMultiStreamVideo:
 Turn on multiple stream video.
 
(NSString *_Nullable) - getDeviceIDByMyPipe:
 Get the device ID associated with my multi-camera pipe.
 
(ZMVideoSDKErrors- startVideoPreview:deviceID:
 Subscribe preview video raw data with a callback.
 
(ZMVideoSDKErrors- startVideoPreview:deviceID:resolution:
 Subscribe to preview video raw data with a callback.
 
(ZMVideoSDKErrors- stopVideoPreview:
 UnSubscribe preview video raw data with the subscribed callback.
 
(ZMVideoSDKErrors- startVideoCanvasPreview:deviceID:
 Starts the preview video with a view.
 
(ZMVideoSDKErrors- stopVideoCanvasPreview:
 Stops the preview video.
 
(ZMVideoSDKErrors- addVirtualBackgroundItem:imageItem:
 Add virtual background object.
 
(ZMVideoSDKErrors- removeVirtualBackgroundItem:
 Remove virtual background object.
 
(NSArray< ZMVideoSDKVirtualBackgroundItem * > *_Nullable) - getVirtualBackgroundItemList
 Returns a collection of virtual background item as an object of ZMVideoSDKVirtualBackgroundItem.
 
(ZMVideoSDKErrors- setVirtualBackgroundItem:
 Select virtual background item.
 
(ZMVideoSDKVirtualBackgroundItem *_Nullable) - getSelectedVirtualBackgroundItem
 Get a selected virtual background item.
 
(BOOL) - isOriginalAspectRatioEnabled
 Determine whether current aspect ratio is the original aspect ratio of video.
 
(BOOL) - enableOriginalAspectRatio:
 Set the aspect ratio of the video sent out.
 
(ZMVideoSDKErrors- mirrorMyVideo:
 Mirrors the current user's video. Valid only for canvas.
 
(BOOL) - isMyVideoMirrored
 Determine whether mirror my video is enabled.
 
(BOOL) - isDeviceSupportAlphaChannelMode
 Determine if the current device supports alpha channel mode.
 
(BOOL) - canEnableAlphaChannelMode
 Determine if alpha channel mode can be enabled.
 
(ZMVideoSDKErrors- enableAlphaChannelMode:
 Enable or disable alpha channel mode.
 
(BOOL) - isAlphaChannelModeEnabled
 Determine if alpha channel mode is enabled.
 
(ZMVideoSDKErrors- spotLightVideo:
 Call this method to spotlight user's video.
 
(ZMVideoSDKErrors- unSpotLightVideo:
 Call this method to unSpotlight user's video.
 
(ZMVideoSDKErrors- unSpotlightAllVideos
 Call this method to set all user's video unSpotlight.
 
(NSArray< ZMVideoSDKUser * > *_Nullable) - getSpotlightedVideoUserList
 Enable or disable alpha channel mode.
 

Detailed Description

Provides functions to control virtual background.

An interface to control video and manage cameras during a video session.

Definition at line 100 of file ZMVideoSDKVideoHelper.h.

Method Documentation

◆ addVirtualBackgroundItem:imageItem:

- (ZMVideoSDKErrors) addVirtualBackgroundItem: (NSString *) imagePath
imageItem: (ZMVideoSDKVirtualBackgroundItem *_Nullable *_Nonnull) imageItem 

Add virtual background object.

Parameters
imagePathThe path of image.
imageItemAn object of ZMVideoSDKVirtualBackgroundItem. Once the function is called successfully, this parameter will store the pointer to the ZMVideoSDKVirtualBackgroundItem*.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ canControlCamera:deviceID:

- (ZMVideoSDKErrors) canControlCamera: (BOOL *) canControl
deviceID: (nullable NSString *) deviceID 

Check whether the current user has permission to control the camera.

Parameters
canControlThe output parameter. YES means can control local camera, otherwise not.
deviceIDThe camera device ID to check. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ canEnableAlphaChannelMode

- (BOOL) canEnableAlphaChannelMode

Determine if alpha channel mode can be enabled.

Returns
YES means it can be enabled. Otherwise NO.

◆ disableMultiStreamVideo:

- (BOOL) disableMultiStreamVideo: (NSString *) cameraDeviceID

Disable multiple stream video.

Parameters
cameraDeviceIDThe camera id which you want to disable.
Returns
If the function succeeds, it will return YES, otherwise returns NO.

◆ enableAlphaChannelMode:

- (ZMVideoSDKErrors) enableAlphaChannelMode: (BOOL) enabled

Enable or disable alpha channel mode.

Parameters
enabledYES indicates to enable alpha channel mode. Otherwise, disable it.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success.

◆ enableMultiStreamVideo:customDeviceName:

- (BOOL) enableMultiStreamVideo: (NSString *) cameraDeviceID
customDeviceName: (nullable NSString *) customDeviceName 

Enable multiple stream video if you have multiple cameras, and other participants can see multiple videos of you.

Parameters
cameraDeviceIDThe camera ID for the camera to enable.
customDeviceNameThe custom device name of the camera. If this parameter is not passed, a default name will be generated.
Returns
If the function succeeds, it will return YES, otherwise returns NO.

◆ enableOriginalAspectRatio:

- (BOOL) enableOriginalAspectRatio: (BOOL) bEnabled

Set the aspect ratio of the video sent out.

Parameters
bEnabledNO means the aspect ratio is 16:9, YES means that using the original aspect ratio of video.
Returns
If the function succeeds, it will return YES.
Note
If session is using video source and data_mode is not VideoSourceDataMode_None, default always use original aspect ration of video.

◆ getCameraList

- (NSArray< ZMVideoSDKCameraDevice * > *_Nullable) getCameraList

Returns a collection of camera devices available to share the video as an object of ZMVideoSDKCameraDevice.

Returns
Camera devices list.

◆ getDeviceIDByMyPipe:

- (NSString *_Nullable) getDeviceIDByMyPipe: (ZMVideoSDKRawDataPipe *) pipe

Get the device ID associated with my multi-camera pipe.

Parameters
pipeMy multi-camera pipe.
Returns
The video device ID if successful. Otherwise returns nil.

◆ getNumberOfCameras

- (unsigned int) getNumberOfCameras

Returns number of cameras available to share the video.

Returns
The count of cameras.

◆ getSelectedVirtualBackgroundItem

- (ZMVideoSDKVirtualBackgroundItem *_Nullable) getSelectedVirtualBackgroundItem

Get a selected virtual background item.

Returns
If the function succeeds, it will return the object of ZMVideoSDKVirtualBackgroundItem.

◆ getSpotlightedVideoUserList

- (NSArray< ZMVideoSDKUser * > *_Nullable) getSpotlightedVideoUserList

Enable or disable alpha channel mode.

Returns
If the function succeeds, the return value is ZMVideoSDKUser object list.

◆ getVirtualBackgroundItemList

- (NSArray< ZMVideoSDKVirtualBackgroundItem * > *_Nullable) getVirtualBackgroundItemList

Returns a collection of virtual background item as an object of ZMVideoSDKVirtualBackgroundItem.

Returns
If the function succeeds, it will return a list of virtual background items.

◆ isAlphaChannelModeEnabled

- (BOOL) isAlphaChannelModeEnabled

Determine if alpha channel mode is enabled.

Returns
YES indicates is in alpha channel mode. Otherwise NO.

◆ isDeviceSupportAlphaChannelMode

- (BOOL) isDeviceSupportAlphaChannelMode

Determine if the current device supports alpha channel mode.

Returns
YES indicates that the current device supports alpha channel mode, Otherwise it does not.

◆ isMyVideoMirrored

- (BOOL) isMyVideoMirrored

Determine whether mirror my video is enabled.

Returns
YES if mirror my video is enabled, otherwise NO.

◆ isOriginalAspectRatioEnabled

- (BOOL) isOriginalAspectRatioEnabled

Determine whether current aspect ratio is the original aspect ratio of video.

Returns
YES if is original aspect ratio, otherwise NO.

◆ mirrorMyVideo:

- (ZMVideoSDKErrors) mirrorMyVideo: (BOOL) bEnabled

Mirrors the current user's video. Valid only for canvas.

Parameters
bEnabledYES to enable mirror my video.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ muteMultiStreamVideo:

- (BOOL) muteMultiStreamVideo: (NSString *) cameraDeviceID

Turn off multiple stream video.

Parameters
cameraDeviceIDThe camera ID which is running as multiple camera.
Returns
If the function succeeds, it will return YES, otherwise returns NO.

◆ removeVirtualBackgroundItem:

- (ZMVideoSDKErrors) removeVirtualBackgroundItem: (ZMVideoSDKVirtualBackgroundItem *) imageItem

Remove virtual background object.

Parameters
imageItemThe ZMVideoSDKVirtualBackgroundItem object to be removed.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ rotateMyVideo:

- (BOOL) rotateMyVideo: (ZMVideoRotation) rotation

Call this method to rotate the video when the device is rotated.

Parameters
rotationIt is emum.
Returns
YES means the function is success, otherwise not.

◆ selectCamera:

- (BOOL) selectCamera: (NSString *) cameraDeviceID

Switch to the camera passed in as cameraDevice.

Parameters
cameraDeviceIDThe id of camera.
Returns
YES means the function is success, otherwise not.

◆ setVideoQualityPreference:

- (ZMVideoSDKErrors) setVideoQualityPreference: (ZMVideoSDKPreferenceSetting *) preferenceSetting

Adjust user's video solution and frame-rate.

Parameters
preferenceSettingAn instance of ZMVideoSDKPreferenceSetting.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ setVirtualBackgroundItem:

- (ZMVideoSDKErrors) setVirtualBackgroundItem: (ZMVideoSDKVirtualBackgroundItem *) imageItem

Select virtual background item.

Parameters
imageItemThe ZMVideoSDKVirtualBackgroundItem object to select.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ spotLightVideo:

- (ZMVideoSDKErrors) spotLightVideo: (ZMVideoSDKUser *) user

Call this method to spotlight user's video.

Parameters
userWhich you want to spotlight video.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success.

◆ startVideo

- (ZMVideoSDKErrors) startVideo

Call this method to start sending local video data from the camera.

Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ startVideoCanvasPreview:deviceID:

- (ZMVideoSDKErrors) startVideoCanvasPreview: (NSView *) view
deviceID: (NSString *_Nullable) cameraDeviceID 

Starts the preview video with a view.

Parameters
viewThe view to preview video.
cameraDeviceIDThe camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ startVideoPreview:deviceID:

- (ZMVideoSDKErrors) startVideoPreview: (id< ZMVideoSDKRawDataPipeDelegate >) listener
deviceID: (NSString *_Nullable) cameraDeviceID 

Subscribe preview video raw data with a callback.

Parameters
listenerThe callback sink object.
cameraDeviceIDThe camera id.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.
Deprecated
Use resolution: instead.

◆ startVideoPreview:deviceID:resolution:

- (ZMVideoSDKErrors) startVideoPreview: (id< ZMVideoSDKRawDataPipeDelegate >) listener
deviceID: (NSString *_Nullable) cameraDeviceID
resolution: (ZMVideoSDKResolution) resolution 

Subscribe to preview video raw data with a callback.

Parameters
listenerThe callback object.
cameraDeviceIDCamera device ID.
resolutionSpecify the resolution at which to open the camera.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success.

◆ stopVideo

- (ZMVideoSDKErrors) stopVideo

Call this method to stop sending local video data from the camera.

Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ stopVideoCanvasPreview:

- (ZMVideoSDKErrors) stopVideoCanvasPreview: (NSView *) view

Stops the preview video.

Parameters
viewThe view to preview video.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ stopVideoPreview:

- (ZMVideoSDKErrors) stopVideoPreview: (id< ZMVideoSDKRawDataPipeDelegate >) listener

UnSubscribe preview video raw data with the subscribed callback.

Parameters
listenerThe callback sink object.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ switchCamera

- (BOOL) switchCamera

Switch to the next available camera.

Returns
YES means the function is success, otherwise not.

◆ turnCameraDown:deviceID:

- (ZMVideoSDKErrors) turnCameraDown: (unsigned int) range
deviceID: (nullable NSString *) deviceID 

Tilt the camera down.

Parameters
rangeRotation range, 10 <= range <= 100.
deviceIDThe camera device ID to rotate. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ turnCameraLeft:deviceID:

- (ZMVideoSDKErrors) turnCameraLeft: (unsigned int) range
deviceID: (nullable NSString *) deviceID 

Pan the camera to the left.

Parameters
rangeRotation range, 10 <= range <= 100.
deviceIDThe camera device ID to rotate. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ turnCameraRight:deviceID:

- (ZMVideoSDKErrors) turnCameraRight: (unsigned int) range
deviceID: (nullable NSString *) deviceID 

Pan the camera to the right.

Parameters
rangeRotation range, 10 <= range <= 100.
deviceIDThe camera device ID to rotate. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ turnCameraUp:deviceID:

- (ZMVideoSDKErrors) turnCameraUp: (unsigned int) range
deviceID: (nullable NSString *) deviceID 

Tilt the camera up.

Parameters
rangeRotation range, 10 <= range <= 100.
deviceIDThe camera device ID to rotate. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ unmuteMultiStreamVideo:

- (BOOL) unmuteMultiStreamVideo: (NSString *) cameraDeviceID

Turn on multiple stream video.

Parameters
cameraDeviceIDThe camera ID which is running as multiple camera.
Returns
If the function succeeds, it will return YES, otherwise returns NO.

◆ unSpotlightAllVideos

- (ZMVideoSDKErrors) unSpotlightAllVideos

Call this method to set all user's video unSpotlight.

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

◆ unSpotLightVideo:

- (ZMVideoSDKErrors) unSpotLightVideo: (ZMVideoSDKUser *) user

Call this method to unSpotlight user's video.

Parameters
userWhich you want to unSpotlight video.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success.

◆ zoomCameraIn:deviceID:

- (ZMVideoSDKErrors) zoomCameraIn: (unsigned int) range
deviceID: (nullable NSString *) deviceID 

Zoom the camera in.

Parameters
rangeZoom range, 10 <= range <= 100.
deviceIDThe camera device ID to operate. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.

◆ zoomCameraOut:deviceID:

- (ZMVideoSDKErrors) zoomCameraOut: (unsigned int) range
deviceID: (nullable NSString *) deviceID 

Zoom the camera out.

Parameters
rangeZoom range, 10 <= range <= 100.
deviceIDThe camera device ID to operate. The default is the main camera ID.
Returns
If the function succeeds, it will return ZMVideoSDKErrors_Success.