Documentation
ExpressVideoSDK Video Call
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Video Call
  • Function overview
  • Function Overview

Function Overview

Last updated:2025-08-27 12:10

ZEGO SDK has network nodes that fully cover key areas of the world, provides rich APIs, and provides clear and stable real-time voice and video cloud services for multiple terminals.

For the error codes returned by the API, please refer to: https://www.zegocloud.com/docs/video-call/error-code.

The following is a brief introduction to the basic API.

main

Method Description
CreateEngine Create ZegoExpressEngine singleton object and initialize SDK.
DestroyEngine Destroy the ZegoExpressEngine singleton object and deinitialize the SDK.
GetEngine Returns the singleton instance of ZegoExpressEngine.
SetEngineConfig Set advanced engine configuration.
SetLogConfig Set log configuration.
SetRoomMode Set room mode.
GetVersion Gets the SDK's version number.
UploadLog Uploads logs to the ZEGO server.
SubmitLog Uploads logs to the ZEGO server.
EnableDebugAssistant Enable the debug assistant. Note, do not enable this feature in the online version! Use only during development phase!
OnDebugError The callback for obtaining debugging error information.
OnEngineStateUpdate The callback triggered when the audio/video engine state changes.

room

Method Description
LoginRoom Logs in to a room with advanced room configurations. You must log in to a room before publishing or playing streams.
LogoutRoom Exit the room.
LogoutRoom Exit the room of the specified room ID.
SwitchRoom Switch the room with advanced room configurations.
SetRoomExtraInfo Set room extra information.
OnRoomStateUpdate Notification of the room connection state changes.
OnRoomUserUpdate The callback triggered when the number of other users in the room increases or decreases.
OnRoomOnlineUserCountUpdate The callback triggered every 30 seconds to report the current number of online users.
OnRoomStreamUpdate The callback triggered when the number of streams published by the other users in the same room increases or decreases.
OnRoomStreamExtraInfoUpdate The callback triggered when there is an update on the extra information of the streams published by other users in the same room.
OnRoomExtraInfoUpdate The callback triggered when there is an update on the extra information of the room.

publisher

Method Description
StartPublishingStream Starts publishing a stream (for the specified channel). You can call this function to publish a second stream.
StartPublishingStream Starts publishing a stream. Support multi-room mode.
StopPublishingStream Stops publishing a stream (for the specified channel).
SetStreamExtraInfo Sets the extra information of the stream being published for the specified publish channel.
StartPreview Starts/Updates the local video preview (for the specified channel).
StopPreview Stops the local preview (for the specified channel).
SetVideoConfig Sets up the video configurations (for the specified channel).
GetVideoConfig Gets the current video configurations (for the specified channel).
SetVideoMirrorMode Sets the video mirroring mode (for the specified channel).
SetAppOrientation Sets the video orientation (for the specified channel).
SetAudioConfig Sets up the audio configurations for the specified publish channel.
GetAudioConfig Gets the current audio configurations.
MutePublishStreamAudio Stops or resumes sending the audio part of a stream for the specified channel.
MutePublishStreamVideo Stops or resumes sending the video part of a stream for the specified channel.
EnableTrafficControl Enables or disables traffic control.
SetMinVideoBitrateForTrafficControl Set the minimum video bitrate threshold for traffic control.
SetCaptureVolume Sets the audio recording volume for stream publishing.
SetAudioCaptureStereoMode Set audio capture stereo mode.
AddPublishCdnUrl Adds a target CDN URL to which the stream will be relayed from ZEGO RTC server.
RemovePublishCdnUrl Deletes the specified CDN URL, which is used for relaying streams from ZEGO RTC server to CDN.
EnablePublishDirectToCDN Whether to directly push to CDN (without going through the ZEGO RTC server), for the specified channel.
SendSEI Sends Supplemental Enhancement Information to the specified publish channel.
EnableHardwareEncoder Enables or disables hardware encoding.
SetCapturePipelineScaleMode Sets the timing of video scaling in the video capture workflow. You can choose to do video scaling right after video capture (the default value) or before encoding.
OnPublisherStateUpdate The callback triggered when the state of stream publishing changes.
OnPublisherQualityUpdate Callback for current stream publishing quality.
OnPublisherCapturedAudioFirstFrame The callback triggered when the first audio frame is captured.
OnPublisherCapturedVideoFirstFrame The callback triggered when the first video frame is captured.
OnPublisherVideoSizeChanged The callback triggered when the video capture resolution changes.
OnPublisherRelayCDNStateUpdate The callback triggered when the state of relayed streaming to CDN changes.

