Last updated: 2022-11-17 16:50:16
TXUGCRecord
Instantiation API
Camera and mic APIs
API |
Description |
startCameraSimple |
Starts the camera preview. |
startCameraCustom |
Starts the camera preview. |
setVideoResolution |
Changes the shooting resolution. For this API to work, it must be called after startCamera . |
setVideoRenderMode |
Sets the rendering mode. For this API to work, it must be called after startCamera . |
setVideoBitrate |
Changes the shooting bitrate. |
setZoom |
Sets the camera factor. For this API to work, it must be called after startCamera . |
switchCamera |
Switches between the front and rear cameras. For this API to work, it must be called after startCamera . |
toggleTorch |
Turns on/off the flashlight. For this API to work, it must be called after startCamera . |
stopCameraPreview |
Stops the camera preview. |
Shooting APIs
Shooting effect APIs
Background music APIs
API |
Description |
setBGM |
Sets the background music (not supported in UGSV Lite). |
setBGMAsset |
Sets the background music (not supported in UGSV Lite). |
setBGMLoop |
Sets whether to loop the background music (not supported in UGSV Lite). |
playBGMFromTime |
Plays the background music (not supported in UGSV Lite). |
stopBGM |
Stops the background music (not supported in UGSV Lite). |
pauseBGM |
Pauses the background music (not supported in UGSV Lite). |
resumeBGM |
Resumes the background music (not supported in UGSV Lite). |
setMicVolume |
Sets the mic volume. |
setBGMVolume |
Sets the volume of the background music. |
setReverbType |
Sets the reverb effect. (not supported in UGSV Lite). |
setVoiceChangerType |
Sets the voice changing effect (not supported in UGSV Lite). |
snapshot |
Takes a screenshot/photo (not supported in UGSV Lite). For this API to work, it must be called after startCamera . |
TXUGCRecordListener
Shooting callbacks
TXUGCRecordTypeDef
Definitions of key types
Enumerated types
Error Codes
Shooting result
Message |
Code |
Description |
UGC_RECORD_RESULT_OK |
0 |
The shooting was successful (ended by the user), and a video will be generated. |
UGC_RECORD_RESULT_OK_INTERRUPT |
1 |
The shooting was successful (interrupted by an alarm, a call, or switching of the app to the background), and a video will be generated. |
UGC_RECORD_RESULT_OK_UNREACH_MINDURATION |
2 |
The shooting was successful (the duration was shorter than the minimum duration allowed), and a video will be generated. |
UGC_RECORD_RESULT_OK_BEYOND_MAXDURATION |
3 |
The shooting was successful (the duration was longer than the maximum duration allowed), and a video will be generated. |
UGC_RECORD_RESULT_FAILED |
1001 |
The shooting failed. No video will be generated. |
Was this page helpful?