logo
Video Call
On this page

Function Overview


ZEGO Express SDKs provide rich APIs for you to quickly build audio/video calling and live streaming capabilities into your applications based on ZEGO's cloud live streaming platform. With a powerful audio/video processing engine and a global real-time network, the platform is providing high-quality and reliable cloud audio/video streaming services to businesses around the world.

ZEGO Express SDKs are available for all major platforms, including Android, iOS, Mac, Windows, and Web.

MethodDescription
createEngineWithProfileCreate ZegoExpressEngine singleton object and initialize SDK.
destroyEngineDestroy the ZegoExpressEngine singleton object and deinitialize the SDK.
setEngineConfigSet advanced engine configuration.
setRoomModeSet room mode.
getVersionGets the SDK's version number.
uploadLogUploads logs to the ZEGO server.
callExperimentalAPICall the experimental API.
on<EventType extends keyof ZegoEventListener>Register event handler
off<EventType extends keyof ZegoEventListener>Unregister event handler
debugErrorThe callback for obtaining debugging error information.
apiCalledResultMethod execution result callback
engineStateUpdateThe callback triggered when the audio/video engine state changes.
recvExperimentalAPIExperimental API callback

Room functions

MethodDescription
loginRoomLog in to the room by configuring advanced properties, and return the login result through the callback parameter. You must log in to the room before pushing or pulling the stream.
logoutRoomExit the room of the specified room ID with callback.
switchRoomSwitch the room with advanced room configurations.
renewTokenRenew token.
setRoomExtraInfoSet room extra information.
roomStateUpdateNotification of the room connection state changes.
roomStateChangedNotification of the room connection state changes, including specific reasons for state change.
roomUserUpdateThe callback triggered when the number of other users in the room increases or decreases.
roomOnlineUserCountUpdateThe callback triggered every 30 seconds to report the current number of online users.
roomStreamUpdateThe callback triggered when the number of streams published by the other users in the same room increases or decreases.
roomStreamExtraInfoUpdateThe callback triggered when there is an update on the extra information of the streams published by other users in the same room.
roomExtraInfoUpdateThe callback triggered when there is an update on the extra information of the room.
roomTokenWillExpireCallback notification that room Token authentication is about to expire.

Stream Publishing Functions

MethodDescription
startPublishingStreamStarts publishing a stream. Support multi-room mode.
stopPublishingStreamStops publishing a stream (for the specified channel).
setStreamExtraInfoSets the extra information of the stream being published for the specified publish channel.
startPreviewStarts/Updates the local video preview (for the specified channel).
stopPreviewStops the local preview (for the specified channel).
setVideoConfigSets up the video configurations (for the specified channel).
getVideoConfigGets the current video configurations (for the specified channel).
setVideoMirrorModeSets the video mirroring mode (for the specified channel).
setAppOrientationSets the video orientation (for the specified channel).
setAudioConfigSets up the audio configurations for the specified publish channel.
getAudioConfigGets the current audio configurations from the specified publish channel.
takePublishStreamSnapshotTake a snapshot of the publishing stream for the specified publish channel.
mutePublishStreamAudioStops or resumes sending the audio part of a stream for the specified channel.
mutePublishStreamVideoStops or resumes sending the video part of a stream for the specified channel.
setCaptureVolumeSets the audio recording volume for stream publishing.
addPublishCdnUrlAdds a target CDN URL to which the stream will be relayed from ZEGO RTC server.
removePublishCdnUrlDeletes the specified CDN URL, which is used for relaying streams from ZEGO RTC server to CDN.
enablePublishDirectToCDNWhether to directly push to CDN (without going through the ZEGO RTC server), for the specified channel.
sendSEISends Supplemental Enhancement Information to the specified publish channel.
enableHardwareEncoderEnables or disables hardware encoding.
enableH265EncodeFallbackWhether to enable H.265 encoding to automatically downgrade to H.264 encoding.
isVideoEncoderSupportedWhether the specified video encoding type is supported.
setVideoSourceSet video capture source for the specified channel.
setAudioSourceSet audio capture source for the specified channel.
enableVideoObjectSegmentationEnable video object segmentation.
enableAlphaChannelVideoEncoderEnable video encoder alpha channel support.
publisherStateUpdateThe callback triggered when the state of stream publishing changes.
publisherQualityUpdateCallback for current stream publishing quality.
publisherCapturedAudioFirstFrameThe callback triggered when the first audio frame is captured.
publisherCapturedVideoFirstFrameThe callback triggered when the first video frame is captured.
publisherRenderVideoFirstFrameThe callback triggered when the first video frame is rendered.
publisherVideoSizeChangedThe callback triggered when the video capture resolution changes.
publisherRelayCDNStateUpdateThe callback triggered when the state of relayed streaming to CDN changes.
publisherVideoEncoderChangedThe callback triggered when the video encoder changes in publishing stream.
publisherStreamEventThe callback triggered when publishing stream.
videoObjectSegmentationStateChangedThe video object segmentation state changed.

