logo
On this page

Function Overview


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

MethodDescription
createEngineCreate ZegoExpressEngine singleton object and initialize SDK.
destroyEngineDestroy the ZegoExpressEngine singleton object and deinitialize the SDK.
getEngineReturns the singleton instance of ZegoExpressEngine.
setEngineConfigSet advanced engine configuration.
setLogConfigSet log configuration.
setLocalProxyConfigSet local proxy config.
setCloudProxyConfigSet cloud proxy config.
setLicenseSet license auth.
setRoomModeSet room mode.
setGeoFenceSet Geo Fence.
getVersionGets the SDK's version number.
setAndroidEnvSets the JVM and Context for the Android platform.
setOhosEnvConfig the Environment for the OpenHarmony platform.
setApiCalledCallbackSet method execution result callback.
isFeatureSupportedQuery whether the current SDK supports the specified feature.
loadLibraryShow loading SDK dynamic library.
unLoadLibraryUnload SDK dynamic library.
setEventHandlerSets up the event notification callbacks that need to be handled. If the eventHandler is set to [null], all the callbacks set previously will be cleared.
setRoomScenarioSet room scenario.
uploadLogUploads logs to the ZEGO server.
uploadLogUploads logs to the ZEGO server, with callback.
submitLogUploads logs to the ZEGO server.
enableDebugAssistantEnable the debug assistant. Note, do not enable this feature in the online version! Use only during development phase!
callExperimentalAPICall the experimental API.
onDebugErrorThe callback for obtaining debugging error information.
onApiCalledResultMethod execution result callback
onEngineStateUpdateThe callback triggered when the audio/video engine state changes.
onRecvExperimentalAPIExperimental API callback
onFatalErrorThe callback that triggered a fatal error, causing the SDK to malfunction and unable to function properly.

room

MethodDescription
loginRoomLogs in to a room. You must log in to a room before publishing or playing streams.
loginRoomLogs in to a room with advanced room configurations. You must log in to a room before publishing or playing streams.
logoutRoomExit the room with callback.
logoutRoomExit the room of the specified room ID with callback.
switchRoomSwitch the room with advanced room configurations.
renewTokenRenew token.
setRoomExtraInfoSet room extra information.
getRoomStreamListGet room stream list.
onRoomStateUpdateNotification of the room connection state changes.
onRoomStateChangedNotification of the room connection state changes, including specific reasons for state change.
onRoomUserUpdateThe callback triggered when the number of other users in the room increases or decreases.
onRoomOnlineUserCountUpdateThe callback triggered every 30 seconds to report the current number of online users.
onRoomStreamUpdateThe callback triggered when the number of streams published by the other users in the same room increases or decreases.
onRoomStreamExtraInfoUpdateThe callback triggered when there is an update on the extra information of the streams published by other users in the same room.
onRoomExtraInfoUpdateThe callback triggered when there is an update on the extra information of the room.
onRoomTokenWillExpireCallback notification that room Token authentication is about to expire.

publisher

