Unity Video SDK API Reference Documentation
Loading...
Searching...
No Matches
ZMVideoSDKVideoHelper Class Reference

An interface to control video and manage cameras during a video session. See ZMVideoSDK#GetVideoHelper(). More...

Public Member Functions

void StartVideo (Action< ZMVideoSDKErrors > callback)
 Call this method to start sending local video data from the camera.
 
void StopVideo (Action< ZMVideoSDKErrors > callback)
 Call this method to stop sending local video data from the camera.
 
void RotateMyVideo (ZMVideoRotation rotation, Action< bool > callback)
 Call this method to rotate the video when the device is rotated.
 
void SwitchCamera (Action< bool > callback)
 Switch to the next available camera.
 
uint GetNumberOfCameras ()
 Returns number of cameras available to share the video.
 
List< ZMVideoSDKCameraDeviceGetCameraList ()
 Returns a collection of camera devices available to share the video as an object of type WebCamDevice.
 
bool CanControlCamera (string deviceID)
 
ZMVideoSDKErrors TurnCameraLeft (uint range, string deviceID)
 Pan the camera to the left.
 
ZMVideoSDKErrors TurnCameraRight (uint range, string deviceID)
 Pan the camera to the right.
 
ZMVideoSDKErrors TurnCameraUp (uint range, string deviceID)
 Tilt the camera up.
 
ZMVideoSDKErrors TurnCameraDown (uint range, string deviceID)
 Tilt the camera down.
 
ZMVideoSDKErrors ZoomCameraIn (uint range, string deviceID)
 Zoom the camera in.
 
ZMVideoSDKErrors ZoomCameraOut (uint range, string deviceID)
 Zoom the camera out.
 
void SetVideoQualityPreference (ZMVideoSDKPreferenceSetting preferenceSetting, Action< ZMVideoSDKErrors > callback)
 Automatically adjust user's video resolution and frame-rate.
 
bool EnableMultiStreamVideo (string cameraDeviceID, string customDeviceName)
 Enable multiple stream video if you have multiple cameras and other participants can see multiple videos of you.
 
bool DisableMultiStreamVideo (string cameraDeviceID)
 Disable multiple stream video.
 
string GetDeviceIDByMyPipe (ZMVideoSDKRawDataPipe zmVideoSDKRawDataPipe)
 Get the device ID associated with my multi-camera pipe.
 
bool IsMyVideoMirrored ()
 Check if my video is mirrored.
 
bool IsOriginalAspectRatioEnabled ()
 Check if original aspect ratio is enabled.
 
void EnableOriginalAspectRatio (bool bEnabled, Action< bool > callback)
 This function is used to set the aspect ratio of the video sent out.
 
bool SelectCamera (string cameraDeviceID)
 This function is used to select the camera device.
 

Data Fields

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

Detailed Description

An interface to control video and manage cameras during a video session. See ZMVideoSDK#GetVideoHelper().

Definition at line 9 of file ZMVideoSDKVideoHelper.cs.

Member Function Documentation

◆ CanControlCamera()

bool ZMVideoSDKVideoHelper.CanControlCamera ( string  deviceID)
inline

Definition at line 106 of file ZMVideoSDKVideoHelper.cs.

107 {
108 return _videoSDKVideoHelper.CanControlCamera(deviceID);
109 }

◆ DisableMultiStreamVideo()

bool ZMVideoSDKVideoHelper.DisableMultiStreamVideo ( string  cameraDeviceID)
inline

Disable multiple stream video.

Parameters
cameraDeviceIDThe camera id which you want to disable.
Returns
True if success. Otherwise returns false.

Definition at line 211 of file ZMVideoSDKVideoHelper.cs.

212 {
213 return _videoSDKVideoHelper.DisableMultiStreamVideo(cameraDeviceID);
214 }

◆ EnableMultiStreamVideo()

bool ZMVideoSDKVideoHelper.EnableMultiStreamVideo ( string  cameraDeviceID,
string  customDeviceName 
)
inline

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
True if success. Otherwise returns false.

Definition at line 201 of file ZMVideoSDKVideoHelper.cs.

202 {
203 return _videoSDKVideoHelper.EnableMultiStreamVideo(cameraDeviceID, customDeviceName);
204 }

◆ EnableOriginalAspectRatio()

void ZMVideoSDKVideoHelper.EnableOriginalAspectRatio ( bool  bEnabled,
Action< bool >  callback 
)
inline

This function is used to set the aspect ratio of the video sent out.