Stream Playing Functions

MethodDescription
startPlayingStreamStarts playing a stream from ZEGO RTC server or from third-party CDN. Support multi-room mode.
stopPlayingStreamStops playing a stream.
takePlayStreamSnapshotTake a snapshot of the playing stream.
setPlayVolumeSets the stream playback volume.
setAllPlayStreamVolumeSets the all stream playback volume.
setPlayStreamVideoTypeSet play video stream type.
mutePlayStreamAudioWhether the pull stream can receive the specified audio data.
mutePlayStreamVideoWhether the pull stream can receive the specified video data.
muteAllPlayStreamAudioCan the pull stream receive all audio data. (When set to true, calling [mutePlayStreamAudio] will not take effect)
muteAllPlayStreamVideoCan the pull stream receive all video data. (When set to true, calling [mutePlayStreamVideo] will not take effect)
enableHardwareDecoderEnables or disables hardware decoding.
isVideoDecoderSupportedWhether the specified video decoding format is supported.
playerStateUpdateThe callback triggered when the state of stream playing changes.
playerQualityUpdateCallback for current stream playing quality.
playerMediaEventThe callback triggered when a media event occurs during streaming playing.
playerRecvAudioFirstFrameThe callback triggered when the first audio frame is received.
playerRecvVideoFirstFrameThe callback triggered when the first video frame is received.
playerRenderVideoFirstFrameThe callback triggered when the first video frame is rendered.
playerVideoSizeChangedThe callback triggered when the stream playback resolution changes.
playerRecvSEIThe callback triggered when Supplemental Enhancement Information is received.

Instant Messaging Functions

MethodDescription
sendBroadcastMessageSends a Broadcast Message.
sendBarrageMessageSends a Barrage Message (bullet screen) to all users in the same room, without guaranteeing the delivery.
sendCustomCommandSends a Custom Command to the specified users in the same room.
IMRecvBroadcastMessageThe callback triggered when Broadcast Messages are received.
IMRecvBarrageMessageThe callback triggered when Barrage Messages are received.
IMRecvCustomCommandThe callback triggered when a Custom Command is received.

Stream Mixing Functions

MethodDescription
startMixerTaskStarts a stream mixing task.
stopMixerTaskStops a stream mixing task.
mixerRelayCDNStateUpdateThe callback triggered when the state of relayed streaming of the mixed stream to CDN changes.
mixerSoundLevelUpdateThe callback triggered when the sound level of any input stream changes in the stream mixing process.

Audio and Video Preprocessing Functions

MethodDescription
enableAECWhether to enable acoustic echo cancellation (AEC).
enableHeadphoneAECWhether to turn on acoustic echo cancellation (AEC) when using the headphone.
setAECModeSets the acoustic echo cancellation (AEC) mode.
enableAGCEnables or disables automatic gain control (AGC).
enableANSEnables or disables active noise suppression (ANS, aka ANC).
setANSModeSets the automatic noise suppression (ANS) mode.
startEffectsEnvEnable the Effects beauty environment.
stopEffectsEnvDisable the Effects beauty environment.
enableEffectsBeautyEnables or disables the beauty effect.
setEffectsBeautyParamSet beautify param.
setAudioEqualizerGainSet the sound equalizer (EQ).
setVoiceChangerPresetSetting up the voice changer via preset enumeration.
setVoiceChangerParamSetting up the specific voice changer parameters.
setReverbPresetSetting up the reverberation via preset enumeration.
setReverbAdvancedParamSetting up the specific reverberation parameters.
setReverbEchoParamSetting up the specific reverberation echo parameters.
setElectronicEffectsTurn on or off the electronic sound effect.

MediaPlayer Functions