MethodDescription
startPublishingStreamStarts publishing a stream (for the specified channel). You can call this function to publish a second stream.
startPublishingStreamStarts publishing a stream. Support multi-room mode.
startPublishingStreamInSceneStarts publishing a stream in RangeScene scene.
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).
startPreviewStarts the local audio preview.
stopPreviewStops the local preview.
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).
setPublishDualStreamConfigSet dual stream config.
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.
setPublishStreamEncryptionKeySet encryption key for the publishing stream for the specified publish channel.
takePublishStreamSnapshotTake a snapshot of the publishing stream for the specified publish channel.
takePublishStreamSnapshotByConfigTake 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.
setStreamAlignmentPropertyEnable or disable the stream precision alignment function.
enableTrafficControlEnables or disables the traffic control for the specified publish channel.
setMinVideoBitrateForTrafficControlSets the minimum video bitrate for traffic control for the specified publish channel.
setMinVideoFpsForTrafficControlSets the minimum video frame rate threshold for traffic control.
setMinVideoResolutionForTrafficControlSets the minimum video resolution threshold for traffic control.
setTrafficControlFocusOnSet the factors of concern that trigger traffic control for the specified publish channel.
setCaptureVolumeSets the audio recording volume for stream publishing.
getCaptureVolumeGets the audio recording volume for stream publishing.
setAudioCaptureStereoModeSet audio capture stereo mode.
addPublishCdnUrlAdds a target CDN URL to which the stream will be relayed from ZEGO RTC server.
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.
setPublishWatermarkSets up the stream watermark before stream publishing (for the specified channel).
setSEIConfigSet the Supplemental Enhancement Information type.
sendSEISends Supplemental Enhancement Information to the specified publish channel.
sendSEISyncWithCustomVideoSend the media supplementary enhancement information synchronized with the current video frame during custom video capture.
sendAudioSideInfoSend audio side information.
enableHardwareEncoderEnables or disables hardware encoding.
setCapturePipelineScaleModeSets 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.
setDummyCaptureImagePathSet the path of the static picture would be published when the camera is closed.
setDummyCaptureImageParamsSet the params of the static picture would be published when the camera is closed.
enableH265EncodeFallbackWhether to enable H.265 encoding to automatically downgrade to H.264 encoding.
isVideoEncoderSupportedWhether the specified video encoding type is supported.
isVideoEncoderSupportedWhether the specified video encoding type and implementation are supported.
getVideoEncoderSupportedWhether the specified video encoding type and implementation are supported.
setAppOrientationModeSet the orientation mode of the video.
setLowlightEnhancementSet low light enhancement.
setLowlightEnhancementParamsSet low light enhancement params.
setVideoSourceSet video capture source.
setVideoSourceSet a video capture instance as the video capture source.
setVideoSourceSet video capture source for the specified channel.
setVideoSourceSet a video capture instance as video capture source for the specified channel.
setAudioSourceSet audio capture source.
setAudioSourceSet audio capture source for the specified channel.
setAudioSourceSet audio capture source with audio mix config.
enableVideoObjectSegmentationEnable video object segmentation.
enableVideoObjectSegmentationEnable video object segmentation.
enableAlphaChannelVideoEncoderEnable video encoder alpha channel support.
enableVideoEncoderEnhancementEnable video encoder enhancement.
enableAuxBgmBalanceTurn on or off the adaptive mode to adjust the volume of the human voice according to the volume of the BGM.
onPublisherStateUpdateThe callback triggered when the state of stream publishing changes.
onPublisherQualityUpdateCallback for current stream publishing quality.
onPublisherCapturedAudioFirstFrameThe callback triggered when the first audio frame is captured.
onPublisherCapturedVideoFirstFrameThe callback triggered when the first video frame is captured.
onPublisherSendAudioFirstFrameThe callback triggered when the first audio frame is sent.
onPublisherSendVideoFirstFrameThe callback triggered when the first video frame is sent.
onPublisherRenderVideoFirstFrameThe callback triggered when the first video frame is rendered.
onPublisherVideoSizeChangedThe callback triggered when the video capture resolution changes.
onPublisherRelayCDNStateUpdateThe callback triggered when the state of relayed streaming to CDN changes.
onPublisherVideoEncoderChangedThe callback triggered when the video encoder changes in publishing stream.
onPublisherStreamEventThe callback triggered when publishing stream.
onVideoObjectSegmentationStateChangedThe video object segmentation state changed.
onPublisherLowFpsWarningVideo encoding low frame rate warning.
onPublisherDummyCaptureImagePathErrorThe notification for setting the path of the static image displayed when the camera is turned off is incorrect.

player