Parameters
bEnabledFalse means the aspect ratio is 16:9, true means that using the original aspect ratio of video
[out]callbacka callback function to return true if the function succeeds, otherwise false.
Remarks
: If session is using video source and data_mode is not VideoSourceDataMode_None, default always use original aspect ration of video.

Definition at line 255 of file ZMVideoSDKVideoHelper.cs.

256 {
257 _videoSDKVideoHelper.EnableOriginalAspectRatio(bEnabled, callback);
258 }

◆ GetCameraList()

List< ZMVideoSDKCameraDevice > ZMVideoSDKVideoHelper.GetCameraList ( )
inline

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

Returns
Camera devices list.

Definition at line 94 of file ZMVideoSDKVideoHelper.cs.

95 {
96 return _videoSDKVideoHelper.GetCameraList();
97 }

◆ GetDeviceIDByMyPipe()

string ZMVideoSDKVideoHelper.GetDeviceIDByMyPipe ( ZMVideoSDKRawDataPipe  zmVideoSDKRawDataPipe)
inline

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

Parameters
zmVideoSDKRawDataPipeMy multi-camera pipe
Returns
The video device ID if successful. Otherwise returns NULL.

Definition at line 221 of file ZMVideoSDKVideoHelper.cs.

222 {
223 return _videoSDKVideoHelper.GetDeviceIDByMyPipe(zmVideoSDKRawDataPipe);
224 }

◆ GetNumberOfCameras()

uint ZMVideoSDKVideoHelper.GetNumberOfCameras ( )
inline

Returns number of cameras available to share the video.

Returns
Number of cameras.

Definition at line 85 of file ZMVideoSDKVideoHelper.cs.

86 {
87 return _videoSDKVideoHelper.GetNumberOfCameras();
88 }

◆ IsMyVideoMirrored()

bool ZMVideoSDKVideoHelper.IsMyVideoMirrored ( )
inline

Check if my video is mirrored.

Returns
True if mirror is mirrored, otherwise false.

Definition at line 235 of file ZMVideoSDKVideoHelper.cs.

236 {
237 return _videoSDKVideoHelper.IsMyVideoMirrored();
238 }

◆ IsOriginalAspectRatioEnabled()

bool ZMVideoSDKVideoHelper.IsOriginalAspectRatioEnabled ( )
inline

Check if original aspect ratio is enabled.

Returns
True if mirror is enabled, False if not

Definition at line 244 of file ZMVideoSDKVideoHelper.cs.

245 {
246 return _videoSDKVideoHelper.IsOriginalAspectRatioEnabled();
247 }

◆ RotateMyVideo()

void ZMVideoSDKVideoHelper.RotateMyVideo ( ZMVideoRotation  rotation,
Action< bool >  callback 
)
inline

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

Parameters
rotationthe rotation of the video. 0: no rotation (natural orientation); 1: rotate 90 degrees; 2: rotate 180 degrees; 3: rotate 270 degrees.
[out]callbacka callback function to return the ZMVideoSDKErrors status code of this method.

Definition at line 67 of file ZMVideoSDKVideoHelper.cs.

68 {
69 _videoSDKVideoHelper.RotateMyVideo(rotation, callback);
70 }

◆ SelectCamera()

bool ZMVideoSDKVideoHelper.SelectCamera ( string  cameraDeviceID)
inline

This function is used to select the camera device.

Parameters
cameraDeviceIDthe device id
Returns
True if successful, otherwise false

Definition at line 265 of file ZMVideoSDKVideoHelper.cs.

266 {
267 return _videoSDKVideoHelper.SelectCamera(cameraDeviceID);
268 }

◆ SetVideoQualityPreference()

void ZMVideoSDKVideoHelper.SetVideoQualityPreference ( ZMVideoSDKPreferenceSetting  preferenceSetting,
Action< ZMVideoSDKErrors callback 
)
inline

Automatically adjust user's video resolution and frame-rate.

Parameters
[out]preferenceSettingSpecifies the video quality preference.
when setting custom modes, the maximum and minimum frame rates are provided by the developer.
[out]callbackA callback function to return the ZMVideoSDKErrors status code.

Definition at line 189 of file ZMVideoSDKVideoHelper.cs.

190 {
191 _videoSDKVideoHelper.SetVideoQualityPreference(preferenceSetting, callback);
192 }

◆ StartVideo()

void ZMVideoSDKVideoHelper.StartVideo ( Action< ZMVideoSDKErrors callback)
inline

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

Parameters
[out]callbacka callback function to return the ZMVideoSDKErrors status code of this method.

Definition at line 48 of file ZMVideoSDKVideoHelper.cs.

49 {
50 _videoSDKVideoHelper.StartVideo(callback);
51 }