MethodDescription
createMediaPlayerCreates a media player instance.
destroyMediaPlayerDestroys a media player instance.
loadResourceLoad local or network media resource.
loadResourceWithConfigLoad local or network media resource with config.
startStart playing.
stopStop playing.
pausePause playing.
resumeResume playing.
seekToSet the specified playback progress.
enableRepeatWhether to repeat playback.
setPlaySpeedSet the speed of play.
enableAuxWhether to mix the player's sound into the stream being published.
muteLocalWhether to play locally silently.
setPlayerViewSet the view of the player playing video.
setVolumeSet mediaplayer volume. Both the local play volume and the publish volume are set.
setPlayVolumeSet mediaplayer local playback volume.
setPublishVolumeSet mediaplayer publish volume.
setProgressIntervalSet playback progress callback interval.
getPlayVolumeGets the current local playback volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.
getPublishVolumeGets the current publish volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.
getTotalDurationGet the total progress of your media resources.
getCurrentProgressGet current playing progress.
getCurrentRenderingProgressGet current rendering progress.
getAudioTrackCountGet the number of audio tracks of the playback file.
setAudioTrackIndexSet the audio track of the playback file.
getCurrentStateGet the current playback status.
getIndexGet media player index.
on<MediaPlayerEventType extends keyof ZegoMediaPlayerListener>Register the event handler of mediaplayer
off<MediaPlayerEventType extends keyof ZegoMediaPlayerListener>Unregister the event handler of mediaplayer
mediaPlayerStateUpdateMediaPlayer playback status callback.
mediaPlayerNetworkEventThe callback triggered when the network status of the media player changes.
mediaPlayerPlayingProgressThe callback to report the current playback progress of the media player.
mediaPlayerRenderingProgressThe callback to report the current rendering progress of the media player.

AudioEffectPlayer Functions

MethodDescription
createAudioEffectPlayerCreates a audio effect player instance.
destroyAudioEffectPlayerDestroys a audio effect player instance.
startStart playing audio effect.
stopStop playing audio effect.
pausePause playing audio effect.
resumeResume playing audio effect.
stopAllStop playing all audio effect.
pauseAllPause playing all audio effect.
resumeAllResume playing all audio effect.
seekToSet the specified playback progress.
setVolumeSet volume for a single audio effect. Both the local play volume and the publish volume are set.
setVolumeAllSet volume for all audio effect. Both the local play volume and the publish volume are set.
getTotalDurationGet the total duration of the specified audio effect resource.
getCurrentProgressGet current playback progress.
loadResourceLoad audio effect resource.
unloadResourceUnload audio effect resource.
getIndexGet audio effect player index.
audioEffectPlayerStateUpdateAudio effect playback state callback.
on<AudioEffectPlayerEventType extends keyof ZegoAudioEffectPlayerListener>Register the event handler of mediaplayer
off<AudioEffectPlayerEventType extends keyof ZegoAudioEffectPlayerListener>Unregister the event handler of mediaplayer

Recording Functions

MethodDescription
startRecordingCapturedDataStarts to record and directly save the data to a file.
stopRecordingCapturedDataStops recording locally captured audio or video.
capturedDataRecordStateUpdateThe callback triggered when the state of data recording (to a file) changes.
capturedDataRecordProgressUpdateThe callback to report the current recording progress.

Device Management Functions

MethodDescription
muteMicrophoneMutes or unmutes the microphone.
isMicrophoneMutedChecks whether the microphone is muted.
muteSpeakerMutes or unmutes the audio output speaker.
isSpeakerMutedChecks whether the audio output speaker is muted.
enableAudioCaptureDeviceEnables or disables the audio capture device.
getAudioRouteTypeget current audio route type.
setAudioRouteToSpeakerWhether to use the built-in speaker to play audio.
enableCameraTurns on/off the camera (for the specified channel).
useFrontCameraSwitches to the front or the rear camera (for the specified channel).
startSoundLevelMonitorStarts sound level monitoring. Support enable some advanced feature.
stopSoundLevelMonitorStops sound level monitoring.
enableHeadphoneMonitorEnables or disables headphone monitoring.
capturedSoundLevelUpdateThe local captured audio sound level callback.
remoteSoundLevelUpdateThe remote playing streams audio sound level callback.
localDeviceExceptionOccurredThe callback triggered when a local device exception occurred.
remoteCameraStateUpdateThe callback triggered when the state of the remote camera changes.
remoteMicStateUpdateThe callback triggered when the state of the remote microphone changes.
audioRouteChangeCallback for device's audio route changed.

Custom Video Capture or Rendering Functions

MethodDescription
enableCustomVideoCaptureEnables or disables custom video capture (for the specified channel).
enableCustomVideoProcessingEnables or disables custom video processing, and support specifying the publish channel.

Custom Audio Capture or Rendering Functions

MethodDescription
enableCustomAudioIOEnables the custom audio I/O function (for the specified channel), support PCM, AAC format data.

Media Publisher Functions

Not supported currently.

Utilities Functions

MethodDescription
startNetworkSpeedTestStart network speed test. Support set speed test interval。
stopNetworkSpeedTestStop network speed test.
getNetworkTimeInfoObtain synchronization network time information.
networkModeChangedNetwork mode changed callback.
networkSpeedTestErrorNetwork speed test error callback.
networkSpeedTestQualityUpdateNetwork speed test quality callback.
networkQualityThe network quality callback of users who are publishing in the room.

RangeAudio Functions

Not supported currently.

CopyrightedMusic Functions

Not supported currently.

Deprecated APIs

MethodDescription
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.

Previous

FAQ