MethodDescription
startPlayingStreamStarts playing a stream from ZEGO RTC server.
startPlayingStreamStarts playing a stream from ZEGO RTC server or from third-party CDN. Support multi-room mode.
startPlayingStreamStarts playing a stream from ZEGO RTC server, without Canvas, it is more suitable for pure audio stream.
startPlayingStreamStarts playing a stream from ZEGO RTC server or from third-party CDN, without Canvas, it is more suitable for pure audio stream.
startPlayingStreamInSceneStarts playing a stream from ZEGO RTC server or from third-party CDN when using RangeScene.
startPlayingStreamInSceneStarts playing a stream from ZEGO RTC server or from third-party CDN when using RangeScene, without Canvas, it is more suitable for pure audio stream.
switchPlayingStreamSwitch from playing a certain stream to playing another stream.
stopPlayingStreamStops playing a stream.
setPlayStreamDecryptionKeySet decryption key for the playing stream.
setPlayStreamCrossAppInfoSet up cross App playing stream information.
takePlayStreamSnapshotTake a snapshot of the playing stream.
setPlayVolumeSets the stream playback volume.
setAllPlayStreamVolumeSets the all stream playback volume.
setPlayStreamVideoTypeSet play video stream type.
setPlayStreamBufferIntervalRangeSet the adaptive adjustment interval range of the buffer for playing stream.
setAudioMixModeSet the playing stream ID to highlight when multiple streams are mixed. Streams in the stream list will be highlighted when multiple streams sound at the same time.
setPlayStreamFocusOnSet the weight of the pull stream priority.
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)
muteAllPlayAudioStreamsCan the pull stream receive all audio data.
muteAllPlayStreamVideoCan the pull stream receive all video data. (When set to true, calling [mutePlayStreamVideo] will not take effect)
muteAllPlayVideoStreamsCan the pull stream receive all video data.
setPlayStreamDecodeFrameModeset play stream decode mode.
enableHardwareDecoderEnables or disables hardware decoding.
enableCheckPocEnables or disables frame order detection.
isVideoDecoderSupportedWhether the specified video decoding format is supported.
isVideoDecoderSupportedWhether the specified video decoding format is supported.
getVideoDecoderSupportedWhether the specified video decoding type and implementation are supported.
setPlayStreamsAlignmentPropertySet the play stream alignment properties.
enableVideoSuperResolutionEnable video super resolution.
initVideoSuperResolutionInit video super resolution.
uninitVideoSuperResolutionUninit video super resolution.
updatePlayingCanvasUpdate playing canvas.
onPlayerStateUpdateThe callback triggered when the state of stream playing changes.
onPlayerSwitchedSwitch playing stream callback.
onPlayerQualityUpdateCallback for current stream playing quality.
onPlayerMediaEventThe callback triggered when a media event occurs during streaming playing.
onPlayerRecvAudioFirstFrameThe callback triggered when the first audio frame is received.
onPlayerSyncRecvAudioFirstFrameThe callback triggered when the first audio frame is received. Please do not call the SDK interface in the callback thread.
onPlayerRecvVideoFirstFrameThe callback triggered when the first video frame is received.
onPlayerSyncRecvVideoFirstFrameThe callback triggered when the first video frame is received. Please do not call the SDK interface in the callback thread.
onPlayerRenderVideoFirstFrameThe callback triggered when the first video frame is rendered.
onPlayerSyncRecvRenderVideoFirstFrameThe callback triggered when the first video frame is rendered. Please do not call the SDK interface in the callback thread.
onPlayerRenderCameraVideoFirstFrameCalls back when the stream playing end renders the first frame of the video from the remote camera.
onPlayerVideoSizeChangedThe callback triggered when the stream playback resolution changes.
onPlayerRecvSEIThe callback triggered when Supplemental Enhancement Information is received.
onPlayerSyncRecvSEIThe callback triggered when Supplemental Enhancement Information is received synchronously.
onPlayerRecvMediaSideInfoThe callback triggered when Supplemental Enhancement Information is received synchronously.
onPlayerRecvAudioSideInfoReceive the audio side information content of the remote stream.
onPlayerLowFpsWarningPlaying stream low frame rate warning.
onPlayerStreamEventThe callback triggered when playing stream.
onPlayerVideoSuperResolutionUpdatePlaying stream video super resolution enabled state changes.

IM

MethodDescription
createRealTimeSequentialDataManagerCreate the real time sequential data manager instance
destroyRealTimeSequentialDataManagerDestroy the real time sequential data manager instance
setEventHandlerSets up the real-time sequential data event handler.
startBroadcastingStart broadcasting real-time sequential data stream.
stopBroadcastingStop broadcasting real-time sequential data stream.
sendRealTimeSequentialDataSend real-time sequential data to the broadcasting stream ID.
startSubscribingStart subscribing real-time sequential data stream.
stopSubscribingStop subscribing real-time sequential data stream.
getIndexGet real-time sequential data manager index.
onReceiveRealTimeSequentialDataCallback for receiving real-time sequential data.
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.
sendTransparentMessageSends a transparent message in room.
onRecvRoomTransparentMessageThe callback triggered when Barrage Messages are received.
onIMRecvBroadcastMessageThe callback triggered when Broadcast Messages are received.
onIMRecvBarrageMessageThe callback triggered when Barrage Messages are received.
onIMRecvCustomCommandThe callback triggered when a Custom Command is received.

