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

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

#include <ZMVideoSDKVideoHelper.h>

Inherits NSObject.

Instance Methods

(ZMVideoSDKErrors- startVideo
 Starts sending local video data from the camera.
 
(ZMVideoSDKErrors- stopVideo
 Stops sending local video data from the camera.
 
(BOOL) - rotateMyVideo:
 Rotates the video when the device is rotated.
 
(BOOL) - switchCamera
 Switches to the next available camera.
 
(BOOL) - selectCamera:
 Switches 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:
 Checks 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:
 Enables multiple stream video if you have multiple cameras, and other participants can see multiple videos of you.
 
(BOOL) - disableMultiStreamVideo:
 Disables multiple stream video.
 
(BOOL) - muteMultiStreamVideo:
 Turn off multiple stream video.
 
(BOOL) - unmuteMultiStreamVideo:
 Turn on multiple stream video.
 
(NSString *_Nullable) - getDeviceIDByMyPipe:
 Gets the device ID associated with my multi-camera pipe.
 
(ZMVideoSDKErrors- startVideoPreview:deviceID:
 Subscribes preview video raw data with a callback.
 
(ZMVideoSDKErrors- startVideoPreview:deviceID:resolution:
 Subscribes 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:
 Adds virtual background object.
 
(ZMVideoSDKErrors- removeVirtualBackgroundItem:
 Removes 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
 Gets a selected virtual background item.
 
(BOOL) - isOriginalAspectRatioEnabled
 Determines whether current aspect ratio is the original aspect ratio of video.
 
(BOOL) - enableOriginalAspectRatio:
 Sets the aspect ratio of the video sent out.
 
(ZMVideoSDKErrors- mirrorMyVideo:
 Mirrors the current user's video. Valid only for canvas.
 
(BOOL) - isMyVideoMirrored
 Determines whether mirror my video is enabled.
 
(BOOL) - isDeviceSupportAlphaChannelMode
 Determines if the current device supports alpha channel mode.
 
(BOOL) - canEnableAlphaChannelMode
 Determines if alpha channel mode is available.
 
(ZMVideoSDKErrors- enableAlphaChannelMode:
 Enables or disables alpha channel mode.
 
(BOOL) - isAlphaChannelModeEnabled
 Determines if alpha channel mode is enabled.
 
(ZMVideoSDKErrors- spotLightVideo:
 Spotlights user's video.
 
(ZMVideoSDKErrors- unSpotLightVideo:
 UnSpotlights user's video.
 
(ZMVideoSDKErrors- unSpotlightAllVideos
 Sets all user's video unSpotlight.
 
(NSArray< ZMVideoSDKUser * > *_Nullable) - getSpotlightedVideoUserList
 Enables or disables alpha channel mode.
 

Detailed Description

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 

Adds 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ canControlCamera:deviceID:

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

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

Parameters
canControlThe output parameter. YES indicates can control local camera, NO otherwise.
deviceIDThe camera device ID to check. The default is the main camera ID.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ canEnableAlphaChannelMode

- (BOOL) canEnableAlphaChannelMode

Determines if alpha channel mode is available.

Returns
YES if it is available. Otherwise, NO.

◆ disableMultiStreamVideo:

- (BOOL) disableMultiStreamVideo: (NSString *) cameraDeviceID

Disables multiple stream video.

Parameters
cameraDeviceIDThe camera ID which you want to disable.
Returns
If the function succeeds, it returns YES. Otherwise, NO.

◆ enableAlphaChannelMode:

- (ZMVideoSDKErrors) enableAlphaChannelMode: (BOOL) enabled

Enables or disables alpha channel mode.

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

◆ enableMultiStreamVideo:customDeviceName:

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

Enables 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 camera's custom device name. If this parameter is not passed, a default name will be generated.
Returns
If the function succeeds, it returns YES. Otherwise, NO.

◆ enableOriginalAspectRatio:

- (BOOL) enableOriginalAspectRatio: (BOOL) bEnabled

Sets the aspect ratio of the video sent out.

Parameters
bEnabledNO indicates the aspect ratio is 16:9, YES indicates that using the original aspect ratio of video.
Returns
If the function succeeds, it returns YES. Otherwise, NO.
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
If the function succeeds, it returns camera devices list. Otherwise, this function fails and returns nil.

◆ getDeviceIDByMyPipe:

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

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

Parameters
pipeMy multi-camera pipe.
Returns
If the function succeeds, it returns the video device ID. Otherwise, this function fails and returns nil.

◆ getNumberOfCameras

- (unsigned int) getNumberOfCameras

Returns number of cameras available to share the video.

Returns
The count of cameras.

◆ getSelectedVirtualBackgroundItem

- (ZMVideoSDKVirtualBackgroundItem *_Nullable) getSelectedVirtualBackgroundItem

Gets a selected virtual background item.

Returns
If the function succeeds, it returns the object of ZMVideoSDKVirtualBackgroundItem. Otherwise, this function fails and returns nil.

◆ getSpotlightedVideoUserList

- (NSArray< ZMVideoSDKUser * > *_Nullable) getSpotlightedVideoUserList

Enables or disables alpha channel mode.

Returns
If the function succeeds, it returns ZMVideoSDKUser object list. Otherwise, this function fails and returns nil.

◆ getVirtualBackgroundItemList

- (NSArray< ZMVideoSDKVirtualBackgroundItem * > *_Nullable) getVirtualBackgroundItemList

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

Returns
If the function succeeds, it returns a list of virtual background items. Otherwise, this function fails and returns nil.

◆ isAlphaChannelModeEnabled

- (BOOL) isAlphaChannelModeEnabled

Determines if alpha channel mode is enabled.

Returns
YES if is in alpha channel mode. Otherwise, NO.

◆ isDeviceSupportAlphaChannelMode

- (BOOL) isDeviceSupportAlphaChannelMode

Determines if the current device supports alpha channel mode.

Returns
YES if that the current device supports alpha channel mode. Otherwise, NO.

◆ isMyVideoMirrored

- (BOOL) isMyVideoMirrored

Determines whether mirror my video is enabled.

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

◆ isOriginalAspectRatioEnabled

- (BOOL) isOriginalAspectRatioEnabled

Determines 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, NO to disable.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns YES. Otherwise, NO.

◆ removeVirtualBackgroundItem:

- (ZMVideoSDKErrors) removeVirtualBackgroundItem: (ZMVideoSDKVirtualBackgroundItem *) imageItem

Removes virtual background object.

Parameters
imageItemThe ZMVideoSDKVirtualBackgroundItem object to be removed.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ rotateMyVideo:

- (BOOL) rotateMyVideo: (ZMVideoRotation) rotation

Rotates the video when the device is rotated.

Parameters
rotationIt is emum.
Returns
YES if the function is success. Otherwise, NO.

◆ selectCamera:

- (BOOL) selectCamera: (NSString *) cameraDeviceID

Switches to the camera passed in as cameraDevice.

Parameters
cameraDeviceIDThe ID of camera.
Returns
YES if the function is success. Otherwise, NO.

◆ setVideoQualityPreference:

- (ZMVideoSDKErrors) setVideoQualityPreference: (ZMVideoSDKPreferenceSetting *) preferenceSetting

Adjust user's video solution and frame-rate.

Parameters
preferenceSettingAn instance of ZMVideoSDKPreferenceSetting.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ setVirtualBackgroundItem:

- (ZMVideoSDKErrors) setVirtualBackgroundItem: (ZMVideoSDKVirtualBackgroundItem *) imageItem

Select virtual background item.

Parameters
imageItemThe ZMVideoSDKVirtualBackgroundItem object to select.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ spotLightVideo:

- (ZMVideoSDKErrors) spotLightVideo: (ZMVideoSDKUser *) user

Spotlights user's video.

Parameters
userWhich you want to spotlight video.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startVideo

- (ZMVideoSDKErrors) startVideo

Starts sending local video data from the camera.

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

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ startVideoPreview:deviceID:

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

Subscribes preview video raw data with a callback.

Parameters
listenerThe callback sink object.
cameraDeviceIDThe camera ID.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Deprecated
Use resolution: instead.

◆ startVideoPreview:deviceID:resolution:

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

Subscribes to preview video raw data with a callback.

Parameters
listenerThe callback object.
cameraDeviceIDCamera device ID.
resolutionSpecify the resolution for opening the camera.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ stopVideo

- (ZMVideoSDKErrors) stopVideo

Stops sending local video data from the camera.

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

◆ stopVideoCanvasPreview:

- (ZMVideoSDKErrors) stopVideoCanvasPreview: (NSView *) view

Stops the preview video.

Parameters
viewThe view to preview video.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ switchCamera

- (BOOL) switchCamera

Switches to the next available camera.

Returns
YES if the function is success. Otherwise, NO.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns YES. Otherwise, NO.

◆ unSpotlightAllVideos

- (ZMVideoSDKErrors) unSpotlightAllVideos

Sets all user's video unSpotlight.

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

◆ unSpotLightVideo:

- (ZMVideoSDKErrors) unSpotLightVideo: (ZMVideoSDKUser *) user

UnSpotlights user's video.

Parameters
userWhich you want to unSpotlight video.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.

◆ 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 returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.