◆ StopVideo()

void ZMVideoSDKVideoHelper.StopVideo ( Action< ZMVideoSDKErrors callback)
inline

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

Parameters
[out]callbacka callback function to return the ZMVideoSDKErrors status code of this method.

Definition at line 57 of file ZMVideoSDKVideoHelper.cs.

58 {
59 _videoSDKVideoHelper.StopVideo(callback);
60 }

◆ SwitchCamera()

void ZMVideoSDKVideoHelper.SwitchCamera ( Action< bool >  callback)
inline

Switch to the next available camera.

Parameters
[out]callbacka callback function to return true if the function succeeds, otherwise false.

Definition at line 76 of file ZMVideoSDKVideoHelper.cs.

77 {
78 _videoSDKVideoHelper.SwitchCamera(callback);
79 }

◆ TurnCameraDown()

ZMVideoSDKErrors ZMVideoSDKVideoHelper.TurnCameraDown ( uint  range,
string  deviceID 
)
inline

Tilt the camera down.

Parameters
rangeRotation range, 10 <= range <= 100.
deviceIDThe camera device ID to operate.The default is the main camera ID.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise it fails. To get extended error information, see ZMVideoSDKErrors enum.

Definition at line 154 of file ZMVideoSDKVideoHelper.cs.

155 {
156 return _videoSDKVideoHelper.TurnCameraDown(range, deviceID);
157 }

◆ TurnCameraLeft()

ZMVideoSDKErrors ZMVideoSDKVideoHelper.TurnCameraLeft ( uint  range,
string  deviceID 
)
inline

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, the return value is ZMVideoSDKErrors_Success. Otherwise it fails. To get extended error information, see ZMVideoSDKErrors enum.

Definition at line 118 of file ZMVideoSDKVideoHelper.cs.

119 {
120 return _videoSDKVideoHelper.TurnCameraLeft(range, deviceID);
121 }

◆ TurnCameraRight()

ZMVideoSDKErrors ZMVideoSDKVideoHelper.TurnCameraRight ( uint  range,
string  deviceID 
)
inline

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, the return value is ZMVideoSDKErrors_Success. Otherwise failed. To get extended error information, see ZMVideoSDKErrors enum.

Definition at line 130 of file ZMVideoSDKVideoHelper.cs.

131 {
132 return _videoSDKVideoHelper.TurnCameraRight(range, deviceID);
133 }

◆ TurnCameraUp()

ZMVideoSDKErrors ZMVideoSDKVideoHelper.TurnCameraUp ( uint  range,
string  deviceID 
)
inline

Tilt the camera up.

Parameters
rangeRotation range, 10 <= range <= 100.
deviceIDThe camera device ID to operate.The default is main camera ID.
Returns
If the function succeeds, the return value is ZMVideoSDKErrors_Success. Otherwise it fails. To get extended error information, see ZMVideoSDKErrors enum.

Definition at line 142 of file ZMVideoSDKVideoHelper.cs.

143 {
144 return _videoSDKVideoHelper.TurnCameraUp(range, deviceID);
145 }

◆ ZoomCameraIn()

ZMVideoSDKErrors ZMVideoSDKVideoHelper.ZoomCameraIn ( uint  range,
string  deviceID 
)
inline

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, the return value is ZMVideoSDKErrors_Success. Otherwise it fails. To get extended error information, see ZMVideoSDKErrors enum.

Definition at line 166 of file ZMVideoSDKVideoHelper.cs.

167 {
168 return _videoSDKVideoHelper.ZoomCameraIn(range, deviceID);
169 }

◆ ZoomCameraOut()

ZMVideoSDKErrors ZMVideoSDKVideoHelper.ZoomCameraOut ( uint  range,
string  deviceID 
)
inline

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, the return value is ZMVideoSDKErrors_Success. Otherwise it fails. To get extended error information, see ZMVideoSDKErrors enum.

Definition at line 178 of file ZMVideoSDKVideoHelper.cs.

179 {
180 return _videoSDKVideoHelper.ZoomCameraOut(range, deviceID);
181 }

Field Documentation

◆ ZMVideoSDKErrors

ZMVideoSDKVideoHelper.ZMVideoSDKErrors

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

Parameters
deviceIDThe camera device ID to check. The default is the main camera ID.
Returns
Return a tuple, if the function succeeds, return ZMVideoSDKErrors_Success, otherwise it fails. To get extended error information, see ZMVideoSDKErrors enum; Return true if the user's camera can be controled, otherwise false.

Definition at line 106 of file ZMVideoSDKVideoHelper.cs.