mixer

MethodDescription
startMixerTaskStarts a stream mixing task.
stopMixerTaskStops a stream mixing task.
startAutoMixerTaskStarts an auto stream mixing task.
stopAutoMixerTaskStops an auto stream mixing task.
onMixerRelayCDNStateUpdateThe callback triggered when the state of relayed streaming of the mixed stream to CDN changes.
onMixerSoundLevelUpdateThe callback triggered when the sound level of any input stream changes in the stream mixing process.
onAutoMixerSoundLevelUpdateThe callback triggered when the sound level of any input stream changes in the auto stream mixing process.

preprocess

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).
enableTransientANSEnables or disables transient noise suppression.
setANSModeSets the automatic noise suppression (ANS) mode.
enableSpeechEnhanceEnables or disables speech enhancement.
enableAudioMixingEnables or disables audio mixing function.
setAudioMixingHandlerSets up the audio mixing event handler.
muteLocalAudioMixingMute or resume local playback of the mixing audio.
setAudioMixingVolumeSets the audio mixing output volume for either local playback or the stream to published.
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.
enableVirtualStereoEnable or disable the virtual stereo effect when publishing stream.
enablePlayStreamVirtualStereoEnable or disable the virtual stereo effect when playing stream.
setElectronicEffectsTurn on or off the electronic sound effect.
enableColorEnhancementEnable color enhancement.
onAudioMixingCopyDataAudio mixing callback.

mediaPlayer

MethodDescription
createMediaPlayerCreates a media player instance.
destroyMediaPlayerDestroys a media player instance.
setEventHandlerSet event notification callback handler of the media player.
setVideoHandlerSet video data callback handler of the media player.
setAudioHandlerSet audio data callback handler of the media player.
setBlockDataHandlerSet the media resource block data callback handler of the media player.
loadResourceLoad local or network media resource.
loadResourceWithPositionLoad local or network media resource and specify the start position.
loadResourceFromMediaDataLoad binary audio resource.
loadCopyrightedMusicResourceWithPositionLoad copyrighted music 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.
setPlayLoopCountSet the count of play loops.
setPlaySpeedSet the speed of play.
enableAuxWhether to mix the player's sound into the stream being published.
muteLocalWhether to play locally silently.
setPlayerCanvasSet 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.
setAudioTrackModeSet the audio track mode of the player.
setAudioTrackPublishIndexSet the audio track for the media file to be publish.
enableVoiceChangerEnable voice changer, set up the specific voice changer parameters.
getCurrentStateGet the current playback status.
getIndexGet media player index.
takeSnapshotTake a screenshot of the current playing screen of the media player.
enableAccurateSeekEnable accurate seek and set relevant attributes.
setNetWorkResourceMaxCacheSet the maximum cache duration and cache data size of web materials.
getNetWorkResourceCacheGet the playable duration and size of the cached data of the current network material cache queue
setNetWorkBufferThresholdUse this interface to set the cache threshold that the media player needs to resume playback. The SDK default value is 5000ms,The valid value is greater than or equal to 1000ms
enableSoundLevelMonitorWhether to enable sound level monitoring.
enableFrequencySpectrumMonitorWhether to enable frequency spectrum monitoring.
setActiveAudioChannelSet the playback channel.
clearViewClears the last frame of the playback control that remains on the control after playback ends.
getMediaInfoGet meida information such as video resolution from media file.
updatePositionUpdate the position of the media player (audio source).
setHttpHeaderSet http headers.
setPlayMediaStreamTypeSet play media stream type.
enableLiveAudioEffectEnable live audio effect.
enableLocalCacheEnable local caching of http/https network resources.
enableViewMirrorEnable the view mirror.
getPlaybackStatisticsGet playback statistics.
onMediaPlayerStateUpdateMediaPlayer playback status callback.
onMediaPlayerNetworkEventThe callback triggered when the network status of the media player changes.
onMediaPlayerPlayingProgressThe callback to report the current playback progress of the media player.
onMediaPlayerRenderingProgressThe callback to report the current rendering progress of the media player.
onMediaPlayerVideoSizeChangedThe callback triggered when when the resolution of the playback video changes.
onMediaPlayerRecvSEIThe callback triggered when the media player got media side info.
onMediaPlayerSoundLevelUpdateThe callback of sound level update.
onMediaPlayerFrequencySpectrumUpdateThe callback of frequency spectrum update.
onMediaPlayerFirstFrameEventThe callback triggered when the media player plays the first frame.
onMediaPlayerLocalCacheThe callback triggered when the media player caches http/https network resource locally.
onVideoFrameThe callback triggered when the media player throws out video frame data.
onVideoFrameThe callback triggered when the media player throws out video frame data, with additional information for the video frame.
onAudioFrameThe callback triggered when the media player throws out audio frame data.
onBlockBeginThe callback triggered when the media player is about to throw the block data of the media resource.
onBlockDataThe callback triggered when the media player throws the block data of the media resource.

