ZEGO::EXPRESS::IZegoExpressEngine
Declared in
ZegoExpressInterface.h
Includes
Public-Func Lists
Public-Func Docs
setEventHandler
public void setEventHandler
(std::shared_ptr<
IZegoEventHandler >
eventHandler)
Set event notification callback, set [nullptr] to clears the set callback.
Parameters | |
---|---|
eventHandler | Event notification callback. Developers should override callback related methods to focus on specific notifications based on their own business scenarios. The main callback methods of SDK are in [IZegoEventHandler]. |
uploadLog
public void uploadLog
()
Upload logs to ZEGO server.
setDebugVerbose
public void setDebugVerbose
(bool
enable, ZegoLanguage language)
Set debug details switch and language.
Parameters | |
---|---|
enable | Detailed debugging information switch |
language | Debugging information language |
loginRoom
public void loginRoom
(const std::string &
roomID, ZegoUser user)
Login room.
loginRoom
public void loginRoom
(const std::string &
roomID, ZegoUser user, ZegoRoomConfig config)
Login room.
logoutRoom
public void logoutRoom
(const std::string &
roomID)
Logout room.
Parameters | |
---|---|
roomID | Room ID, a string of up to 128 bytes in length. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', '' |
startPublishingStream
public void startPublishingStream
(const std::string &
streamID)
Start publishing stream.
Parameters | |
---|---|
streamID | Stream ID, a string of up to 256 characters, needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', ''. |
startPublishingStream
public void startPublishingStream
(const std::string &
streamID, ZegoPublishChannel channel)
Start publishing stream, you can call this api to publish the another stream.
Parameters | |
---|---|
streamID | Stream ID, a string of up to 256 characters, needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', ''. |
channel | Publish stream channel |
stopPublishingStream
public void stopPublishingStream
()
Stop publishing stream.
stopPublishingStream
public void stopPublishingStream
(ZegoPublishChannel channel)
Stop publishing stream of the specified channel.
Parameters | |
---|---|
channel | Publish stream channel |
setStreamExtraInfo
public void setStreamExtraInfo
(const std::string &
extraInfo, ZegoPublisherSetStreamExtraInfoCallback callback)
Set stream extra information.
Parameters | |
---|---|
extraInfo | Stream extra information, a string of up to 1024 characters. |
callback | Set stream extra information execution result notification |
setStreamExtraInfo
public void setStreamExtraInfo
(const std::string &
extraInfo, ZegoPublishChannel channel, ZegoPublisherSetStreamExtraInfoCallback callback)
Set stream additional information.
startPreview
public void startPreview
( *
ZegoCanvas canvas)
Start/Update local preview.
Parameters | |
---|---|
canvas | The view used to display the preview image. If the view is set to nullptr, no preview will be made. |
startPreview
public void startPreview
( *
ZegoCanvas canvas, ZegoPublishChannel channel)
Start/Update local preview.
stopPreview
public void stopPreview
()
Stop local preview.
stopPreview
public void stopPreview
(ZegoPublishChannel channel)
Stop local preview.
Parameters | |
---|---|
channel | Publish stream channel |
setVideoConfig
public void setVideoConfig
(ZegoVideoConfig config)
Set up video configuration.
Parameters | |
---|---|
config | Video configuration, the SDK provides a common setting combination of resolution, frame rate and bit rate, they also can be customized. |
setVideoConfig
public void setVideoConfig
(ZegoVideoConfig config, ZegoPublishChannel channel)
Set up video configuration.
setVideoMirrorMode
public void setVideoMirrorMode
(ZegoVideoMirrorMode mirrorMode)
Set mirror mode.
Parameters | |
---|---|
mirrorMode | Mirror mode for previewing or publishing the stream |
setVideoMirrorMode
public void setVideoMirrorMode
(ZegoVideoMirrorMode mirrorMode, ZegoPublishChannel channel)
Set mirror mode.
setAppOrientation
public void setAppOrientation
(ZegoOrientation orientation)
Set the orientation of video.
Parameters | |
---|---|
orientation | Video orientation |
setAudioConfig
public void setAudioConfig
(ZegoAudioConfig config)
set audio config
Parameters | |
---|---|
config | Audio config |
mutePublishStreamAudio
public void mutePublishStreamAudio
(bool
mute)
Stop or resume sending a audio stream.
Parameters | |
---|---|
mute | Whether to stop sending audio streams, true means that only the video stream is sent without sending the audio stream, and false means that the audio and video streams are sent simultaneously. The default is false. |
mutePublishStreamAudio
public void mutePublishStreamAudio
(bool
mute, ZegoPublishChannel channel)
Stop or resume sending a audio stream.
mutePublishStreamVideo
public void mutePublishStreamVideo
(bool
mute)
Stop or resume sending a video stream.
Parameters | |
---|---|
mute | Whether to stop sending video streams, true means that only the audio stream is sent without sending the video stream, and false means that the audio and video streams are sent at the same time. The default is false. |
mutePublishStreamVideo
public void mutePublishStreamVideo
(bool
mute, ZegoPublishChannel channel)
Stop or resume sending a video stream.
enableTrafficControl
public void enableTrafficControl
(bool
enable, int
property)
Enable or disable traffic control.
Parameters | |
---|---|
enable | Whether to enable traffic control. The default is ture. |
property | Adjustable property of traffic control, bitmask format. Should be one or the combinations of [ZegoTrafficControlProperty] enumeration. [AdaptiveFPS] as default. |
setMinVideoBitrateForTrafficControl
public void setMinVideoBitrateForTrafficControl
(int
bitrate, ZegoTrafficControlMinVideoBitrateMode mode)
Set the minimum video bitrate for traffic control.
Parameters | |
---|---|
bitrate | Minimum video bitrate (kbps) |
mode | Video sending mode below the minimum bitrate. |
setCaptureVolume
public void setCaptureVolume
(int
volume)
Set the captured volume for publishing stream.
Parameters | |
---|---|
volume | Volume percentage. The range is 0 to 100. Default value is 100. |
addPublishCdnUrl
public void addPublishCdnUrl
(const std::string &
streamID, const std::string &
targetURL, ZegoPublisherUpdateCdnUrlCallback callback)
Add URL to relay to CDN.
Parameters | |
---|---|
streamID | Stream ID |
targetURL | CDN relay address, supported address format rtmp. |
callback | The execution result notification of the relay CDN operation, and proceed to the next step according to the execution result. |
removePublishCdnUrl
public void removePublishCdnUrl
(const std::string &
streamID, const std::string &
targetURL, ZegoPublisherUpdateCdnUrlCallback callback)
Delete the URL relayed to the CDN.
Parameters | |
---|---|
streamID | Stream ID |
targetURL | CDN relay address, supported address format rtmp, flv, hls |
callback | Remove CDN relay result notifications |
enablePublishDirectToCDN
public void enablePublishDirectToCDN
(bool
enable, *
ZegoCDNConfig config)
Whether to publish stream directly to CDN without passing through Zego real-time video cloud server.
Parameters | |
---|---|
enable | Whether to enable direct publish CDN, true: enable direct publish CDN, false: disable direct publish CDN |
config | CDN configuration, if nullptr, use Zego's background default configuration |
enablePublishDirectToCDN
public void enablePublishDirectToCDN
(bool
enable, *
ZegoCDNConfig config, ZegoPublishChannel channel)
Whether to publish stream directly to CDN without passing through Zego real-time video cloud server.
setPublishWatermark
public void setPublishWatermark
( *
ZegoWatermark watermark, bool
isPreviewVisible)
Set publish watermark.
Parameters | |
---|---|
watermark | The upper left corner of the watermark layout is the origin of the coordinate system, and the area cannot exceed the size set by the encoding resolution. If it is nullptr, the watermark is cancelled. |
isPreviewVisible | the watermark is visible on local preview |
setPublishWatermark
public void setPublishWatermark
( *
ZegoWatermark watermark, bool
isPreviewVisible, ZegoPublishChannel channel)
Set publish watermark.
sendSEI
public void sendSEI
(const unsigned char *
data, unsigned int
dataLength)
Send SEI.
Parameters | |
---|---|
data | SEI data |
dataLength | SEI data length |
sendSEI
public void sendSEI
(const unsigned char *
data, unsigned int
dataLength, ZegoPublishChannel channel)
Send SEI.
enableHardwareEncoder
public void enableHardwareEncoder
(bool
enable)
On/off hardware encoding.
Parameters | |
---|---|
enable | Whether to enable hardware encoding, true: enable hardware encoding, false: disable hardware encoding |
setCapturePipelineScaleMode
public void setCapturePipelineScaleMode
(ZegoCapturePipelineScaleMode mode)
set capture pipeline scale mode.
startPlayingStream
public void startPlayingStream
(const std::string &
streamID, *
ZegoCanvas canvas)
Start playing stream.
Parameters | |
---|---|
streamID | Stream ID, a string of up to 256 characters. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', ''. |
canvas | The view used to display the play audio and video stream's image. If the view is set to [nullptr], it will not be displayed. |
startPlayingStream
public void startPlayingStream
(const std::string &
streamID, *
ZegoCanvas canvas, ZegoPlayerConfig config)
Start playing stream.
Parameters | |
---|---|
streamID | Stream ID, a string of up to 256 characters. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', ''. |
canvas | The view used to display the play audio and video stream's image. If the view is set to [nullptr], it will not be displayed. |
config | Advanced player configuration |
stopPlayingStream
public void stopPlayingStream
(const std::string &
streamID)
Stop playing stream.
Parameters | |
---|---|
streamID | Stream ID |
setPlayVolume
public void setPlayVolume
(const std::string &
streamID, int
volume)
Set the playback volume of the stream.
Parameters | |
---|---|
streamID | Stream ID |
volume | Volume percentage. The value ranges from 0 to 100, and the default value is 100. |
mutePlayStreamAudio
public void mutePlayStreamAudio
(const std::string &
streamID, bool
mute)
Stop/resume playing the audio data of the stream.
Parameters | |
---|---|
streamID | Stream ID |
mute | mute flag, true: mute play stream video, false: resume play stream video |
mutePlayStreamVideo
public void mutePlayStreamVideo
(const std::string &
streamID, bool
mute)
Stop/resume playing the video data of the stream.
Parameters | |
---|---|
streamID | Stream ID |
mute | mute flag, true: mute play stream video, false: resume play stream video |
enableHardwareDecoder
public void enableHardwareDecoder
(bool
enable)
On/off hardware decoding.
Parameters | |
---|---|
enable | Whether to turn on hardware decoding switch, true: enable hardware decoding, false: disable hardware decoding. The default is false |
enableCheckPoc
public void enableCheckPoc
(bool
enable)
On/off frame order detection.
Parameters | |
---|---|
enable | Whether to turn on frame order detection, true: enable check poc,not support B frames, false: disable check poc, support B frames but the screen may temporary splash. The default is true |
startMixerTask
public void startMixerTask
(ZegoMixerTask task, ZegoMixerStartCallback callback)
Start mix stream task.
Parameters | |
---|---|
task | Mix stream task object |
callback | Start mix stream task result callback notification |
stopMixerTask
public void stopMixerTask
(ZegoMixerTask task, ZegoMixerStopCallback callback)
Stop mix stream task.
Parameters | |
---|---|
task | Mix stream task object |
callback | Stop mix stream task result callback notification |
muteMicrophone
public void muteMicrophone
(bool
mute)
Whether to mute microphone input.
Parameters | |
---|---|
mute | Whether to turn off the microphone, true: turn off microphone, false: turn on microphone. The default is true. |
muteSpeaker
public void muteSpeaker
(bool
mute)
Whether to mute speaker output.
Parameters | |
---|---|
mute | Whether to disable audio output to the device, true: disable audio output, false: enable audio output. The default value is false |
useAudioDevice
public void useAudioDevice
(ZegoAudioDeviceType deviceType, const std::string &
deviceID)
Choose to use an audio device.
Parameters | |
---|---|
deviceType | Audio device type |
deviceID | ID of a device obtained by getAudioDeviceList |
getAudioDeviceList
public ZegoDeviceInfostd::vector< > getAudioDeviceList
(ZegoAudioDeviceType deviceType)
Get a list of audio devices.
Parameters | |
---|---|
deviceType | Audio device type |
enableAudioCaptureDevice
public void enableAudioCaptureDevice
(bool
enable)
On/off audio capture device.
Parameters | |
---|---|
enable | Whether to enable the audio capture device, true: disable audio capture device, false: enable audio capture device |
enableCamera
public void enableCamera
(bool
enable)
On/off camera.
Parameters | |
---|---|
enable | Whether to turn on the camera, true: turn on camera, false: turn off camera |
enableCamera
public void enableCamera
(bool
enable, ZegoPublishChannel channel)
On/off camera.
useVideoDevice
public void useVideoDevice
(const std::string &
deviceID)
Choose to use a video device.
Parameters | |
---|---|
deviceID | ID of a device obtained by getVideoDeviceList |
useVideoDevice
public void useVideoDevice
(const std::string &
deviceID, ZegoPublishChannel channel)
Choose to use a video device.
getVideoDeviceList
public ZegoDeviceInfostd::vector< > getVideoDeviceList
()
Get a list of video devices.
startSoundLevelMonitor
public void startSoundLevelMonitor
()
Start the sound level monitor.
stopSoundLevelMonitor
public void stopSoundLevelMonitor
()
Stop the sound level monitor.
startAudioSpectrumMonitor
public void startAudioSpectrumMonitor
()
Start the audio spectrum monitor.
stopAudioSpectrumMonitor
public void stopAudioSpectrumMonitor
()
Stop the audio spectrum monitor.
enableAEC
public void enableAEC
(bool
enable)
On/off echo cancellation.
Parameters | |
---|---|
enable | Whether to enable echo cancellation, true: enable echo cancellation, false: disable echo cancellation |
setAECMode
public void setAECMode
(ZegoAECMode mode)
Set echo cancellation mode.
Parameters | |
---|---|
mode | Echo cancellation mode |
enableAGC
public void enableAGC
(bool
enable)
On/off automatic gain control.
Parameters | |
---|---|
enable | Whether to enable automatic gain control, true: enable AGC, false: disable AGC |
enableANS
public void enableANS
(bool
enable)
On/off noise suppression.
Parameters | |
---|---|
enable | Whether to enable noise suppression, true: enable AGC, false: disable AGC |
sendBroadcastMessage
public void sendBroadcastMessage
(const std::string &
roomID, const std::string &
message, ZegoIMSendBroadcastMessageCallback callback)
Send room broadcast message.
Parameters | |
---|---|
roomID | Room ID, a string of up to 128 bytes in length. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', '' |
message | Message content, no longer than 256 bytes |
callback | Send broadcast message result callback |
sendBarrageMessage
public void sendBarrageMessage
(const std::string &
roomID, const std::string &
message, ZegoIMSendBarrageMessageCallback callback)
Send room barrage message.
Parameters | |
---|---|
roomID | Room ID, a string of up to 128 bytes in length. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', '' |
message | Message content, no longer than 256 bytes |
callback | Send barrage message result callback |
sendCustomCommand
public void sendCustomCommand
(const std::string &
roomID, const std::string &
command, std::vector<
ZegoUser >
toUserList, ZegoIMSendCustomCommandCallback callback)
Send custom command.
Parameters | |
---|---|
roomID | Room ID, a string of up to 128 bytes in length. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', '' |
command | Custom command content, no longer than 256 bytes |
toUserList | The users who will receive the command |
callback | Send command result callback |
createMediaPlayer
public IZegoMediaPlayer * createMediaPlayer
()
Create a media player instance object.
destroyMediaPlayer
public void destroyMediaPlayer
( *&
IZegoMediaPlayer mediaPlayer)
Destroy a media player instance object.
Parameters | |
---|---|
mediaPlayer | The media player instance object to be destroyed |
setCustomVideoRenderHandler
public void setCustomVideoRenderHandler
(std::shared_ptr<
IZegoCustomVideoRenderHandler >
handler)
Set the custom video render handler.
Parameters | |
---|---|
handler | Custom video render handler |
setCustomVideoCaptureHandler
public void setCustomVideoCaptureHandler
(std::shared_ptr<
IZegoCustomVideoCaptureHandler >
handler)
Set the custom video capture handler.
Parameters | |
---|---|
handler | Custom video capture handler |
sendCustomVideoCaptureRawData
public void sendCustomVideoCaptureRawData
(const unsigned char *
data, unsigned int
dataLength, ZegoVideoFrameParam params, unsigned long long
referenceTimeMillisecond)
Send captured video data to SDK.
Parameters | |
---|---|
data | video frame data |
dataLength | video frame data length |
params | video frame param |
referenceTimeMillisecond | video frame reference time |
sendCustomVideoCaptureRawData
public void sendCustomVideoCaptureRawData
(const unsigned char *
data, unsigned int
dataLength, ZegoVideoFrameParam params, unsigned long long
referenceTimeMillisecond, ZegoPublishChannel channel)
Send captured video data to SDK.
setCustomVideoCaptureFillMode
public void setCustomVideoCaptureFillMode
(ZegoViewMode mode)
Set custom video capture fill mode.
Parameters | |
---|---|
mode | View mode |
setCustomVideoCaptureFillMode
public void setCustomVideoCaptureFillMode
(ZegoViewMode mode, ZegoPublishChannel channel)
Set custom video capture fill mode.