player

Method Description
StartPlayingStream Starts playing a stream from ZEGO RTC server or from third-party CDN. Support multi-room mode.
StopPlayingStream Stops playing a stream.
SetPlayVolume Sets the stream playback volume.
MutePlayStreamAudio Whether the pull stream can receive the specified audio data.
MutePlayStreamVideo Whether the pull stream can receive the specified video data.
EnableHardwareDecoder Enables or disables hardware decoding.
EnableCheckPoc Enables or disables frame order detection.
OnPlayerStateUpdate The callback triggered when the state of stream playing changes.
OnPlayerQualityUpdate Callback for current stream playing quality.
OnPlayerMediaEvent The callback triggered when a media event occurs during streaming playing.
OnPlayerRecvAudioFirstFrame The callback triggered when the first audio frame is received.
OnPlayerRecvVideoFirstFrame The callback triggered when the first video frame is received.
OnPlayerRenderVideoFirstFrame The callback triggered when the first video frame is rendered.
OnPlayerVideoSizeChanged The callback triggered when the stream playback resolution changes.
OnPlayerRecvSEI The callback triggered when Supplemental Enhancement Information is received.

IM

Method Description
SendBroadcastMessage Sends a Broadcast Message.
SendBarrageMessage Sends a Barrage Message (bullet screen) to all users in the same room, without guaranteeing the delivery.
SendCustomCommand Sends a Custom Command to the specified users in the same room.
OnIMRecvBroadcastMessage The callback triggered when Broadcast Messages are received.
OnIMRecvBarrageMessage The callback triggered when Barrage Messages are received.
OnIMRecvCustomCommand The callback triggered when a Custom Command is received.

mixer

Method Description
StartMixerTask Starts a stream mixing task.
StopMixerTask Stops a stream mixing task.
OnMixerRelayCDNStateUpdate The callback triggered when the state of relayed streaming of the mixed stream to CDN changes.
OnMixerSoundLevelUpdate The callback triggered when the sound level of any input stream changes in the stream mixing process.

preprocess

Method Description
EnableAEC Whether to enable acoustic echo cancellation (AEC).
SetAECMode Sets the acoustic echo cancellation (AEC) mode.
EnableAGC Enables or disables automatic gain control (AGC).
EnableANS Enables or disables active noise suppression (ANS, aka ANC).
EnableTransientANS Enables or disables transient noise suppression.
SetANSMode Sets the automatic noise suppression (ANS) mode.

mediaPlayer

Method Description
CreateMediaPlayer Creates a media player instance.
DestroyMediaPlayer Destroys a media player instance.

record

Method Description
StartRecordingCapturedData Starts to record and directly save the data to a file.
StopRecordingCapturedData Stops recording locally captured audio or video.
OnCapturedDataRecordStateUpdate The callback triggered when the state of data recording (to a file) changes.
OnCapturedDataRecordProgressUpdate The callback to report the current recording progress.

device

Method Description
MuteMicrophone Mutes or unmutes the microphone.
IsMicrophoneMuted Checks whether the microphone is muted.
MuteSpeaker Mutes or unmutes the audio output speaker.
IsSpeakerMuted Checks whether the audio output speaker is muted.
GetAudioDeviceList Gets a list of audio devices.
UseAudioDevice Chooses to use the specified audio device.
EnableAudioCaptureDevice Enables or disables the audio capture device.
EnableCamera Turns on/off the camera (for the specified channel).
UseFrontCamera Switches to the front or the rear camera (for the specified channel).
UseVideoDevice Chooses to use the specified video device (for the specified channel).
GetVideoDeviceList Gets a list of video devices.
StartSoundLevelMonitor Starts sound level monitoring. Support setting the listening interval.
StartSoundLevelMonitor Starts sound level monitoring. Support enable some advanced feature.
StopSoundLevelMonitor Stops sound level monitoring.
StartAudioSpectrumMonitor Starts audio spectrum monitoring. Support setting the listening interval.
StopAudioSpectrumMonitor Stops audio spectrum monitoring.
EnableHeadphoneMonitor Enables or disables headphone monitoring.
SetHeadphoneMonitorVolume Sets the headphone monitor volume.
OnCapturedSoundLevelUpdate The local captured audio sound level callback.
OnRemoteSoundLevelUpdate The remote playing streams audio sound level callback.
OnCapturedAudioSpectrumUpdate The local captured audio spectrum callback.
OnRemoteAudioSpectrumUpdate The remote playing streams audio spectrum callback.
OnLocalDeviceExceptionOccurred The callback triggered when a local device exception occurred.
OnRemoteCameraStateUpdate The callback triggered when the state of the remote camera changes.
OnRemoteMicStateUpdate The callback triggered when the state of the remote microphone changes.