audioEffectPlayer

MethodDescription
createAudioEffectPlayerCreates a audio effect player instance.
destroyAudioEffectPlayerDestroys a audio effect player instance.
setEventHandlerSet audio effect player event handler.
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.
setPlayVolumeSet local play volume for a single audio effect.
setPublishVolumeSet publish volume for a single audio effect.
setVolumeAllSet volume for all audio effect. Both the local play volume and the publish volume are set.
setPlayVolumeAllSet local play volume for all audio effect.
setPublishVolumeAllSet publish volume for all audio effect.
setPlaySpeedSet the playback speed for a given audio effect. Both the local play speed and the publish speed are set. (separate settings are not supported).
getTotalDurationGet the total duration of the specified audio effect resource.
getCurrentProgressGet current playback progress.
loadResourceLoad audio effect resource.
unloadResourceUnload audio effect resource.
updatePositionUpdate the position of the audio effect player (audio source).
getIndexGet audio effect player index.
onAudioEffectPlayStateUpdateAudio effect playback state callback.

record

MethodDescription
startRecordingCapturedDataStarts to record and directly save the data to a file.
stopRecordingCapturedDataStops recording locally captured audio or video.
startRecordingRemoteDataStarts to record and directly save the data to a file.
stopRecordingRemoteDataStops recording locally captured audio or video.
setDataRecordEventHandlerSets up the event callback handler for data recording.
onCapturedDataRecordStateUpdateThe callback triggered when the state of data recording (to a file) changes.
onCapturedDataRecordProgressUpdateThe callback to report the current recording progress.
onRemoteDataRecordStateUpdateThe callback triggered when the state of data recording (to a file) changes.
onRemoteDataRecordProgressUpdateThe callback to report the current recording progress.

device

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.
getAudioDeviceListGets a list of audio devices.
getDefaultAudioDeviceIDGet the device ID of the default audio device.
useAudioDeviceChooses to use the specified audio device.
getAudioDeviceVolumeGet volume for the specified audio device.
setAudioDeviceVolumeSet volume for the specified audio device.
setSpeakerVolumeInAPPSet the volume of the speaker in the App.
getSpeakerVolumeInAPPGet the volume of the speaker in the App, only support Windows.
startAudioDeviceVolumeMonitorTurn on audio device volume monitoring.
stopAudioDeviceVolumeMonitorTurn off audio device volume monitoring. Only for Windows/macOS.
muteAudioDeviceMutes or unmutes the audio device.
setAudioDeviceModeSet the audio device mode.
isAudioDeviceMutedCheck if the audio device is muted.
enableAudioCaptureDeviceEnables or disables the audio capture device.
enableAudioCaptureDeviceAsyncAsynchronous enables 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).
isCameraFocusSupportedWhether the camera supports focusing.
setCameraFocusModeSet the camera focus mode.
setCameraFocusPointInPreviewSet the focus point in the preview view.
setCameraExposureModeSet the camera exposure mode.
setCameraExposurePointInPreviewSet the exposure point in the preview view.
setCameraExposureCompensationSet the camera exposure compensation value and support spedifying the publish channel.
setCameraZoomFactorSet the zoom factor of the camera and support specifying the publish channel. Every time the camera is restarted, the camera zoom factor will return to the initial value (1.0).
getCameraMaxZoomFactorGet the maximum zoom factor of the camera and support specifying the publish channel.
enableCameraAdaptiveFPSEnable camera adaptive frame rate.
useVideoDeviceChooses to use the specified video device (for the specified channel).
getVideoDeviceListGets a list of video devices.
getDefaultVideoDeviceIDGet the device ID of the default video device.
startSoundLevelMonitorStarts sound level monitoring. Support setting the listening interval.
startSoundLevelMonitorStarts sound level monitoring. Support enable some advanced feature.
stopSoundLevelMonitorStops sound level monitoring.
startAudioSpectrumMonitorStarts audio spectrum monitoring. Support setting the listening interval.
stopAudioSpectrumMonitorStops audio spectrum monitoring.
enableHeadphoneMonitorEnables or disables headphone monitoring.
setHeadphoneMonitorVolumeSets the headphone monitor volume.
enableMixSystemPlayoutEnable or disable system audio capture.
setMixSystemPlayoutVolumeset system audio capture volume.
enableMixEnginePlayoutEnable or disable mix SDK playout to stream publishing.
startAudioVADStableStateMonitorStart audio VAD stable state monitoring.
startAudioVADStableStateMonitorStart audio VAD stable state monitoring, and the monitoring period can be set.
stopAudioVADStableStateMonitorStop audio VAD stable state monitoring.
onAudioDeviceStateChangedThe callback triggered when there is a change to audio devices (i.e. new device added or existing device deleted).
onAudioDeviceVolumeChangedThe callback triggered when there is a change of the volume for the audio devices.
onVideoDeviceStateChangedThe callback triggered when there is a change to video devices (i.e. new device added or existing device deleted).
onCapturedSoundLevelUpdateThe local captured audio sound level callback.
onCapturedSoundLevelInfoUpdateThe local captured audio sound level callback, supported vad.
onRemoteSoundLevelUpdateThe remote playing streams audio sound level callback.
onRemoteSoundLevelInfoUpdateThe remote playing streams audio sound level callback, supported vad.
onCapturedAudioSpectrumUpdateThe local captured audio spectrum callback.
onRemoteAudioSpectrumUpdateThe remote playing streams audio spectrum callback.
onLocalDeviceExceptionOccurredThe callback triggered when a local device exception occurred.
onRemoteCameraStateUpdateThe callback triggered when the state of the remote camera changes.
onRemoteMicStateUpdateThe callback triggered when the state of the remote microphone changes.
onRemoteSpeakerStateUpdateThe callback triggered when the state of the remote speaker changes.
onAudioRouteChangeCallback for device's audio route changed.
onAudioVADStateUpdateCallback for audio VAD stable state update.
getCurrentAudioDeviceGet the audio device information currently in use.

customVideoIO

MethodDescription
enableCustomVideoRenderEnables or disables custom video rendering.
setCustomVideoRenderHandlerSets up the event callback handler for custom video rendering.
enableCapturedVideoCustomVideoRenderEnables or disables captured video to custom video rendering.
enableRemoteVideoCustomVideoRenderEnables or disables remote playback video to custom video rendering.
enableCustomVideoCaptureEnables or disables custom video capture (for the specified channel).
setCustomVideoCaptureHandlerSets the event callback handler for custom video capture.
sendCustomVideoCaptureRawDataSends the video frames (Raw Data) produced by custom video capture to the SDK (for the specified channel).
sendCustomVideoCaptureD3DTextureDataSend custom captured video frame D3D Texture data to the SDK (for the specified channel).
sendCustomVideoCaptureEncodedDataSends the video frames (Encoded Data) produced by custom video capture to the SDK (for the specified channel).
setCustomVideoCaptureFillModeSets the video fill mode of custom video capture (for the specified channel).
setCustomVideoCaptureDeviceStateSets device state of custom video capture (for the specified channel).
setCustomVideoCaptureRegionOfInterestSet the region of interest (ROI) for encoder of custom video capture (for the specified channel).
onStartCustomize the notification of the start of video capture.
onStopCustomize the notification of the end of the collection.
onEncodedDataTrafficControlWhen network changes are detected during custom video capture, the developer is notified that traffic control is required, and the encoding configuration is adjusted according to the recommended parameters of the SDK.
onCapturedVideoFrameRawDataWhen custom video rendering is enabled, the original video frame data collected by the local preview is called back.
onRemoteVideoFrameRawDataWhen custom video rendering is enabled, the remote end pulls the original video frame data to call back, and distinguishes different streams by streamID.
onRemoteVideoFrameEncodedDataCustom video rendering remote playing stream video frame undecoded data callback.
enableCustomVideoProcessingEnables or disables custom video processing, and support specifying the publish channel.
setCustomVideoProcessHandlerSets up the event callback handler for custom video processing.
sendCustomVideoProcessedRawDataSend the original video data after the pre-processing of the custom video to the SDK, and support other channels to push the stream.
sendCustomVideoProcessedRawDataSend the original video data after the pre-processing of the custom video to the SDK, support other channels to push the stream, and support specified data usage.
sendCustomVideoProcessedCVPixelBufferSend the [CVPixelBuffer] type video data after the custom video processing to the SDK (for the specified channel).
sendCustomVideoProcessedCVPixelBufferSend the [CVPixelBuffer] type video data after the custom video processing to the SDK (for the specified channel), and support specified data usage.
onCapturedUnprocessedRawDataCall back when the original video data is obtained.
onCapturedUnprocessedCVPixelBufferCall back when the original video data of type [CVPixelBuffer] is obtained.