customVideoIO

Method Description
EnableCustomVideoRender Enables or disables custom video rendering.
EnableCustomVideoCapture Enables or disables custom video capture (for the specified channel).
SendCustomVideoCaptureRawData Sends the video frames (Raw Data) produced by custom video capture to the SDK (for the specified channel).
SendCustomVideoCaptureRawData Sends the video frames (Raw Data) produced by custom video capture to the SDK (for the specified channel).
OnCustomVideoCaptureStart Customize the notification of the start of video capture.
OnCustomVideoCaptureStop Customize the notification of the end of the collection.
OnCapturedVideoFrameRawData When custom video rendering is enabled, the original video frame data collected by the local preview is called back.
OnRemoteVideoFrameRawData When custom video rendering is enabled, the remote end pulls the original video frame data to call back, and distinguishes different streams by streamID.
EnableCustomVideoProcessing Enables or disables custom video processing, and support specifying the publish channel.

customAudioIO

Method Description
StartAudioDataObserver Enable audio data observering.
StopAudioDataObserver Disable audio data observering.
EnableCustomAudioIO Enables the custom audio I/O function (for the specified channel), support PCM, AAC format data.
SendCustomAudioCaptureAACData Sends AAC audio data produced by custom audio capture to the SDK (for the specified channel).
SendCustomAudioCapturePCMData Sends PCM audio data produced by custom audio capture to the SDK (for the specified channel).
FetchCustomAudioRenderPCMData Fetches PCM audio data of the remote stream from the SDK for custom audio rendering.
OnCapturedAudioData The callback for obtaining the audio data captured by the local microphone.
OnPlaybackAudioData The callback for obtaining the audio data of all the streams playback by SDK.
OnMixedAudioData Callback to get the audio data played by the SDK and the audio data captured by the local microphone. The audio data is the data mixed by the SDK.
OnPlayerAudioData The callback for obtaining the audio data of each stream.

CopyrightedMusic

Method Description
CreateCopyrightedMusic Creates a copyrighted music instance.
DestroyCopyrightedMusic Destroys a copyrighted music instance.
InitCopyrightedMusic Initialize the copyrighted music module.
GetCacheSize Get cache size.
ClearCache Clear cache.
SendExtendedRequest Send extended feature request.
GetLrcLyric Get lyrics in lrc format.
GetKrcLyricByToken Get lyrics in krc format.
Download Download music resource.
GetDuration Get the playing time of a song or accompaniment file.
OnDownloadProgressUpdate Callback for download song or accompaniment progress rate.

deprecated_api

Method Description
EnableBeautify [Deprecated] Enables or disables the beauty features for the specified publish channel. Deprecated since 2.16.0, please use the [enableEffectsBeauty] function instead.
SetBeautifyOption [Deprecated] Set beautify option. Deprecated since 2.16.0, please use the [setEffectsBeautyParam] function instead.
CreateEngine [Deprecated] Create ZegoExpressEngine singleton object and initialize SDK. Deprecated since 2.14.0, please use the method with the same name without [isTestEnv] parameter instead. Please refer to Testing environment deprecation for more details.
RequestSong [Deprecated] Request a song. Deprecated since 3.0.2, please use the [requestResource] function instead.
RequestAccompaniment [Deprecated] Request accompaniment. Deprecated since 3.0.2, please use the [requestResource] function instead.
GetMusicByToken [Deprecated] Get a song or accompaniment. Deprecated since 3.0.2, please use the [getSharedResource] function instead.
GetLrcLyric [Deprecated] Get lyrics in lrc format. Deprecated since 3.2.1, please use the method with the same name with [vendorID] parameter instead.
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code