customAudioIO

MethodDescription
enableCustomAudioCaptureProcessingEnable local collection and custom audio processing(before ear return).
enableCustomAudioCaptureProcessingAfterHeadphoneMonitorTurn on local collection and custom audio processing (after ear return).
enableBeforeAudioPrepAudioDataEnable the feature of throwing audio data before SDK internal audio preprocessing.
enableCustomAudioRemoteProcessingEnable custom audio processing for remote playing stream.
enableCustomAudioPlaybackProcessingEnable custom audio processing for SDK playback audio data.
setCustomAudioProcessHandlerSet up callback handler for custom audio processing.
startAudioDataObserverEnable audio data observering.
stopAudioDataObserverDisable audio data observering.
setAudioDataHandlerSets up the event callback handler for receiving audio data.
enableCustomAudioIOEnables the custom audio I/O function (for the specified channel), support PCM, AAC format data.
sendCustomAudioCaptureAACDataSends AAC audio data produced by custom audio capture to the SDK (for the specified channel).
sendCustomAudioCapturePCMDataSends PCM audio data produced by custom audio capture to the SDK (for the specified channel).
fetchCustomAudioRenderPCMDataFetches PCM audio data of the remote stream from the SDK for custom audio rendering.
sendReferenceAudioPCMDataSend the PCM audio data customized by the developer to the SDK, which is used as a reference for custom rendering audio to eliminate echo.
onProcessCapturedAudioDataCustom audio processing local captured PCM audio frame callback.
onProcessCapturedAudioDataAfterUsedHeadphoneMonitorCustom audio processing local captured PCM audio frame callback after used headphone monitor.
onBeforeAudioPrepAudioDataAudio data callback before SDK internal audio preprocessing.
onProcessRemoteAudioDataCustom audio processing remote playing stream PCM audio frame callback.
onProcessPlaybackAudioDataCustom audio processing SDK playback PCM audio frame callback.
onCapturedAudioDataThe callback for obtaining the audio data captured by the local microphone.
onPlaybackAudioDataThe callback for obtaining the audio data of all the streams playback by SDK.
onMixedAudioDataCallback 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.
onPlayerAudioDataThe callback for obtaining the audio data of each stream.

mediaDataPublisher

MethodDescription
createMediaDataPublisherCreates a media data publisher instance.
createMediaDataPublisherCreates a media data publisher instance.
destroyMediaDataPublisherDestroys a media data publisher instance.
setEventHandlerSet event callback handler for the media data publisher.
addMediaFilePathAdd media file to the publish queue. Currently, only mp4 / m4a / aac files are supported, and special conversion is required.
resetClear all the status in this media data publisher, so that it can be restarted next time.
setVideoSendDelayTimeSet the delay time of video playback.
seekToSpecify the starting point of the current video file publishing.
getTotalDurationGet the total duration of the current file.
getCurrentDurationGet the playing progress of the current file.
getIndexGet the channel index of the media data publisher.
onMediaDataPublisherFileOpenThe event callback of the media data publisher opening a media file.
onMediaDataPublisherFileCloseThe event callback of the media data publisher closing a media file.
onMediaDataPublisherFileDataBeginThe event callback that the media data publisher has read data from the media file.
onMediaDataPublisherFileDataEndThe event callback that the media data publisher has completed a file stream publishing.

utilities

MethodDescription
startPerformanceMonitorStart system performance monitoring.
stopPerformanceMonitorStop system performance monitoring.
startNetworkProbeStart network probe.
stopNetworkProbeStop network probe.
testNetworkConnectivityTest network connectivity.
startNetworkSpeedTestStart network speed test. Support set speed test interval。
stopNetworkSpeedTestStop network speed test.
getNetworkTimeInfoObtain synchronization network time information.
startDumpDataDump audio, video data.
stopDumpDataStop dumping data.
uploadDumpDataUpload dumped data to the ZEGO server.
removeDumpDataRemove dumped data.
onPerformanceStatusUpdateSystem performance monitoring callback.
onNetworkModeChangedNetwork mode changed callback.
onNetworkSpeedTestErrorNetwork speed test error callback.
onNetworkSpeedTestQualityUpdateNetwork speed test quality callback.
onNetworkQualityThe network quality callback of users who are publishing in the room.
onRtcStatsRTC network statistics callback.
onNetworkTimeSynchronizedSuccessful callback of network time synchronization.
onRequestDumpDataRequest to dump data.
onRequestUploadDumpDataRequest to dump data.
onStartDumpDataCallback when starting to dump data.
onStopDumpDataCallback when stopping to dump data.
onUploadDumpDataCallback after uploading the dump data.

rangeAudio

MethodDescription
createRangeAudioCreates a range audio instance.
destroyRangeAudioDestroys a range audio instance.
setEventHandlerset range audio event handler.
setAudioReceiveRangeSet the maximum range of received audio.
setAudioReceiveRangeSet the configuration of the audio receiving range.
setPositionUpdateFrequencySet the frequency of real-time update locations within the SDK.
setRangeAudioVolumeSet range voice volume.
setStreamVocalRangeSet the sound range for the stream.
setStreamVocalRangeSet the sound range for the stream.
updateStreamPositionUpdate the location of the flow.
updateSelfPositionUpdate self position and orentation.
updateAudioSourceAdd or update audio source position information.
enableSpatializerTurn the 3D spatial sound on or off.
enableMicrophoneTurn the microphone on or off.
enableSpeakerTurn the speaker on or off.
setRangeAudioModeSet range audio mode.
setRangeAudioCustomModeSet range audio custom mode.
setTeamIDSet team ID.
muteUserWhether can receive the audio data of the specified user.
onRangeAudioMicrophoneStateUpdateRange audio microphone state callback.

CopyrightedMusic

MethodDescription
createCopyrightedMusicCreates a copyrighted music instance.
destroyCopyrightedMusicDestroys a copyrighted music instance.
setEventHandlerset copyrighted music event handler.
initCopyrightedMusicInitialize the copyrighted music module.
getCacheSizeGet cache size.
clearCacheClear cache.
sendExtendedRequestSend extended feature request.
getLrcLyricGet lyrics in lrc format.
getLrcLyricGet lyrics in lrc format.
getKrcLyricByTokenGet lyrics in krc format.
requestResourceRequest music resource.
requestResourceRequest music resource.
getSharedResourceGet shared music resource.
getSharedResourceGet shared music resource.
downloadDownload music resource.
cancelDownloadCancel download of music resource.
queryCacheQuery the resource's cache is existed or not.
queryCacheQuery the resource's cache is existed or not.
getDurationGet the playing time of a song or accompaniment file.
setScoringLevelSet the difficulty level of scoring.
startScoreStart scoring.
pauseScorePause scoring.
resumeScoreResume scoring.
stopScoreStop scoring.
resetScoreReset scoring.
getPreviousScoreGet the score of the previous sentence.
getAverageScoreGet average score.
getTotalScoreGet total score .
getFullScoreGet full score .
getStandardPitchGet standard pitch data.
getCurrentPitchGet real-time pitch data.
onDownloadProgressUpdateCallback for download song or accompaniment progress rate.
onCurrentPitchValueUpdateReal-time pitch line callback.

deprecated_api

MethodDescription
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.
requestAccompanimentClip[Deprecated] Request accompaniment clip. 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.
queryCache[Deprecated] Query the resource's cache is existed or not. Deprecated since 3.2.1, please use the method with the same name with [vendorID] parameter instead.
queryCache[Deprecated] Query the resource's cache is existed or not. Deprecated since 3.9.0, please use the method with the same name with [config] parameter instead.
setVoiceChangerParam[Deprecated] Setting up the specific voice changer parameters.
enableAudioCapture[Deprecated] Whether to collect the sound of the window process during window collection

Previous

FAQ

Next

Class

On this page

Back to top