logo
On this page

Interface

AudioFrameOptionsBackgroundBlurOptions
BackgroundVirtualOptionsBufferIntervals
ConstraintExtendExceptionData
MediaInfoQualityStats
RangeAudioPlayStatsRangeAudioPublishStats
SoundLevelDelegateOptionsStreamViewEvent
ZegoAudioEffectPlayOptionsZegoAudioFrame
ZegoAutoMixerTaskZegoAutoSwitchDeviceConfig
ZegoBarrageMessageInfoZegoBroadcastMessageInfo
ZegoCameraZegoCapabilityDetection
ZegoCapabilityErrorZegoCapabilityErrorInfo
ZegoCaptureCameraZegoCaptureMicrophone
ZegoCaptureScreenAudioZegoCaptureScreenVideo
ZegoCheckSingleTypeZegoCopyrightedMusicConfig
ZegoCopyrightedMusicDownloadResponseZegoCopyrightedMusicEvent
ZegoCopyrightedMusicGetKrcLyricByTokenResponseZegoCopyrightedMusicGetLrcLyricResponse
ZegoCopyrightedMusicGetStandardPitchResponseZegoCopyrightedMusicRequestConfig
ZegoCopyrightedMusicRequestResourceResponseZegoCopyrightedMusicSendExtendedRequestResponse
ZegoCustomZegoCustomAudio
ZegoCustomPlayerResourceConfigZegoCustomVideo
ZegoDataChannelEventZegoDeviceInfo
ZegoDeviceInfosZegoEffectsBeautyParam
ZegoElectronScreenSourceZegoExpressPlayerConfig
ZegoExpressPlayerErrorZegoFontStyle
ZegoLabelInfoZegoLocalAduioOptions
ZegoLocalProxyConfigZegoLocalStreamConfig
ZegoLocalStreamEventZegoLocalViewOptions
ZegoLogConfigZegoMixerAudioConfig
ZegoMixerImageInfoZegoMixerOutputVideoConfig
ZegoMixStreamAdvanceZegoMixStreamConfig
ZegoMixStreamInputZegoMixStreamLayout
ZegoMixStreamOutputZegoMixStreamOutputConfig
ZegoOptionsZegoPlayAudioStats
ZegoPlayerStateZegoPlayStats
ZegoPlayVideoStatsZegoProxyInfo
ZegoPublishAudioStatsZegoPublisherState
ZegoPublishStatsZegoPublishStreamAudioConfig
ZegoPublishStreamConfigZegoPublishVideoStats
ZegoRangeAudioEventZegoRangeAudioUserUpdateCheckConfig
ZegoRoomConfigZegoRoomExtraInfo
ZegoRoomRecvTransparentMessageZegoRoomSendTransparentMessage
ZegoRTCEventZegoRTMEvent
ZegoScreenZegoSEIConfig
ZegoServerResponseZegoSnapshotOptions
ZegoSongLineScoreInfoZegoSoundLevelInfo
ZegoStartScoreParamsZegoStreamCompositorInputOption
ZegoStreamCompositorLayoutOptionZegoStreamCompositorOutputConfig
ZegoStreamListZegoStreamOptions
ZegoStreamRelayCDNInfoZegoStreamViewOptions
ZegoSwitchRoomConfigZegoTurnServer
ZegoUserZegoVideoCodec
ZegoWatermarkZegoWebPlayOption
ZegoWebPublishOption

AudioFrameOptions

audio frame callback setting options.

Properties

frameSize

frameSize
frameSize: number

The number of sample data contained in each channel of the audio data for each callback can only be set to the following values: 256, 512, 1024, 2048, 4096, 8192, 16384. Default is 4096.

  • Use cases: frameSize takes effect when first set.

sampleRate

sampleRate
sampleRate: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000

Specifies the sampling rate of the callback audio data conversion. It can only be set to the following values: 8000, 16000, 22050, 24000, 32000, 44100, 48000. The default is to set it according to the original sampling rate of AudioContext.

channelCount

channelCount
channelCount: 1 | 2

Specifies the number of channels of the callback audio data. Only the following values ​​can be set: 1, 2. The default is based on the number of channels of the original data.

bitDepth

bitDepth
bitDepth: 32 | 16

The audio data bit depth can only be set to the following values: 32 for 32-bit float, 16 for 16-bit. The default value is 32.

BackgroundBlurOptions

Properties

blurDegree

blurDegree
blurDegree: number

BackgroundVirtualOptions

Properties

source

source
source: HTMLImageElement

背景图片对象

objectFit

objectFit
objectFit: string

BufferIntervals

buffer intervals

Details

buffer intervals

Properties

minInterval

minInterval
minInterval: number

The lower limit of the buffer interval. The optional range of minInterval is in the [0, 1000] ms interval. The default is 0.

maxInterval

maxInterval
maxInterval: number

The upper limit of the buffer interval. The optional range of maxInterval is in the [1000, 10000] ms interval. The default is 2000 ms.

ConstraintExtend

Constrained expansion of the resolution and bit rate configuration of ZegoCamera and ZegoSreen.

Details

Detailed description: Constraint object, when the parameter videoQuality of ZegoCamera and ZegoSreen is 4, set the resolution, bit rate, etc.

Business scenario: Constrain expansion when creating preview audio and video streams.

Precautions: For the four forms, the precedence is exact > ideal >= max = min. which is:

  1. When exact appears, other options are ignored. If it cannot be satisfied, the collection fails
  2. When ideal appears, when there is no min and max, try to get as close to ideal as possible ⅰ. If it can be achieved, it can be floated at ideal ± 10 ii. If it cannot be achieved, use the closest value
  3. When exact does not appear, ideal appears, when there is min, try to be as close to ideal as possible, and greater than min. If it cannot be greater than min, the collection fails.
  4. When exact does not appear, ideal appears, when there is max, try to be as close to ideal as possible, and less than max. If it cannot be less than max, the collection fails
  5. When exact does not appear, ideal appears, when there are min and max, try to be as close to ideal as possible, but greater than min and less than max. If it cannot be satisfied, the collection fails
  6. Exact or ideal does not appear. When min appears, it is greater than min. If it cannot be greater than min, the collection fails.
  7. Exact and ideal do not appear. When max appears, it is less than max. If it cannot be less than max, the collection fails
  8. Exact and ideal do not appear. When min and max appear, they are greater than min and less than max. If it cannot be satisfied, the collection fails.

Properties

exact

exact
exact: number

Optional parameter, other options are ignored when present. Strictly specify the final output value of the acquisition device. If the device does not support the specified value, the acquisition will fail.

ideal

ideal
ideal: number

Optional parameter, expect the final output value of the collection device. If the device does not support the specified value, it will try to output the closest value.

max

max
max: number

Optional parameter, the upper limit of the final output value of the collection device.

min

min
min: number

Optional parameter, the lower limit of the final output value of the collection device.

ExceptionData

Details

Related event information of 'exceptionUpdate'

Properties

code

code

Event code

message

message
message: string

Information description

MediaInfo

Describes the media information data parsed by the player plug-in when pulling the CDN stream

Properties

frameWidth

frameWidth
frameWidth: number

Video frame width

frameHeight

frameHeight
frameHeight: number

Video frame height

frameRate

frameRate
frameRate: number

The original frame rate of the video resource

sampleRate

sampleRate
sampleRate: number

Audio sample rate

duration

duration
duration: number

Video resource duration, the usual value for CDN live streams is -1.

channelCount

channelCount
channelCount: number

The number of audio channels. By default, binaural audio will be used to render audio.

videoCodecName

videoCodecName
videoCodecName: string

Video encoding format name

audioCodecName

audioCodecName
audioCodecName: string

Audio encoding format name

formatName

formatName
formatName: string

Media packaging format name

QualityStats

Describes the player quality stats

Details

stream quality

Properties

decodeType

decodeType
decodeType: string

decodeType

videoNetDataKBPerSecond

videoNetDataKBPerSecond
videoNetDataKBPerSecond: number

video bitrate, KB/s

audioNetDataKBPerSecond

audioNetDataKBPerSecond
audioNetDataKBPerSecond: number

audio bitrate,KB/s

videoDecodedKBPerSecond

videoDecodedKBPerSecond
videoDecodedKBPerSecond: number

video decode bitrate,KB/s

audioDecodedKBPerSecond

audioDecodedKBPerSecond
audioDecodedKBPerSecond: number

audio decode bitrate,KB/s

hasAudio

hasAudio
hasAudio: boolean

has audio

hasVideo

hasVideo
hasVideo: boolean

has audio

videoRenderFPS

videoRenderFPS
videoRenderFPS: number

video render fps

audioRenderFPS

audioRenderFPS
audioRenderFPS: number

audio render fps

audioMuted

audioMuted
audioMuted: boolean

audio is muted

targetVideoFPS

targetVideoFPS
targetVideoFPS: number

video target render frame rate

targetAudioFPS

targetAudioFPS
targetAudioFPS: number

audio target render frame rate

netQuality

netQuality
netQuality: number

network quality grade (0~100

totalRecvBytes

totalRecvBytes
totalRecvBytes: number

Total number of bytes of data received

videoRecvBytes

videoRecvBytes
videoRecvBytes: number

Number of bytes of video data received

audioRecvBytes

audioRecvBytes
audioRecvBytes: number

Number of bytes of audio data received

seiRecvBytes

seiRecvBytes
seiRecvBytes: number

The number of bytes of SEI data received

RangeAudioPlayStats

Details

Range voice streaming quality.

Properties

audioBitrate

audioBitrate
audioBitrate: number

Audio bit rate

audioCodec

audioCodec
audioCodec: string

Audio encoding format "opus"

audioJitter

audioJitter
audioJitter: number

Network jitter

audioLevel

audioLevel
audioLevel: number

volume

audioPacketsLost

audioPacketsLost
audioPacketsLost: number

Number of lost packets

audioPacketsLostRate

audioPacketsLostRate
audioPacketsLostRate: number

Packet loss rate

audioQuality

audioQuality
audioQuality: number

Stream audio quality,- 1 for unknown, 0 for excellent, 1 for good, 2 for medium, 3 for poor, 4 for very poor

audioSamplingRate

audioSamplingRate
audioSamplingRate: number

Sampling Rate

muteState

muteState
muteState: "0" | "1"

Whether the audio track is turned off

audioFPS

audioFPS
audioFPS: number

Audio frame rate

audioSendLevel

audioSendLevel
audioSendLevel: number

Audio transmission energy

googCodecName

googCodecName
googCodecName: string

Audio encoding format

audioCumulativeDecodeTime

audioCumulativeDecodeTime
audioCumulativeDecodeTime: number

Detail description: The cumulative audio decoding time, in milliseconds (supported by version 2.19.0 and above).

audioCumulativeBreakTime

audioCumulativeBreakTime
audioCumulativeBreakTime: number

Detail description: The cumulative video freeze duration, in milliseconds (supported by version 2.19.0 and above).

audioCumulativeBreakRate

audioCumulativeBreakRate
audioCumulativeBreakRate: number

Detail description: The cumulative video freezing rate, the unit is 1, and the value range is [0,1] (supported by version 2.19.0 and above).

peerToPeerDelay

peerToPeerDelay
peerToPeerDelay: number

End to end delay, in ms.

peerToPeerPacketLostRate

peerToPeerPacketLostRate
peerToPeerPacketLostRate: number

End to end packet loss rate, unit: 1.

RangeAudioPublishStats

Details

Range voice streaming quality.

Properties

audioBitrate

audioBitrate
audioBitrate: number

Audio bit rate

audioCodec

audioCodec
audioCodec: string

Audio encoding format

audioPacketsLost

audioPacketsLost
audioPacketsLost: number

Audio packet loss

audioPacketsLostRate

audioPacketsLostRate
audioPacketsLostRate: number

Audio packet loss rate

googCodecName

googCodecName
googCodecName: string

Audio encoding format

muteState

muteState
muteState: '0' | '1'

Whether the audio track is turned off

audioFPS

audioFPS
audioFPS: number

Audio frame rate

audioQuality

audioQuality
audioQuality: number

audio quality, - 1 for unknown, 0 for excellent, 1 for good, 2 for medium, 3 for poor, 4 for very poor

SoundLevelDelegateOptions

Sound wave callback setting options.

Properties

enableInBackground

enableInBackground
enableInBackground: boolean

Set whether to keep on when the page is hidden to get the sound wave and call back the sound wave callback. The default is off in versions after 2.18.0.

  • Use cases: Turning off fetch sound waves when the page is hidden can reduce performance consumption.

StreamViewEvent

A collection of events related to the media stream component.

Details

Detailed description: Describe the event name and its corresponding callback parameters. Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

autoplayFailed

autoplayFailed
autoplayFailed: () => void

Autoplay failed event.

canPlayVideo

canPlayVideo
canPlayVideo: () => void

Fires when the user can start playing the video.

canPlayAudio

canPlayAudio
canPlayAudio: () => void

Fires when the user can start playing audio.

ZegoAudioEffectPlayOptions

Audio effect player settings options.

Properties

path

path
path: string

Specify the address to load the online audio resource. If the audioEffectID has already loaded a sound effect, the loaded sound effect will be used directly.

  1. Online audio files need to comply with the Browser's Same Origin Policy.
  2. MP3, AAC, and other audio formats supported by the browser are supported.

ZegoAudioFrame

Audio raw data information.

Properties

channels

channels
channels: Float32Array[]

Audio raw data, the array is the audio raw data of each channel.

channelCount

channelCount
channelCount: number

channel count

sampleRate

sampleRate
sampleRate: number

Audio sample rate.

ZegoAutoMixerTask

Automatic stream mixing task object

  • Use cases:

  • Caution:

Properties

taskID

taskID
taskID: string

Mixed-flow task id (customer-defined, must be unique), required, maximum 256 characters, only supports numbers, English characters and'~','!','@','#','$', ' ','^','&','*','(',')','_','+','=','-',',';',''',', ', '

roomID

roomID
roomID: string

The room ID of the automatic streaming task.

  • Use cases: This parameter needs to be configured when initiating an automatic stream mixing task.
  • Required: true.
  • Value range: A string of no more than 128 bytes in length.
  • Caution: Only numbers, English characters and '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '=', '-', '`', ';', '’', ',', '.', '<', '>', '' are supported. If you need to communicate with the Web SDK, please do not use '%'.

audioConfig

audioConfig
audioConfig: ZegoMixerAudioConfig

Audio configuration of automatic stream mixing tasks, including audio bitrate, audio channel, encoding ID, and multi-channel audio stream mixing mode.

Use case: If there are special requirements for the audio of automatic stream mixing tasks, such as adjusting the audio bitrate, you can adjust this parameter as needed, otherwise no configuration is required.

  • Required: No.
  • Default value: The default audio bitrate is "48 kbps", the default audio channel is "ZEGO_AUDIO_CHANNEL_MONO", the default encoding ID is "ZEGO_AUDIO_CODEC_ID_DEFAULT", and the default multi-channel audio stream mixing mode is "ZEGO_AUDIO_MIX_MODE_RAW".
  • Recommended value: Set as required.

outputList

outputList
outputList: ZegoMixStreamOutput[]

The output stream list of the automatic stream mixing task, which contains URLs or stream IDs. If it is in URL format, it currently only supports the RTMP URL format: rtmp://xxxxxxxx.

  • Use cases: When initiating an automatic stream mixing task, you need to configure this parameter to specify the mixed stream output target.
  • Required: Yes.

enableSoundLevel

enableSoundLevel
enableSoundLevel: boolean

Enables the mixed flow sound wave callback notification, which is used to obtain the sound wave of each audio input in the mixed flow. When postmixing is enabled, the sound information of each single stream can be received through the on[autoMixerSoundLevelUpdate] callback.

streamAlignmentMode

streamAlignmentMode
streamAlignmentMode: number

Stream alignment mode, 0 means off, 1 means on.

minPlayStreamBufferLength

minPlayStreamBufferLength
minPlayStreamBufferLength: number

Set the lower limit of the interval range for adaptive adjustment of the stream cache of the mixing server. In the real-time chorus KTV scenario, slight fluctuations in the network on the push end may cause the mixed stream to freeze. At this time, when the audience pulls the mixed stream, there is a high probability of freezing. By adjusting the lower limit of the interval range for adaptive adjustment of the stream cache on the mixing server, the freezing problem that occurs when the audience pulls the mixed stream can be optimized, but the delay will be increased. Not set by default, that is, the server uses its own configuration value. It will only take effect on new input streams and will not take effect on input streams that have already started mixing.

  • Value range: [0,10000], if the maximum value is exceeded, the mixing will fail.

ZegoAutoSwitchDeviceConfig

Configuration constraints related to 'enableAutoSwitchDevice'

Properties

camera

camera
camera: boolean

Whether to enable automatic switching of camera devices

  • Required: No

microphone

microphone
microphone: boolean

Whether to enable automatic switching of microphone devices

  • Required: No

ZegoBarrageMessageInfo

room barrage message info

Properties

fromUser

fromUser
fromUser: ZegoUser

Send message user

message

message
message: string

Message content

sendTime

sendTime
sendTime: number

Send time

messageID

messageID
messageID: string

Message ID

ZegoBroadcastMessageInfo

Broadcast message

Properties

fromUser

fromUser
fromUser: ZegoUser

Send message user

message

message
message: string

Message content

sendTime

sendTime
sendTime: number

Send time

messageID

messageID
messageID: number

Message ID

ZegoCamera

Create camera media stream related parameter constraints

Details

This class is used to constrain the source.camera parameter of the createStream interface.

  • Use cases: Create camera audio and video streams.
  • Caution:
  1. After the stream is successfully created, the stream obtained is a mediaStream object, and the developer can render it by assigning a value to the srcObject property of the <video> or <audio> object.
  2. Use the default device when audioInput and videoInput are not specified.
  3. Noise reduction, automatic gain, and echo cancellation are enabled by default based on the browser's capabilities. Unless there are special circumstances, it is recommended that customers keep these three items unchanged.
  4. When the camera's videoQuality is 4, the camera adds width / height / frameRate / bitrate attributes. These parameters only support positive integers, and these four attributes must also be passed to the SDK.
  5. If the facingMode parameter is set, the videoInput parameter will be ignored.

Properties

audio

audio
audio: boolean

Whether audio is needed, default is true

audioInput

audioInput
audioInput: string

Audio input device, the default device selected for the browser

audioBitrate

audioBitrate
audioBitrate: number

Audio bit rate, the default is 48kbps

video

video
video: boolean

Whether video is required, the default is true.

videoInput

videoInput
videoInput: string

Video input devices, pass the default device selected for the browser.

videoQuality

videoQuality
videoQuality: 1|2|3|4

Video quality level, the default quality level is 4, (the default level for versions before 2.21.0 is 2): 1: Resolution 320 * 240, frame rate 15, code rate 300 kbps. 2: Resolution 640 * 480, frame rate: 15, code rate 800 kbps. 3: Resolution 1280 * 720, frame rate: 20, code rate 1500 kbps. 4: When videoQuality is 4, the four parameters of width, height, frameRate and bitrate can be customized and modified. If not passed, the scene configuration value shall prevail. The default is the common scene value: resolution 640 * 480, frame rate: 15, Bit rate 800 kbps.

facingMode

facingMode
facingMode: 'user'|'environment'

Camera orientation, "user" means the front camera, "environment" means the rear camera. If not passed, the default is to use the device specified by videoInput or the default camera device of the operating system.

channelCount

channelCount
channelCount: 1|2

Number of channels, 1 is mono, 2 is two channels, the default is mono. If you turn on the microphone collection when pulling streams on the Safari browser, the stereo effect will be lost. You need to avoid turning on the microphone when pulling streams.

ANS

ANS
ANS: boolean

Whether to turn on noise reduction or not will be determined based on the browser's capabilities. It is usually turned on by default.

AGC

AGC
AGC: boolean

Whether to turn on automatic gain or not will be determined based on the browser's capabilities. It is usually turned on by default.

AEC

AEC
AEC: boolean

Whether to turn on echo cancellation or not will be determined based on the browser's capabilities. It is usually turned on by default.

width

width
width: number | ConstraintExtend

Wide resolution, effective when videoQuality is 4.

height

height
height: number | ConstraintExtend

High resolution, effective when videoQuality is 4

bitrate

bitrate
bitrate: number

Bit rate, unit kb/s, effective when videoQuality is 4.

frameRate

frameRate
frameRate: number | ConstraintExtend

Frame rate, effective when videoQuality is 4

startBitrate

startBitrate
startBitrate: "default" | "target"

The starting bit rate, the default is "default", environmental requirements: Google kernel browser and SDK version 2.7.0 and above. A value of "default" means to use webrtc's default start bitrate of 300kbps and then slowly increase; a value of "target" means to quickly increase to the set target bitrate.

videoOptimizationMode

videoOptimizationMode
videoOptimizationMode: "default" | "motion" | "detail"

Video optimization mode, default to "default";

A value of "motion" indicates smooth mode. In most cases, the SDK will not reduce the frame rate, but may reduce the transmission resolution.

A value of "detail" indicates clear mode. In most cases, the SDK will not reduce the transmission resolution, but may reduce the frame rate.

minBitrate

minBitrate
minBitrate: number

The minimum streaming bit rate. The minimum bit rate for acceptable video quality degradation when the network is poor.

  • Use cases: If you want the video to be consistently high quality, set minBitrate to a value close to the target bitrate. Push streams that do not require high video quality can set the minBitrate to a lower value.

keyFrameInterval

keyFrameInterval
keyFrameInterval: number

The length of the video keyframe interval, in seconds.

  • Default value: 2 s.
  • Value range: [2, 6].

ZegoCapabilityDetection

Properties

webRTC

webRTC
webRTC: boolean

Whether to support the webRTC protocol, true means that the webRTC protocol can be used to transmit the stream

customCapture

customCapture
customCapture: boolean

Whether to support custom streams (other streams not captured by camera or screen capture, such as mp4 played by video tags, etc.)

camera

camera
camera: boolean

Does the camera have permission to call

microphone

microphone
microphone: boolean

Does the microphone have permission to call

screenSharing

screenSharing
screenSharing: boolean

Whether to support screen sharing function

videoCodec

videoCodec
videoCodec: ZegoVideoCodec

The video encoding format supported by the browser; it should be noted that some browsers will support a certain encoding format, but the actual system castrated this function, so if a certain encoding format returns false, it must not be supported, true is not necessarily 100 %stand by

errInfo

errInfo

Error information related to detection failure, device-related error description can refer to MediaDevices.getUserMedia The exception description of the interface document.

result

result
result: boolean

Judge whether it is supported or not according to the type passed in

ZegoCapabilityError

Properties

name

name
name: string

error name

message

message
message: string

error description information

ZegoCapabilityErrorInfo

Error information related to test results.

Properties

webRTC

webRTC

customCapture

customCapture
customCapture: ZegoCapabilityError

camera

camera

For specific error descriptions, please refer to MediaDevices.getUserMedia interface documentation The exception description.

microphone

microphone
microphone: ZegoCapabilityError

For specific error descriptions, please refer to MediaDevices.getUserMedia interface documentation The exception description.

extendedData

extendedData
extendedData: string

ZegoCaptureCamera

Create camera media stream related parameter constraints

Details

This class is used to constrain the parameter source.camera.video of the interface [createZegoStream]. Or the methods [startCaptureCamera], [startCaptureCameraAndMicrophone] of the ZegoLocalStream instance created by [createZegoStream]..

  • Use cases: Create camera video streams.
  • Caution:
  1. The ZegoLocalStream instance obtained after calling [createZegoStream] successfully. After successfully capturing the camera video stream, you can play the collected video stream by calling ZegoLocalStream.playCaptureVideo, and use ZegoLocalStream.playVideo to push or push the video stream.
  2. Use the default device when input are not specified.
  3. When the camera's quality is 4, the camera adds width / height / frameRate attributes. These parameters only support positive integers, and these three attributes must also be passed to the SDK.
  4. If the facingMode parameter is set, the input parameter will be ignored.

Properties

input

input
input: string

Video input devices, pass the default device selected for the browser.

quality

quality
quality: 1|2|3|4

Video quality level, the default quality level is 4, (the default level for versions before 2.21.0 is 2): 1: Resolution 320 * 240, frame rate 15, code rate 300 kbps. 2: Resolution 640 * 480, frame rate: 15, code rate 800 kbps. 3: Resolution 1280 * 720, frame rate: 20, code rate 1500 kbps. 4: When quality is 4, the four parameters of width, height, frameRate and bitrate can be customized and modified. If not passed, the scene configuration value shall prevail. The default is the common scene value: resolution 640 * 480, frame rate: 15, code rate 800 kbps.

facingMode

facingMode
facingMode: 'user'|'environment'

Camera orientation, "user" means the front camera, "environment" means the rear camera, the default is the device specified by the input parameter or the default device selected by the browser.

width

width
width: number | ConstraintExtend

Wide resolution, effective when quality is 4.

height

height
height: number | ConstraintExtend

High resolution, effective when quality is 4.

frameRate

frameRate
frameRate: number | ConstraintExtend

Frame rate, effective when quality is 4.

optimizationMode

optimizationMode
optimizationMode: "default" | "motion" | "detail"

Video optimization mode, default to "default";

A value of "motion" indicates smooth mode. In most cases, the SDK will not reduce the frame rate, but may reduce the transmission resolution.

A value of "detail" indicates clear mode. In most cases, the SDK will not reduce the transmission resolution, but may reduce the frame rate.

keyFrameInterval

keyFrameInterval
keyFrameInterval: number

The length of the video keyframe interval, in seconds.

  • Default value: 2 s.
  • Value range: [2, 6].

ZegoCaptureMicrophone

Capture microphone media stream related parameter constraints

Details

This class is used to constrain the parameter source.camera.audio of the interface [createZegoStream], or the methods [startCaptureMicrophone] and [startCaptureCameraAndMicrophone] of the ZegoLocalStream instance created by [createZegoStream].

  • Use cases: Create microphone audio streams.
  • Caution:
  1. The ZegoLocalStream instance obtained after calling [createZegoStream] successfully, after successfully capturing the microphone stream, can play the captured audio by calling ZegoLocalStream.playCaptureAudio, and use ZegoLocalStream.playAudio to publish or publish the audio in the stream.
  2. Use the default device when input is not specified.
  3. Noise reduction, automatic gain, and echo cancellation are enabled by default based on the browser's capabilities. Unless there are special circumstances, it is recommended that customers keep these three items unchanged.

Properties

input

input
input: string

Audio input device, the default device selected for the browser

channelCount

channelCount
channelCount: 1|2

Number of channels, 1 is mono, 2 is two channels, the default is mono.

ANS

ANS
ANS: boolean

Whether to turn on noise reduction or not will be determined based on the browser's capabilities. It is usually turned on by default.

AGC

AGC
AGC: boolean

Whether to turn on the automatic gain or not to decide whether to turn on the browser's ability, usually the default is to open.

AEC

AEC
AEC: boolean

Whether to turn on echo cancellation or not will be decided based on the browser's capabilities. It is usually turned on by default.

ZegoCaptureScreenAudio

Create shared audio-related parameter constraints for screen sharing media streams

Details

This class is used to constrain the source.screen parameter of the createStream interface.

  • Use cases: Create a screen sharing media stream that includes shared audio.

Properties

ANS

ANS
ANS: boolean

Whether to turn on noise reduction. It is turned off by default.

AGC

AGC
AGC: boolean

Whether to turn on the automatic gain. It is turned off by default.

AEC

AEC
AEC: boolean

Whether echo cancellation is enabled or not. It is enabled by default.

ZegoCaptureScreenVideo

Create screen sharing media stream related parameter constraints

Details

This class is used to constrain the parameter source.screen.video of the interface [createZegoStream], or the methods [startCaptureScreenWithAudio] and [startCaptureScreen] of the ZegoLocalStream instance created by [createZegoStream].

  • Use cases: Create a screen sharing media stream.
  • Caution: When the quality is 4, the camera adds width / height / frameRate attributes. These parameters only support positive integers, and these three attributes must also be passed to the SDK.

Properties

quality

quality
quality: 1|2|3|4

Generally speaking, the choice of screen sharing video quality should be determined according to the actual situation and scene. The quality in screen provides three preset values:

1: The frame rate is larger, which is suitable for scenes that require high fluency. 2: Suitable for scenes that strike a balance between fluency and clarity. 3: Large bit rate, suitable for scenes with high definition requirements. In addition to the above three preset values, quality also provides a custom value of 4, which can customize the frame rate and bitrate. The screen adds frameRate attributes. This attributes need to be passed to the SDK when used.

Video quality level, the default quality level is 2 1 Frame rate: 20 Code rate: 800K 2 Frame rate: 15 Code rate: 1500K 3 Frame rate: 5 Code rate: 2000K 4 Frame rate: frameRate

width

width
width: number | ConstraintExtend

wide resolution

height

height
height: number | ConstraintExtend

High resolution

frameRate

frameRate
frameRate: number | ConstraintExtend

frameRate

optimizationMode

optimizationMode
optimizationMode: "default" | "motion" | "detail"

Video optimization mode, default to "default";

A value of "motion" indicates smooth mode. In most cases, the SDK will not reduce the frame rate, but may reduce the transmission resolution.

A value of "detail" indicates clear mode. In most cases, the SDK will not reduce the transmission resolution, but may reduce the frame rate

sourceID

sourceID
sourceID: string

Specify the screen shared screen ID, only the Chrome kernel browser is used

keyFrameInterval

keyFrameInterval
keyFrameInterval: number

The length of the video key frame interval, in seconds. Screen sharing can reduce the performance pressure of video encoding by increasing the interval of keyframes.

  • Default value: 2 s.
  • Value range: [2, 6].

captureElement

captureElement
captureElement: HTMLElement

Screen sharing is supported, and videos only share DOM element areas.

  • Use cases: Screen sharing videos are supported to share only the DOM element area, not the entire tab.
  • Caution: 1.Only Chrome 104 or later browsers are supported, Chrome 116 or later is required if the shared DOM element contains multimedia elements (img, video, etc.). For a better experience, we recommend that you go straight to the latest version of Chrome.; 2.It is recommended that you use CSS to fix the position of DOM elements to prevent the size of the DOM appearing in the viewport from changing when the browser page scrolls, resulting in frequent changes in the resolution of the captured video, resulting in the failure of some Android devices to pull the stream and decode.

ZegoCheckSingleType

Properties

webRTC

webRTC
webRTC: "webRTC"

Test whether the browser supports webRTC

customCapture

customCapture
customCapture: "customCapture"

Check whether the browser supports custom stream

camera

camera
camera: "camera"

Check whether the camera has permission to call

microphone

microphone
microphone: "microphone"

Check if the microphone has permission to call

screenSharing

screenSharing
screenSharing: "screenSharing"

Check whether screen sharing is supported

H264

H264
H264: "H264"

Check whether H264 encoding format is supported

VP8

VP8
VP8: "VP8"

Check whether VP8 encoding format is supported

H265

H265
H265: "H265"

Check if H265 encoding format is supported

ZegoCopyrightedMusicConfig

Copyright music configuration.

Properties

user

user
user: ZegoUser

User object instance, configure user ID and username. that the user ID set here needs to be consistent with the user ID set when logging into the room, otherwise the request for copyright music background service will fail.

ZegoCopyrightedMusicDownloadResponse

Download the song and return the result.

Properties

errorCode

errorCode
errorCode: number

Error code, please refer to Common error code document for details.

urls

urls
urls: string[]

Song link list. If the style is downloaded, the first link is the style and the second is the original song.

ZegoCopyrightedMusicEvent

Collection of copyright music feature related events.

Details

Detailed description: Describe the event name and its corresponding callback parameters. Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

downloadProgressUpdate

downloadProgressUpdate
downloadProgressUpdate: DownloadProgressUpdateCallBack

Loading song or accompaniment progress callback.

songLineScoreComplete

songLineScoreComplete
songLineScoreComplete: SongLineScoreCompleteCallBack

Start scoring the song, and complete the callback for scoring each row of the song. You can use this callback to obtain the score information for this row. When calling the startScore interface, you need to pass the ZegoStartScoreParams.enableSongLineScoreCompleteEvent value as true to enable this event callback.

ZegoCopyrightedMusicGetKrcLyricByTokenResponse

Get the completion callback result of lyrics in lrc format.

Properties

errorCode

errorCode
errorCode: number

Error code, please refer to Common error code document for details.

lyrics

lyrics
lyrics: any

Lyrics in lrc format, dedicated to progressive lyrics scene, please refer to https://doc-zh.zego.im/online-ktv-electron/client-api/apis-to-obtain-songs-and-lyrics for details.

ZegoCopyrightedMusicGetLrcLyricResponse

Get the result of the resource.

Properties

errorCode

errorCode
errorCode: number

Error code, please refer to Common error code document for details.

lyrics

lyrics
lyrics: any

Lyrics in lrc format, dedicated to progressive lyrics scene, please refer to https://doc-zh.zego.im/online-ktv-electron/client-api/apis-to-obtain-songs-and-lyrics for details.

ZegoCopyrightedMusicGetStandardPitchResponse

Obtain the standard pitch line data to complete the callback result.

Properties

errorCode

errorCode
errorCode: number

Error code, please refer to Common error code document for details.

pitch

pitch
pitch: any

标准音高线数据。详情请参考 Android:/online-ktv-android/zego-content-center/scoring-component, iOS:/online-ktv-ios/zego-content-center/scoring-component

ZegoCopyrightedMusicRequestConfig

Get the configuration of a resource.

Properties

songID

songID
songID: string

Song ID.

vendorID

vendorID

Vendor.

mode

mode

billing mode.

masterID

masterID
masterID: string

Host ID, which must be passed when the billing mode is billed by host. Indicate according to which homeowner to order song/accompaniment/climax clip.

sceneID

sceneID
sceneID: number

Scenario ID, indicating the actual business, please consult ZEGO technical support for details.

ZegoCopyrightedMusicRequestResourceResponse

Get the result of the resource.

Properties

errorCode

errorCode
errorCode: number

Error code, please refer to Common error code document for details.

resource

resource
resource: any

The JSON returned by the song order service contains song resource information, please refer to https://doc-zh.zego.im/online-ktv-electron/client-api/apis-to-obtain-songs-and-lyrics#1_1 for details.

ZegoCopyrightedMusicSendExtendedRequestResponse

Extension request results.

Properties

errorCode

errorCode
errorCode: number

Error code, please refer to Common error code document for details.

result

result
result: any

result

ZegoCustom

Create third-party media stream related parameter constraints

Details

This class is used to constrain the source.custom parameter of the createStream interface.

  • Use cases: Share network or local video resources.

Properties

source

source
source: HTMLMediaElement | MediaStream

Third-party source, <video> or <audio> media object or MediaStream

bitrate

bitrate
bitrate: number

Video bitrate

audioBitrate

audioBitrate
audioBitrate: number

Audio bit rate, the default is 48kbps

channelCount

channelCount
channelCount: number

Number of channels, 1 is mono, 2 is two channels, the default is mono. If you turn on the microphone collection when pulling streams on the Safari browser, the stereo effect will be lost. You need to avoid turning on the microphone when pulling streams.

startBitrate

startBitrate
startBitrate: "default" | "target"

The starting bit rate, the default is "default", environmental requirements: Google kernel browser and SDK version 2.7.0 and above. A value of "default" means to use webrtc's default start bitrate of 300kbps and then slowly increase; a value of "target" means to quickly increase to the set target bitrate.

videoOptimizationMode

videoOptimizationMode
videoOptimizationMode: "default" | "motion" | "detail"

Video optimization mode, default to "default";

A value of "motion" indicates smooth mode. In most cases, the SDK will not reduce the frame rate, but may reduce the transmission resolution.

A value of "detail" indicates clear mode. In most cases, the SDK will not reduce the transmission resolution, but may reduce the frame rate

minBitrate

minBitrate
minBitrate: number

The minimum streaming bit rate. The minimum bit rate for acceptable video quality degradation when the network is poor.

  • Use cases: If you want the video to be consistently high quality, set minBitrate to a value close to the target bitrate. Push streams that do not require high video quality can set the minBitrate to a lower value.

keyFrameInterval

keyFrameInterval
keyFrameInterval: number

The length of the video keyframe interval, in seconds.

  • Default value: 2 s.
  • Value range: [2, 6].

ZegoCustomAudio

Create third-party audio media stream related parameter constraints

Details

This class is used to constrain the parameter source.screen.video of the interface [createZegoStream], or the methods [startCaptureCustomAudio] and [startCaptureCustomVideoAndAudio] of the ZegoLocalStream instance created by [createZegoStream].

  • Use cases: Share network or local audio resources.

Properties

source

source
source: HTMLMediaElement | MediaStream

Third-party source, <video> or <audio> media object or MediaStream

channelCount

channelCount
channelCount: number

Number of channels, 1 is mono, 2 is two channels, the default is mono

ZegoCustomPlayerResourceConfig

Customized pull resource type configuration.
Supported starting from version 3.7.0.

Properties

beforePublish

beforePublish
beforePublish: 0 | 1 | 2

The resource type selected for pulling the stream before starting to push the stream. 0 means pulling traffic only from RTC; 1 means pulling traffic only from CDN; 2 means pulling traffic only from L3.

publishing

publishing
publishing: 0 | 1 | 2

The resource type selected for pull streaming during push streaming. 0 means pulling traffic only from RTC; 1 means pulling traffic only from CDN; 2 means pulling traffic only from L3.

afterPublish

afterPublish
afterPublish: 0 | 1 | 2

The resource type selected for pulling after stopping pushing. 0 means pulling traffic only from RTC; 1 means pulling traffic only from CDN; 2 means pulling traffic only from L3.

ZegoCustomVideo

Create third-party video media stream related parameter constraints

Details

This class is used to constrain the parameter source.screen.video of the interface [createZegoStream], or the methods [startCaptureCustomVideo] and [startCaptureCustomVideoAndAudio] of the ZegoLocalStream instance created by [createZegoStream].

  • Use cases: Share network or local video resources.

Properties

source

source
source: HTMLMediaElement | MediaStream

Third-party source, <video> or <audio> media object or MediaStream

optimizationMode

optimizationMode
optimizationMode: "default" | "motion" | "detail"

Video optimization mode, default to "default";

A value of "motion" indicates smooth mode. In most cases, the SDK will not reduce the frame rate, but may reduce the transmission resolution.

A value of "detail" indicates clear mode. In most cases, the SDK will not reduce the transmission resolution, but may reduce the frame rate

keyFrameInterval

keyFrameInterval
keyFrameInterval: number

The length of the video keyframe interval, in seconds.

  • Default value: 2 s.
  • Value range: [2, 6].

ZegoDataChannelEvent

DataChannel function related events.

Details

Detailed description: Describe the event name and its corresponding callback parameters. Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

receiveRealTimeSequentialData

receiveRealTimeSequentialData
receiveRealTimeSequentialData: PlayerRecvRealtimeSequentialDataCallBack

Real time data receiving update event.

ZegoDeviceInfo

Properties

deviceName

deviceName
deviceName: string

deviceID

deviceID
deviceID: string

ZegoDeviceInfos

Properties

microphones

microphones
microphones: ZegoDeviceInfo[]

speakers

speakers
speakers: ZegoDeviceInfo[]

cameras

cameras
cameras: ZegoDeviceInfo[]

ZegoEffectsBeautyParam

Basic beauty parameter options.

Properties

whitenIntensity

whitenIntensity
whitenIntensity: number

Whitening intensity, the value range is [0,100], the default value is 50.

rosyIntensity

rosyIntensity
rosyIntensity: number

Ruddy intensity, the value range is [0,100], and the default value is 50.

smoothIntensity

smoothIntensity
smoothIntensity: number

Smooth intensity, the value range is [0,100], the default value is 50.

sharpenIntensity

sharpenIntensity
sharpenIntensity: number

Sharpening intensity, the value range is [0,100], and the default value is 50.

ZegoElectronScreenSource

Properties

id

id
id: string

id

name

name
name: string

screen name

thumbnail

thumbnail
thumbnail: any

Screen shot

ZegoExpressPlayerConfig

Player plug-in initialization configuration

Properties

container

container
container: HTMLDivElement

Detailed description: Container for placing player rendering components. You can set the relevant attributes on the div tag of the specified container:

  • zg-width, the width of the player component, optional. If only the width is set, the height of the rendered component will be scaled proportionally to the video ratio.
  • zg-height, the height of the player component, optional. If only the height is set, the width of the rendered component will be scaled proportionally to the video ratio.
  • Caution: If the container is set to both width and height, and the aspect ratio of the playback video frame is inconsistent with the container settings, the playback screen will be stretched and scaled by default.
  • When to call /Trigger: Called when the player is instantiated.

mode

mode
mode: string

Playback mode currently only supports "live" mode, which is the live streaming mode.

engineType

engineType
engineType: string

Optional value, the type of engine instance passed into the SDK, optional "express" and "liveroom", if no value is passed, "express" is used by default, which means that the engine instance of express sdk is passed in for initialization. If the option "liveroom" is set, it means that the specified player plug-in is compatible with the engine instance of the liveroom sdk.

decodeType

decodeType
decodeType: string

Optional value, specifying the decoding type that the player will prefer to use for decoding. The optional value is the string "WebCodecs", "wasm" or "MSE". If no value is passed, the player will default to using the "WebCodecs" type for decoding.

The "WebCodecs" decoding type indicates a preference for using the browser's WebCodecs API for hardware decoding, which results in faster decoding rates compared to software decoding. It is important to note that this feature is only supported on PC Chrome browsers and a limited number of Chrome browsers on certain Android devices. If run on unsupported browsers, the player will automatically fallback to using wasm software decoding for playback.

The "MSE" decoding type means that the browser's MSE (Media Source Extensions) API decoding is used first. The decoding speed will be faster than the soft decoding, and the browser compatibility is better than the WebCodecs solution. It supports mobile IOS. external browser. However, compared to WebCodecs decoding and wasm decoding, the player is limited by the MSE API solution, and the quality monitoring data collected will be relatively less.

The "wasm" decoding type signifies a preference for using software decoding, but with slightly lower decoding efficiency compared to WebCodecs decoding.

When the player decodes, the default priority order of "WebCodecs hard decoding > MSE hard decoding > wasm soft decoding" is followed for decoding and playback. If the browser does not support a certain decoding method or the decoding fails midway, it will automatically fall back to the next method.

ZegoExpressPlayerError

Error message describing the player plug-in

Properties

code

code
code: number

error code

msg

msg
msg: string

Detailed error description

ZegoFontStyle

Font style.

Details

Font style configuration, can be used to configure font type, font size, font color, font transparency.

  • Use cases: Set text watermark in manual stream mixing scene, such as Co-hosting.

Properties

type

type
  • Required: False.
  • Default value: Source han sans [ZegoFontTypeSourceHanSans]

size

size
size: number
  • Required: False.
  • Default value: 24.
  • Value range: [12,100].

color

color
color: number
  • Required: False.
  • Default value: 16777215(white).
  • Value range: [0,16777215].

transparency

transparency
transparency: number
  • Required: False.
  • Default value: 0.
  • Value range: [0,100], 0 is opaque, 100 is fully transparent.

border

border
border: boolean
  • Required: False.
  • Default value: False.
  • Value range: True/False.

borderColor

borderColor
borderColor: number
  • Required: False.
  • Default value: 0.
  • Value range: [0,16777215].

ZegoLabelInfo

Label info.

Details

Font style configuration, can be used to configure font type, font si-e, font color, font transparency.

  • Use cases: Set text watermark in manual stream mixing scene, such as Co-hosting.

Properties

text

text
text: string
  • Required: True.
  • Value range: Maximum support for displaying 100 Chinese characters and 300 English characters.

left

left
left: number
  • Required: False.
  • Default value: 0.

top

top
top: number
  • Required: False.
  • Default value: 0.

font

font
  • Required: False.

ZegoLocalAduioOptions

ZegoLocalStream Media streaming audio options.

Properties

enableAutoplayDialog

enableAutoplayDialog
enableAutoplayDialog: boolean

The pop-up window for auto-play failure is enabled by default. When auto-play fails, the SDK will pop up the window to guide the user to click on the page to resume audio and video playback. Can be set to false to disable.

ZegoLocalProxyConfig

Domain name and path configuration information of the proxy server.

Details

Domain name and path configuration information of the proxy server.

Properties

accesshubProxy

accesshubProxy
accesshubProxy: string

Used to relay signaling data packets between SDK and ZEGO backend. The format is $\{domain name\}:$\{port\}/$\{path\}. The port and path are filled in as needed according to the proxy configuration.

loggerProxy

loggerProxy
loggerProxy: number

Set up a log reporting agent for troubleshooting. Please be sure to set this agent. The format is $\{domain name\}:$\{port\}/$\{path\}. The port and path are filled in as needed according to the proxy configuration.

detaillogProxy

detaillogProxy
detaillogProxy: string

Actively report to the log service, optional parameters. The format is $\{domain name\}:$\{port\}/$\{path\}. The port and path are filled in as needed according to the proxy configuration.

ZegoLocalStreamConfig

Configuration parameter constraints of the createStream interface

Details

This class is used to constrain the configuration parameters of the createStream interface.

  • Use cases: Create and preview audio and video streams.
  • Caution: Only one of the three parameters of camera, screen and custom can be filled in each time the interface createStream is called.

Properties

camera

camera
camera: ZegoCamera

Camera microphone collection stream related configuration

screen

screen
screen: boolean | ZegoScreen

custom

custom
custom: ZegoCustom

Third-party stream collection related configuration

ZegoLocalStreamEvent

A collection of events related to ZegoLocalStream.

Details

Detailed description: Describe the event name and its corresponding callback parameters. Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

autoplayFailed

autoplayFailed
autoplayFailed: (player: HTMLMediaElement) => void

Event callback after calling [playVideo] or [playAudio] playback failure.player Indicates the audio or video DOM node that plays media.

canPlayVideo

canPlayVideo
canPlayVideo: (e: Event) => void;

Triggered when the user invokes [playVideo] to start playing video.

canPlayAudio

canPlayAudio
canPlayAudio: (e: Event) => void;

Triggered when the user invokes [playAudio] to start playing audio.

autoplayCaptureFailed

autoplayCaptureFailed
autoplayCaptureFailed: (player: HTMLMediaElement) => void

Event callback that failed to play after calling [playCaptureVideo] or [playCaptureAudio]. player Indicates the audio or video DOM node that plays media.

canPlayCaptureVideo

canPlayCaptureVideo
canPlayCaptureVideo: (e: Event) => void

After the user calls [playCaptureVideo], it can be triggered when the video can start playing.

canPlayCaptureAudio

canPlayCaptureAudio
canPlayCaptureAudio: (e: Event) => void;

Triggered when the user invokes [playCaptureAudio] to start playing audio.

videoTrackChanged

videoTrackChanged
videoTrackChanged: (videoTrack: MediaStreamTrack) => void;

Detailed description: The local streaming view track update callback. The videoTrackChanged callback gets the visual track after pre-processing, while captureVideoTrackChanged gets the acquisition visual track before pre-processing.

If there is no need for special processing of audio and video rendering, it is not recommended to use this callback. It is recommended to use ZegoStreamView for rendering in most scenarios.

audioTrackChanged

audioTrackChanged
audioTrackChanged: (audioTrack: MediaStreamTrack) => void;

Detailed description: Local streaming track update callback. The audioTrackChanged callback gets the audio tracks after pre-processing, while captureAudioTrackChanged gets the audio track before pre-processing.

If there is no need for special processing of audio and video rendering, it is not recommended to use this callback. It is recommended to use ZegoStreamView for rendering in most scenarios.

captureVideoTrackChanged

captureVideoTrackChanged
captureVideoTrackChanged: (videoTrack: MediaStreamTrack) => void;

Detailed description: Local stream acquisition visual track update callback. The videoTrackChanged callback gets the visual track after pre-processing, while captureVideoTrackChanged gets the acquisition visual track before pre-processing. If there is no need for special processing of audio and video rendering, it is not recommended to use this callback. It is recommended to use ZegoStreamView for rendering in most scenarios.

captureAudioTrackChanged

captureAudioTrackChanged
captureAudioTrackChanged: (audioTrack: MediaStreamTrack) => void;

Detailed description: Local stream acquisition track update callback. The audioTrackChanged callback gets the audio tracks after pre-processing, while captureAudioTrackChanged gets the audio track before pre-processing. If there is no need for special processing of audio and video rendering, it is not recommended to use this callback. It is recommended to use ZegoStreamView for rendering in most scenarios.

ZegoLocalViewOptions

Local media streaming options.

Properties

mirror

mirror
mirror: boolean

Mirror display, true is on, false is off, the default is off.

objectFit

objectFit
objectFit: "cover" | "contain" | "fill"

Video screen display mode, "cover" is to cover the container; "contain" is to display all contents; "fill" is to stretch and fill.

enableAutoplayDialog

enableAutoplayDialog
enableAutoplayDialog: boolean

The pop-up window for auto-play failure is enabled by default. When auto-play fails, the SDK will pop up the window to guide the user to click on the page to resume audio and video playback. Can be set to false to disable.

clearLastFrame

clearLastFrame
clearLastFrame: boolean

Whether to remove the last frame when the video data is interrupted. true to clear, false to keep, the default is true.

ZegoLogConfig

Properties

logLevel

logLevel
logLevel: 'debug' | 'info' | 'warn' | 'error' | 'report' | 'disable'

Local log level, the higher the level, the fewer logs will be printed

logCount

logCount
logCount: number

Number of log files. The default is 3. The range of values is [3, 20].

logSize

logSize
logSize: number

Used to customize the maximum size of log files, with a default value of 5MB (5 * 1024 * 1024 bytes) and a minimum size of 1MB (1 * 1024 * 1024 bytes). A value of 0 indicates that no logs need to be written.

ZegoMixStreamAdvance

Properties

backgroundColor

backgroundColor
backgroundColor: number

Mixed stream background color; backgroundColor is hexadecimal RGB, and the input format must be 0xRRGGBB00. For example, pure white will pass 0xffffff00.

backgroundImage

backgroundImage
backgroundImage: string

Mixed-flow background image; backgroundImage needs to be preset in the background image ID in advance, and the input format is preset-id://xxx

videoCodec

videoCodec
videoCodec: 'VP8' | 'H264' | 'H265' | 'vp8' | 'h264' | 'h265';

Mixed-stream video encoding,'vp8' (string) or 'h264' (string), default 'h264'(string)

userData

userData
userData: Uint8Array

User-defined data, the length does not exceed 1000 bytes. After setting, the SEI content can be obtained by listening to the callback of [onPlayerRecvSEI]. that it must be created using the [ByteBuffer.allocateDirect] function, otherwise the data cannot be passed to the SDK

ZegoMixStreamConfig

Properties

taskID

taskID
taskID: string

Mixed-flow task id (customer-defined, must be unique), required, maximum 256 characters, only supports numbers, English characters and'~','!','@','#','$', ' ','^','&','*','(',')','_','+','=','-',',';',''',', ', '

inputList

inputList
inputList: ZegoMixStreamInput[]

Muxed input stream list

outputList

outputList
outputList: string[] | ZegoMixStreamOutput[]

Muxing output stream list

outputConfig

outputConfig

Mixed flow output configuration

watermark

watermark
watermark: ZegoWatermark

Mix stream watermark

enableSoundLevel

enableSoundLevel
enableSoundLevel: boolean

Enables the mixed flow sound wave callback notification, which is used to obtain the sound wave of each audio input in the mixed flow. When postmixing is enabled, the sound information of each single stream can be received through the [mixerSoundLevelUpdate] callback. Mini program streaming does not currently support the [mixerSoundLevelUpdate] callback.

streamAlignmentMode

streamAlignmentMode
streamAlignmentMode: number

Stream alignment mode, 0 means off, 1 means on.

whiteboard

whiteboard
whiteboard: ZegoMixerWhiteboard

Mixed whiteboard input info

ZegoMixStreamInput

Properties

streamID

streamID
streamID: string

Input stream ID

contentType

contentType
contentType: "VIDEO" | "AUDIO" | "VIDEO_ONLY"

Mixed stream content type; contentType value is'VIDEO' (audio and video),'AUDIO' (pure audio), "VIDEO_ONLY"(pure video),the default is'VIDEO'

layout

layout

The layout of the stream on the output canvas. When the contentType is "AUDIO", the layout parameter can not be passed.

renderMode

renderMode

Render mode, 0 for cropping mode and 1 for scaling mode.

imageInfo

imageInfo
imageInfo: ZegoMixerImageInfo

User image information.

label

label

Text watermark.

cornerRadius

cornerRadius
cornerRadius: number

Video frame corner radius, in px.

  • Required: False.
  • Value range: Does not exceed the width and height of the video screen set by the [layout] parameter.
  • Default value: 0.

soundLevelID

soundLevelID
soundLevelID: number

Mixer sound wave ID, used to find the sound wave value corresponding to the input stream in [mixerSoundLevelUpdate].

volume

volume
volume: number

Input stream volume, valid range [0, 200], default is 100.

isAudioFocus

isAudioFocus
isAudioFocus: boolean

Whether the current input stream has focus voice enabled. If enabled, the sound of this stream will be highlighted. Default value is false.

ZegoMixStreamLayout

Properties

top

top
top: number

Target location, up

left

left
left: number

Target location, left

bottom

bottom
bottom: number

Target location, down

right

right
right: number

Target location, right

ZegoMixStreamOutput

Properties

target

target
target: string

Mixed output stream ID or URL

videoConfig

videoConfig

Mixed stream output video settings.

ZegoMixStreamOutputConfig

Properties

outputBitrate

outputBitrate
outputBitrate: number

Mixed stream output video bit rate, kbps Value (Required and greater than 0)

outputFPS

outputFPS
outputFPS: number

Mixed stream output video frame rate

outputWidth

outputWidth
outputWidth: number

Mixed stream output video resolution width

outputHeight

outputHeight
outputHeight: number

Mixed stream output video resolution width...

outputAudioCodecID

outputAudioCodecID
outputAudioCodecID: 0 | 1 | 2 | 3

Mixed stream output audio encoding outputAudioCodecID optional 0: HE-AAC, 1: AAC-LC, 2: MP3, 3: OPULS; default is 0. If you use CDN to record, please select AAC-LC for audio encoding. This is because some browsers (such as Google Chrome and Microsoft Edge) are not compatible with the HE-AAC audio encoding format, causing the recorded files to fail to play.

outputAudioBitrate

outputAudioBitrate
outputAudioBitrate: number

Mixed stream output audio bit rate, kbps

outputAudioChannels

outputAudioChannels
outputAudioChannels: 1 | 2

Number of mixed stream output channels

audioMixMode

audioMixMode
audioMixMode: ZegoAudioMixMode

Multi-channel audio stream mixing mode. If [ZegoAudioMixMode] is set to [Focused], the SDK will select 4 input streams with [isAudioFocus] set as the focused voice. If no or less than 4 input streams are selected, the SDK will automatically make up to 4.

ZegoMixerAudioConfig

Mixed audio configuration

Details

Configure the audio bitrate, number of channels, and audio encoding for the streaming task

Properties

bitrate

bitrate
bitrate: number

Audio bitrate, in kbps, the default is 48 kbps, and cannot be modified after starting the mixing task

channel

channel
channel: 1 | 2

Audio channel, default is Mono

codecID

codecID

Audio Codec ID

ZegoMixerImageInfo

Set the image information of a single input stream in the mux.

Details

Sets a picture for the content of a single input stream, which is used in place of the video, i.e. the video is not displayed when the picture is used. The layout layout in [ZegoMixerInput] for image multiplexing.

  • Use cases: The developer needs to temporarily turn off the camera to display the image during the video connection to the microphone, or display the picture when the audio is connected to the microphone.
  • Available since: 2.24.0 and above.
  • Restrictions: Image size is limited to 1M.

Properties

url

url
url: string

The image path, if not empty, the image will be displayed, otherwise, the video will be displayed. JPG and PNG formats are supported. There are 2 ways to use it: 1. URI: Provide the picture to ZEGO technical support for configuration. After the configuration is complete, the picture URI will be provided, for example: preset-id://xxx.jpg. 2. URL: Only HTTP protocol is supported.

displayMode

displayMode
displayMode: number

Image display mode. 0: Default value. When the url is not empty, the video content is overwritten and the image is displayed. 1: According to the status of the camera, determine whether to display the image. The camera is turned off and the image is displayed. The camera turns on and displays the video content (without manually emptying the url parameters). 2: Judge whether to display image according to whether the input stream is empty. When the input stream was empty for 3 seconds, the image was displayed. The default time for judging empty flow is 3 seconds. If you need additional configuration, please contact ZEGO technical support. When the input stream has video data, the video content is displayed.

ZegoMixerOutputVideoConfig

Details

Configure the video parameters, encoding format, and bit rate of the mixed stream output.

  • Use cases: Manual streaming scenarios, such as live streaming with multiple people connected via microphones.

Properties

videoCodecID

videoCodecID
videoCodecID: string

Mixed stream output video encoding format, supports H.264, H.265 encoding

bitrate

bitrate
bitrate: number

The bitrate of the mixed output video, in kbps. The default value is the bitrate configured in [ZegoMixStreamOutputConfig].

encodeProfile

encodeProfile
encodeProfile: ZegoEncodeProfile

The encoding profile of the mixed stream output video. The default value is [ZegoEncodeProfileDefault].

encodeLatency

encodeLatency
encodeLatency: number

The encoding delay of the mixed stream output video, the valid value range is [0, 2000], the unit is milliseconds. The default value is 0.

enableLowBitrateHD

enableLowBitrateHD
enableLowBitrateHD: boolean

Enable high definition low code, the default value is false

ZegoOptions

This parameter is optional for ZegoExpressEngine.

Properties

scenario

scenario
scenario: ZegoScenario

room scenario

ZegoPlayAudioStats

Properties

audioBitrate

audioBitrate
audioBitrate: number

Audio bit rate

audioCodec

audioCodec
audioCodec: string

Audio encoding format "opus"

audioJitter

audioJitter
audioJitter: number

Network jitter

audioLevel

audioLevel
audioLevel: number

volume

audioPacketsLost

audioPacketsLost
audioPacketsLost: number

Number of lost packets

audioPacketsLostRate

audioPacketsLostRate
audioPacketsLostRate: number

Packet loss rate

audioQuality

audioQuality
audioQuality: number

Stream audio quality,- 1 for unknown, 0 for excellent, 1 for good, 2 for medium, 3 for poor, 4 for very poor

audioSamplingRate

audioSamplingRate
audioSamplingRate: number

Sampling Rate

muteState

muteState
muteState: "0" | "1"

Whether the audio track is turned off

audioFPS

audioFPS
audioFPS: number

Audio frame rate

audioSendLevel

audioSendLevel
audioSendLevel: number

Audio transmission energy

googCodecName

googCodecName
googCodecName: string

Audio encoding format

audioCumulativeDecodeTime

audioCumulativeDecodeTime
audioCumulativeDecodeTime: number

Detail description: The cumulative audio decoding time, in milliseconds (supported by version 2.19.0 and above).

audioCumulativeBreakTime

audioCumulativeBreakTime
audioCumulativeBreakTime: number

Detail description: The cumulative audio freeze duration, in milliseconds (supported by version 2.19.0 and above).

audioCumulativeBreakRate

audioCumulativeBreakRate
audioCumulativeBreakRate: number

Detail description: The cumulative audio freezing rate, the unit is 1, and the value range is [0,1] (supported by version 2.19.0 and above).

ZegoPlayStats

Properties

video

video

Video related description

audio

audio

Audio related description

peerToPeerDelay

peerToPeerDelay
peerToPeerDelay: number | undefined

Peer to peer delay in ms.

peerToPeerPacketLostRate

peerToPeerPacketLostRate
peerToPeerPacketLostRate: number | undefined

Peer to peer packet loss rate, unit 1. (2.13.0 and earlier versions are in %)

codecImplementationName

codecImplementationName
codecImplementationName: string

The name of the concrete implementation encoder.

currentRoundTripTime

currentRoundTripTime
currentRoundTripTime: number

The number of seconds it takes for data to be sent by this peer to the remote peer and back over the connection described by this pair of ICE candidates.

googAvailableSendBandwidth

googAvailableSendBandwidth
googAvailableSendBandwidth: string

Available bandwidth for sending video data (Field unique to Google Chrome and obsolete in new versions).

nackCount

nackCount
nackCount: number

The value indicating how many times the receiver sent a NACK packet to the sender after detecting that one or more packets were lost during transport.

pliCount

pliCount
pliCount: number

The value indicating the number of times a PLI packet was sent by the stream's receiver to the sender

sampleTimeWindow

sampleTimeWindow
sampleTimeWindow: number

Sample time window.

totalRoundTripTime

totalRoundTripTime
totalRoundTripTime: number

This value indicates the total number of seconds which have elapsed between sending out STUN connectivity and consent check requests and receiving their responses.

ZegoPlayVideoStats

Properties

frameHeight

frameHeight
frameHeight: number

Receive video high

frameWidth

frameWidth
frameWidth: number

Receive video width

googCodecName

googCodecName
googCodecName: string

Video encoding format

muteState

muteState
muteState: "0"|"1"

Whether the video track is turned off

videoBitrate

videoBitrate
videoBitrate: number

Video bitrate

videoFPS

videoFPS
videoFPS: number

Video decoding frame rate

videoPacketsLost

videoPacketsLost
videoPacketsLost: number

Video packet loss

videoPacketsLostRate

videoPacketsLostRate
videoPacketsLostRate: number

Video loss rate

videoTransferFPS

videoTransferFPS
videoTransferFPS: number

Video receiving frame rate

videoQuality

videoQuality
videoQuality: number

Video quality, 1 for unknown, 0 for excellent, 1 for good, 2 for medium, 3 for poor, 4 for very poor

videoFramesDecoded

videoFramesDecoded
videoFramesDecoded: number

Total video decoding size

videoFramesDropped

videoFramesDropped
videoFramesDropped: number

The current actual received video frame loss

videoCumulativeDecodeTime

videoCumulativeDecodeTime
videoCumulativeDecodeTime: number

Cumulative video decoding time, in milliseconds (supported by version 2.19.0 and above).

videoCumulativeBreakTime

videoCumulativeBreakTime
videoCumulativeBreakTime: number

Detail description: Cumulative video freeze duration, in milliseconds (supported by version 2.19.0 and above)

videoCumulativeBreakRate

videoCumulativeBreakRate
videoCumulativeBreakRate: number

Detail description: Cumulative video freeze rate, unit is percentage, 0.0 ~ 1.0 (supported by version 2.9.0 and above)

ZegoPlayerState

player state

Properties

streamID

streamID
streamID: string

Stream ID

state

state
state: 'NO_PLAY' | 'PLAY_REQUESTING' | 'PLAYING'

NO_PUBLISH: not playing state, PLAY_REQUESTING: requesting play state, PLAYING: playing state

errorCode

errorCode
errorCode: number

error code

extendedData

extendedData
extendedData: string

Extended Information

ZegoProxyInfo

Proxy information.

Details

Configure proxy information.

Properties

hostName

hostName
hostName: string

domain name. Under cloud proxy: Proxy domain name provided by ZEGO.

port

port
port: number

Proxy service port number.

ZegoPublishAudioStats

Properties

audioBitrate

audioBitrate
audioBitrate: number

Audio bit rate

audioCodec

audioCodec
audioCodec: string

Audio encoding format

audioPacketsLost

audioPacketsLost
audioPacketsLost: number

Audio packet loss

audioPacketsLostRate

audioPacketsLostRate
audioPacketsLostRate: number

Audio packet loss rate

googCodecName

googCodecName
googCodecName: string

Audio encoding format

muteState

muteState
muteState: '0' | '1'

Whether the audio track is turned off

audioFPS

audioFPS
audioFPS: number

Audio frame rate

audioQuality

audioQuality
audioQuality: number

audio quality, - 1 for unknown, 0 for excellent, 1 for good, 2 for medium, 3 for poor, 4 for very poor

ZegoPublishStats

Properties

video

video

Push streaming video data

audio

audio

Push streaming audio data

codecImplementationName

codecImplementationName
codecImplementationName: string

The name of the concrete implementation encoder.

currentRoundTripTime

currentRoundTripTime
currentRoundTripTime: number

The number of seconds it takes for data to be sent by this peer to the remote peer and back over the connection described by this pair of ICE candidates.

googActualEncBitrate

googActualEncBitrate
googActualEncBitrate: string

The actual output bit rate of the video encoder(Field unique to Google Chrome and obsolete in new versions).

googAvailableSendBandwidth

googAvailableSendBandwidth
googAvailableSendBandwidth: string

Available bandwidth for sending video data(Field unique to Google Chrome and obsolete in new versions).

googBandwidthLimitedResolution

googBandwidthLimitedResolution
googBandwidthLimitedResolution: string

Whether to reduce the video resolution sent due to limited bandwidth(Field unique to Google Chrome and obsolete in new versions).

googCpuLimitedResolution

googCpuLimitedResolution
googCpuLimitedResolution: string

Whether to reduce the sent video resolution due to insufficient CPU (Field unique to Google Chrome and obsolete in new versions).

googFrameHeightInput

googFrameHeightInput
googFrameHeightInput: string

Set height of sender resolution (Field unique to Google Chrome and obsolete in new versions).

googFrameRateInput

googFrameRateInput
googFrameRateInput: string

The initial frame rate set by the sender (Field unique to Google Chrome and obsolete in new versions).

googFrameWidthInput

googFrameWidthInput
googFrameWidthInput: string

Set width of sender resolution (Field unique to Google Chrome and obsolete in new versions).

googTargetEncBitrate

googTargetEncBitrate
googTargetEncBitrate: string

Target bitrate for video encoding (Field unique to Google Chrome and obsolete in new versions).

muted

muted
muted: boolean

Whether to mute.

nackCount

nackCount
nackCount: number

The value indicating how many times the receiver sent a NACK packet to the sender after detecting that one or more packets were lost during transport.

paused

paused
paused: boolean

Pause or not

pliCount

pliCount
pliCount: number

The value indicating the number of times a PLI packet was sent by the stream's receiver to the sender

qualityLimitationReason

qualityLimitationReason
qualityLimitationReason: string

Reasons for limiting flow quality.

sinkId

sinkId
sinkId: string

ID of the output audio device

totalRoundTripTime

totalRoundTripTime
totalRoundTripTime: number

This value indicates the total number of seconds which have elapsed between sending out STUN connectivity and consent check requests and receiving their responses.

volume

volume
volume: number

The value of volume.

ZegoPublishStreamAudioConfig

Properties

ANS

ANS
ANS: boolean

Whether to turn on noise reduction

AGC

AGC
AGC: boolean

Whether to enable automatic gain

AEC

AEC
AEC: boolean

Whether to enable echo cancellation

ZegoPublishStreamConfig

Properties

width

width
width: number | ConstraintExtend

wide resolution

height

height
height: number | ConstraintExtend

High resolution

frameRate

frameRate
frameRate: number | ConstraintExtend

frameRate

maxBitrate

maxBitrate
maxBitrate: number

max bitrate

videoQuality

videoQuality
videoQuality: number

video quality level, default level is 2

ZegoPublishVideoStats

Properties

frameHeight

frameHeight
frameHeight: number

Capture video high

frameWidth

frameWidth
frameWidth: number

Capture video width

googCodecName

googCodecName
googCodecName: string

Video encoding format

muteState

muteState
muteState: "0"|"1"

Whether the video track is turned off

videoBitrate

videoBitrate
videoBitrate: number

Video bitrate

videoFPS

videoFPS
videoFPS: number

Video encoding frame rate

videoPacketsLost

videoPacketsLost
videoPacketsLost: number

Video packet loss

videoPacketsLostRate

videoPacketsLostRate
videoPacketsLostRate: number

Video loss rate

videoTransferFPS

videoTransferFPS
videoTransferFPS: number

Video sending frame rate

videoQuality

videoQuality
videoQuality: number

video quality, - 1 for unknown, 0 for excellent, 1 for good, 2 for medium, 3 for poor, 4 for very poor

isHardwareEncode

isHardwareEncode
isHardwareEncode: boolean

Whether to enable hard coding, true is on, false is off, undefined is unknown.

ZegoPublisherState

Publisher state

Properties

streamID

streamID
streamID: string

Stream ID

state

state
state: 'PUBLISHING' | 'NO_PUBLISH' | 'PUBLISH_REQUESTING'

NO_PUBLISH: not pushing state, PUBLISH_REQUESTING: requesting push state, PUBLISHING: pushing state

errorCode

errorCode
errorCode: number

error code

extendedData

extendedData
extendedData: string

Extended Information

ZegoRTCEvent

Media service related events

Details

Detailed description: Describe the event name and its corresponding callback parameters.

Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

publishQualityUpdate

publishQualityUpdate
publishQualityUpdate: PublishQualityUpdateCallBack

Push stream quality callback

publisherStateUpdate

publisherStateUpdate
publisherStateUpdate: PublisherStateUpdateCallBack

Push stream status callback

screenSharingEnded

screenSharingEnded
screenSharingEnded: ScreenSharingEndedCallBack

Screen sharing interrupt callback

playQualityUpdate

playQualityUpdate
playQualityUpdate: PlayQualityUpdateCallBack

Pull stream quality callback, each callback interval is 3s

streamExtraInfoUpdate

streamExtraInfoUpdate
streamExtraInfoUpdate: StreamExtraInfoUpdateCallBack

Receive additional stream information set by the peer

playerStateUpdate

playerStateUpdate
playerStateUpdate: PlayerStateUpdateCallBack

Pull stream status callback

remoteCameraStatusUpdate

remoteCameraStatusUpdate
remoteCameraStatusUpdate: RemoteCameraStatusUpdateCallBack

Trigger when the remote camera is changed

remoteMicStatusUpdate

remoteMicStatusUpdate
remoteMicStatusUpdate: RemoteMicStatusUpdateCallBack

Trigger when the remote microphone state of the soil flow

soundLevelUpdate

soundLevelUpdate
soundLevelUpdate: SoundLevelUpdateCallBack

Sound wave callback

videoDeviceStateChanged

videoDeviceStateChanged
videoDeviceStateChanged: videoDeviceStateChangedCallBack

Monitoring video device status change

audioDeviceStateChanged

audioDeviceStateChanged
audioDeviceStateChanged: audioDeviceStateChangedCallBack

Monitoring audio device status change

deviceError

deviceError
deviceError: deviceErrorCallBack

 abnormal monitoring device

capturedSoundLevelUpdate

capturedSoundLevelUpdate
capturedSoundLevelUpdate: CapturedSoundLevelUpdateCallBack

Locally collected audio sound level callback

playerRecvSEI

playerRecvSEI
playerRecvSEI: PlayerRecvSEICallBack

beautyEffectError

beautyEffectError
beautyEffectError: BeautyEffectErrorCallBack

An abnormal error occurred in the beauty function.

roomStreamUpdate

roomStreamUpdate
roomStreamUpdate: RoomStreamUpdateCallBack

Notifications of increased or decreased streams pushed by other users in the same room.

exceptionUpdate

exceptionUpdate
web exceptionUpdate: ExceptionUpdateCallBack

Listen to the notification of the exception or return to normal event of the acquisition encoding decoding of the push and pull stream.

The collection page is stopped or the shared page has no audio. Therefore, you are not advised to use the exceptionUpdate data as reference.

networkQuality

networkQuality
web networkQuality: NetworkQualityCallBack

The network quality callback for the in-room user who is pushing streams

mixerSoundLevelUpdate

mixerSoundLevelUpdate
mixerSoundLevelUpdate: MixerSoundLevelUpdateCallBack

Sound update notification for each single stream in the a mixed stream.

autoMixerSoundLevelUpdate

autoMixerSoundLevelUpdate
autoMixerSoundLevelUpdate: AutoMixerSoundLevelUpdateCallBack

Sound update notification for each single stream in the automatic mixed stream.

backgroundEffectError

backgroundEffectError
backgroundEffectError: BackgroundEffectErrorCallBack

An abnormal error occurred in background process.

recvExperimentalAPI

recvExperimentalAPI
recvExperimentalAPI: RecvExperimentalAPICallBack

Experimental API callbacks

mixerRelayCDNStateUpdate

mixerRelayCDNStateUpdate
mixerRelayCDNStateUpdate: MixerRelayCDNStateUpdateCallBack

Mixed streaming and forwarding CDN status callback

playerVideoTrackUpdate

playerVideoTrackUpdate
playerVideoTrackUpdate: PlayerTrackUpdateCallBack

Triggered when the viewport of the stream changes.

playerAudioTrackUpdate

playerAudioTrackUpdate
playerAudioTrackUpdate: PlayerTrackUpdateCallBack

Triggered when the streamed audio track changes.

publisherVideoEncoderChanged

publisherVideoEncoderChanged
publisherVideoEncoderChanged: PublisherVideoEncoderChangedCallBack

push stream encoding update callback.

  • Use cases: when push flow set up enableAutoSwitchVideoCodec to true and internal coding switch is triggered when happened.

Methods

BackgroundEffectErrorCallBack

BackgroundEffectErrorCallBack
BackgroundEffectErrorCallBack(stream: MediaStream, errorCode: number, extendedData: string): void
Events are triggered when abnormal errors occur in background blur and virtual functions.
NameTypeDescription
streamMediaStreamEnable the media stream object corresponding to the background blur and virtual functions.
errorCodenumbererror code.
extendedDatastringError description information.

MixerRelayCDNStateUpdateCallBack

MixerRelayCDNStateUpdateCallBack
MixerRelayCDNStateUpdateCallBack(taskID: string, infoList: Array<ZegoStreamRelayCDNInfo>): void
Mixed streaming and retweeting CDN status update notification.
NameTypeDescription
taskIDstringmixer task ID
infoListArray<ZegoStreamRelayCDNInfo>A list of information about the current CDN mixing.

RecvExperimentalAPICallBack

RecvExperimentalAPICallBack
RecvExperimentalAPICallBack(content: Object): void
Receive experimental API callbacks, please use this feature with the help of ZEGO Technical Support
NameTypeDescription
contentObjectThe content of the callback, JSON Object.

ExceptionUpdateCallBack

ExceptionUpdateCallBack
ExceptionUpdateCallBack(streamID: string, eventData: ExceptionData): void
Push and pull flow collection, encoding and decoding abnormal event or normal event callback
NameTypeDescription
streamIDstringStream ID
eventDataExceptionData

PlayerRecvSEICallBack

PlayerRecvSEICallBack
PlayerRecvSEICallBack(streamID: string, data: Uint8Array): void
Receive the SEI content of the remote stream<br/>After the stream is pulled successfully, when the remote stream calls sendSEI, the local end will receive this callback<br/>If you only pull the pure audio stream, you will not receive the SEI information sent by the streaming end
NameTypeDescription
streamIDstringstreamID
dataUint8ArraySEI content

BeautyEffectErrorCallBack

BeautyEffectErrorCallBack
BeautyEffectErrorCallBack(stream: MediaStream, errorCode: number, extendedData: string): void
The event is triggered when an abnormal error occurs in the beauty function.
NameTypeDescription
streamMediaStreamEnable the media stream object corresponding to the beauty function.
errorCodenumbererror code.
extendedDatastringError description information.

PublishQualityUpdateCallBack

PublishQualityUpdateCallBack
PublishQualityUpdateCallBack(streamID: string, stats: ZegoPublishStats): void
Subscribe to push quality callback

Parameters

NameTypeDescription
streamIDstringPush Stream ID
statsZegoPublishStatsPush streaming quality description

Details

Detailed description: Subscription push quality callback

Trigger condition: after successful push

Limit frequency: None

Follow callback: None

Important reminder: Call back every 3 seconds

Supported version: 1.0.0

Obsolete time: None

PublisherStateUpdateCallBack

PublisherStateUpdateCallBack
PublisherStateUpdateCallBack(result: ZegoPublisherState): void
Push stream status callback

Parameters

NameTypeDescription
resultZegoPublisherStatePublisher state

Details

Detailed description: State notification of push streaming, push streaming is an asynchronous process, and the state switching in the middle is called back through this interface. Listen to the callback, collect error logs if the retry still fails, and remind the customer

Trigger condition: After starting to push

Limit frequency: None

Follow callback: None

Important reminder: Must listen before pushing

Supported version: 1.0.0

Obsolete time: None

ScreenSharingEndedCallBack

ScreenSharingEndedCallBack
ScreenSharingEndedCallBack(mediaStream: MediaStream): void
Screen sharing interrupt callback

Parameters

NameTypeDescription
mediaStreamMediaStreamThe stream object obtained by creating the screen sharing stream

Details

Detailed description: Monitor the passive shutdown of the screen sharing stream caused by clicking the system stop button, or closing the capture process, etc.

Trigger condition: After screen sharing, click the system to stop or close the capture process, etc.

Limit frequency: None

Important reminder: Must listen before screen sharing

Supported version: 1.0.0

Obsolete time: None

NetworkQualityCallBack

NetworkQualityCallBack
NetworkQualityCallBack(userID: string, upstreamQuality: QualityGrade, downstreamQuality: QualityGrade): void
Network quality callback of users who are streaming in the room.

Parameters

NameTypeDescription
userIDstringUser ID. The value of the local user is null. The value of the peer user is not null.
upstreamQualityQualityGradeThe uplink network quality level ranges from 0 to 4, from good to bad, and -1 is unknown.
downstreamQualityQualityGradeThe downstream network quality level ranges from 0 to 4, from good to bad, and -1 is unknown.

Details

Detailed description: The network quality callback of the user who is streaming in the room.

Trigger condition: The streaming quality starts updating.

Limit frequency: None

Important reminder: Need to bind before push pull flow.

Supported version: 2.24.0

Obsolete time: None

MixerSoundLevelUpdateCallBack

MixerSoundLevelUpdateCallBack
MixerSoundLevelUpdateCallBack(soundLevels: Map<number, number>): void
Sound update notification for each single stream in the mixed stream.

Parameters

NameTypeDescription
soundLevelsMap<number, number>The sound key-value pair of each single stream in the mixed flow, the key is the soundLevelID of each single stream, and the value is the sound value of the corresponding single stream. Value range: The value range of value is 0.0 ~ 100.0.

Details

Detailed description: The network quality callback of the user who is streaming in the room.

scene: Mixed streaming is often used when multiple video frames need to be combined into one video, such as in education, live broadcasting of teachers and students.

Caoutions: This feature requires contacting technical support to enable the corresponding feature configuration on the mixed stream server.

Supported version: 3.0.0

Obsolete time: None

AutoMixerSoundLevelUpdateCallBack

AutoMixerSoundLevelUpdateCallBack
AutoMixerSoundLevelUpdateCallBack(soundLevels: soundLevels: Map<string, number>): void
Sound update notification for each single stream in the automatic mixed stream.

Parameters

NameTypeDescription
soundLevelssoundLevels: Map<string, number>The sound key-value pair of each single stream in the mixed stream. The key is the streamID of each single stream, and the value is the sound value of the corresponding single stream. The value range is 0.0 ~ 100.0.

Details

Detailed description: The network quality callback of the user who is streaming in the room.

scene: Mixed streaming is often used when multiple video frames need to be combined into one video, such as in education, live broadcasting of teachers and students.

Cautions: This function requires contacting ZEGO technical support to activate the corresponding function configuration of the mixed-stream server.

Supported version: 3.0.0

Obsolete time: None

RoomStreamUpdateCallBack

RoomStreamUpdateCallBack
RoomStreamUpdateCallBack(roomID: string, updateType: 'DELETE' | 'ADD', streamList: ZegoStreamList[], extendedData: string): void
Monitor the changes of the stream in the logged-in room (add, delete)

Parameters

NameTypeDescription
roomIDstring
updateType'DELETE' | 'ADD'DELETE: stream deletion, ADD: stream addition
streamListZegoStreamList[]Update the list of streams, the array order is sorted by the time received by the server.
extendedDatastringextended data

Details

Detailed description: monitor the changes of the stream in the logged-in room (add, delete)

Trigger condition: Add or delete stream in the room

Limit frequency: None

Important note: need to be called before logging in to the room

Supported version: 1.0.0

Obsolete time: None

PlayQualityUpdateCallBack

PlayQualityUpdateCallBack
PlayQualityUpdateCallBack(streamID: string, stats: ZegoPlayStats): void
Pull stream quality callback, start to trigger after pulling stream successfully

Parameters

NameTypeDescription
streamIDstringStream ID
statsZegoPlayStatsPull stream quality callback information

Details

Detailed description: Subscription pull quality callback

Trigger condition: after successful pull

Limit frequency: None

Follow callback: None

Important reminder: Call back every 3 seconds

Supported version: 1.0.0

Obsolete time: None

StreamExtraInfoUpdateCallBack

StreamExtraInfoUpdateCallBack
StreamExtraInfoUpdateCallBack(roomID: string, streamList: { streamID: string; user: ZegoUser; extraInfo: string }[]): void
Callback when the stream attached message changes

Parameters

NameTypeDescription
roomIDstringRoom ID
streamList{ streamID: string; user: ZegoUser; extraInfo: string }[]Flow information

Details

Detailed description: Receive additional stream information set by the peer

Trigger condition: stream additional message update

Supported version: 1.0.0

Obsolete time: None

PlayerStateUpdateCallBack

PlayerStateUpdateCallBack
PlayerStateUpdateCallBack(result: ZegoPlayerState): void
Call back when the streaming status changes

Parameters

NameTypeDescription
resultZegoPlayerStatePull state result

Details

Detailed description: State notification of pull streaming, pull streaming is an asynchronous process, and the state switching in the middle is called back through this interface. Listen to the callback, collect error logs if the retry still fails, and remind the customer

Trigger condition: After starting to pull

Limit frequency: None

Follow callback: None

Important reminder: Must listen before pulling

Supported version: 1.0.0

Obsolete time: None

RemoteMicStatusUpdateCallBack

RemoteMicStatusUpdateCallBack
RemoteMicStatusUpdateCallBack(streamID: string, status: 'OPEN' | 'MUTE'): void
Pull stream microphone status callback
NameTypeDescription
streamIDstringStream ID
status'OPEN' | 'MUTE'The microphone status of the pulled stream'OPEN' means open'MUTE' means closed

SoundLevelUpdateCallBack

SoundLevelUpdateCallBack
SoundLevelUpdateCallBack(soundLevelList: ZegoSoundLevelInfo[]): void
Push-pull stray sound wave callback, this interface is currently not compatible with safari
NameTypeDescription
soundLevelListZegoSoundLevelInfo[]Sound wave information list, including current ID, sound wave size, and current status

PlayerTrackUpdateCallBack

PlayerTrackUpdateCallBack
PlayerTrackUpdateCallBack(streamID: string, track: MediaStreamTrack): void
Pull stream camera status callback
NameTypeDescription
streamIDstringStream ID
trackMediaStreamTrackThe audio track or video track on the stream corresponding to streamID.

PublisherVideoEncoderChangedCallBack

PublisherVideoEncoderChangedCallBack
PublisherVideoEncoderChangedCallBack(fromCodecID: ZegoVideoCodecID, toCodecID: ZegoVideoCodecID, streamID: string): void
Publish stream video encoding update callback.
NameTypeDescription
fromCodecIDZegoVideoCodecIDRaw video coding
toCodecIDZegoVideoCodecIDThe changed video encoding
streamIDstringStream ID

RemoteCameraStatusUpdateCallBack

RemoteCameraStatusUpdateCallBack
RemoteCameraStatusUpdateCallBack(streamID: string, status: 'OPEN' | 'MUTE' ): void
Pull stream camera status callback
NameTypeDescription
streamIDstringStream ID
status'OPEN' | 'MUTE'The state of the camera being pulled.'OPEN' means open and'MUTE' means closed

videoDeviceStateChangedCallBack

videoDeviceStateChangedCallBack
videoDeviceStateChangedCallBack(updateType: 'DELETE' | 'ADD', deviceInfo: { deviceName: string; deviceID: string; }): void
Video device status change update callback

Parameters

NameTypeDescription
updateType'DELETE' | 'ADD''delete 'means that the device is removed and' Add 'indicates that the device is added
deviceInfo{ deviceName: string; deviceID: string; }Device information, devicename is device name, deviceid is device ID

Details

Detailed description: This callback is triggered when a video device is added or removed from the system. By monitoring this callback, users can update when necessary to use specific equipment for video capture

Trigger condition: Triggered when a video device is added or removed

Limit frequency: None

Follow callback: None

Important reminder: The callback can be triggered only after the browser authorizes the microphone and camera; Due to device and browser limitations, some browsers may not trigger this callback when using certain devices

Supported version: 1.16.0

Obsolete time: None

audioDeviceStateChangedCallBack

audioDeviceStateChangedCallBack
audioDeviceStateChangedCallBack(updateType: 'DELETE' | 'ADD', deviceType: 'Input' | 'Output', deviceInfo: {deviceName: string; deviceID: string; }): void
audio device status change callback

Parameters

NameTypeDescription
updateType'DELETE' | 'ADD''delete 'indicates that the device is deleted and' Add 'indicates that the device is added
deviceType'Input' | 'Output''input' means input device and 'output' refers to output device
deviceInfo{deviceName: string; deviceID: string; }device information

Details

Detailed description: This callback is triggered when a audio device is added or removed from the system. By monitoring this callback, users can update when necessary to use specific equipment for audio capture

Trigger condition: Triggered when a video device is added or removed

Limit frequency: None

Follow callback: None

Important reminder: The callback can be triggered only after the browser authorizes the microphone and camera; Due to device and browser limitations, some browsers may not trigger this callback when using certain devices

Supported version: 1.16.0

Obsolete time: None

deviceErrorCallBack

deviceErrorCallBack
deviceErrorCallBack(errorCode: number, deviceName: string): void
Device exception callback

Parameters

NameTypeDescription
errorCodenumbererror code
deviceNamestringThe name of the device where the exception occurred

Details

Detailed description: This callback is triggered when the local audio or video device reads and writes abnormally

Trigger condition: When the audio and video equipment used for streaming is abnormal (such as loose), it is triggered

Limit frequency: None

Follow callback: None

Important reminder: It may be triggered after streaming; Due to device and browser limitations, some browsers may not trigger this callback when using certain devices

Supported version: 1.16.0

Obsolete time: None

CapturedSoundLevelUpdateCallBack

CapturedSoundLevelUpdateCallBack
CapturedSoundLevelUpdateCallBack(soundLevel: number): void
Local collected audio sound level callback, this interface is currently not compatible with safari.
NameTypeDescription
soundLevelnumberThe locally collected sound level value ranges from 0.0 to 100.0.

ZegoRTMEvent

Signaling service related events

Details

Detailed description: Describe the event name and its corresponding callback parameters.

Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

roomUserUpdate

roomUserUpdate
roomUserUpdate: RoomUserUpdateCallBack

The callback triggered when the room users change

roomStateUpdate

roomStateUpdate
roomStateUpdate: RoomStateUpdateCallBack

The callback triggered when the connection status between the room and the server changes,roomstatechanged is recommended for versions 2.16.0 and above.

roomOnlineUserCountUpdate

roomOnlineUserCountUpdate
roomOnlineUserCountUpdate: RoomOnlineUserCountUpdateCallBack

Triggered when the number of people in the room changes

IMRecvBroadcastMessage

IMRecvBroadcastMessage
IMRecvBroadcastMessage: IMRecvBroadcastMessageCallBack

Room news notification

IMRecvBarrageMessage

IMRecvBarrageMessage
IMRecvBarrageMessage: IMRecvBarrageMessageCallBack

Room barrage notification

IMRecvCustomCommand

IMRecvCustomCommand
IMRecvCustomCommand: IMRecvCustomCommandCallBack

Custom signaling notification

roomExtraInfoUpdate

roomExtraInfoUpdate
roomExtraInfoUpdate: roomExtraInfoUpdateCallBack

Monitor additional message notifications in the room

tokenWillExpire

tokenWillExpire
tokenWillExpire: tokenWillExpireCallBack

It will be triggered when the token expires less than 30s

roomStateChanged

roomStateChanged
roomStateChanged: RoomStateChangedCallBack

when the connection state of the room changes, this callback is triggered and the reason for the change is notified. In version 2.16.0 and above, it is recommended to use onroomstatechanged callback instead of onroomstateupdate callback to monitor room state changes.

  • Use cases: the developer can use this callback to judge the status of the current user in the room. Developers will receive this notification when calling room related functions (refer to "related interfaces"). You may also receive this notification when the network condition of the user equipment changes (SDK will automatically log in to the room again when the line is disconnected. For details, please refer to https://doc-zh.zego.im/faq?product=ExpressVideo&platform=web )。
  • Caution: if the connection is being requested for a long time, it is generally caused by the instability of the client network.
  • Privacy reminder: remind users not to introduce sensitive information about personal privacy to some parameters (such as userName, userID), including but not limited to mobile phone number, ID number, passport number, real name, etc.

recvRoomTransparentMessage

recvRoomTransparentMessage
recvRoomTransparentMessage: RecvRoomTransparentMessageCallBack

This callback is used to receive transparent messages sent by other users in the same room.

Notification Timing

calling [loginRoom] to log in to the room, this callback is triggered if a user in the room sends a message intended for a specific client using the [sendTransparentMessage] function.

  • Required: 3.11.0 and above.
  • Caution: Messages sent by the user themselves will not be notified through this callback. If [sendTransparentMessage] is specified to only trigger a server-side callback, this callback will not be triggered.

Methods

RoomUserUpdateCallBack

RoomUserUpdateCallBack
RoomUserUpdateCallBack(roomID: string, updateType: 'DELETE' | 'ADD', userList: ZegoUser[]): void

Parameters

NameTypeDescription
roomIDstringID of the room where the user changed
updateType'DELETE' | 'ADD'User behavior, DELETE means leaving, ADD means entering
userListZegoUser[]The specific information of the changed user

Details

Detailed description: The current login room, if the user is added, deleted, etc., trigger a callback to notify the current user

Trigger condition: other users log in, trigger when launch

Limit frequency: None

Follow callback: None

Important reminder: The trigger premise is that when logging in, the user update is set to follow, that is, the userUpdate of the parameter config of loginRoom is set to true

Supported version: 1.0.0

Obsolete time: None

RoomStateUpdateCallBack

RoomStateUpdateCallBack
RoomStateUpdateCallBack(roomID: string, state: 'DISCONNECTED' | 'CONNECTING' | 'CONNECTED', errorCode: number, extendedData: string): void
Room status update callback

Parameters

NameTypeDescription
roomIDstringRoom ID
state'DISCONNECTED' | 'CONNECTING' | 'CONNECTED'DISCONNECTED: Log out of the room or the room is disconnected from the server, and it still fails after retrying.
CONNECTING: Disconnect and start reconnecting.
CONNECTED: Login Room Success or Reconnect successfully.
errorCodenumberSpecific error code when disconnected
extendedDatastringExtended Information

Details

Detailed description: Room connection state callback, state is'DISCONNECTED','CONNECTING','CONNECTED' respectively

Trigger condition: Triggered by logging into the room, logging out of the room, or disconnecting from the network and reconnecting.

Limit frequency: None

Important reminder: Register before logging in to receive a callback,roomstatechanged is recommended for versions 2.16.0 and above

Supported version: 1.0.0

Obsolete time: None

RoomStateChangedCallBack

RoomStateChangedCallBack
RoomStateChangedCallBack(roomID: string, reason: ZegoRoomStateChangedReason, errorCode: number, extendedData: string): void
Room status changed callback

Parameters

NameTypeDescription
roomIDstringRoom ID
reasonZegoRoomStateChangedReasonroom state changed reason
errorCodenumberSpecific error code when disconnected
extendedDatastringExtended Information

Details

Detailed description: Room connection state callback, state is 'LOGINING','LOGINED','LOGIN_FAILED','RECONNECTING','RECONNECTED','RECONNECT_FAILED','KICKOUT','LOGOUT','LOGOUT_FAILED'

Trigger condition: Triggered when disconnecting, retrying and reconnecting successfully

Limit frequency: None

Important reminder: Register before logging in to receive a callback

Supported version: 2.16.0

Obsolete time: None

RoomOnlineUserCountUpdateCallBack

RoomOnlineUserCountUpdateCallBack
RoomOnlineUserCountUpdateCallBack(roomID: string, count: number): void
Call back the number of current online users in the room

Parameters

NameTypeDescription
roomIDstringID of the room where the user changed
countnumberNumber of current online users

Details

Detailed description: Call back the number of online people in the current room

Trigger condition: Triggered when other users log in, Call back every 30 seconds

Limit frequency:

Important reminder: None

Supported version: 1.11.0

Obsolete time: None

IMRecvBroadcastMessageCallBack

IMRecvBroadcastMessageCallBack
IMRecvBroadcastMessageCallBack(roomID: string, chatData: ZegoBroadcastMessageInfo[]): void
Room news notification
NameTypeDescription
roomIDstringRoom ID
chatDataZegoBroadcastMessageInfo[]Room news

IMRecvBarrageMessageCallBack

IMRecvBarrageMessageCallBack
IMRecvBarrageMessageCallBack(roomID: string, messageInfo: ZegoBarrageMessageInfo[]): void
Room barrage notification
NameTypeDescription
roomIDstringRoomID
messageInfoZegoBarrageMessageInfo[]Barrage message information

IMRecvCustomCommandCallBack

IMRecvCustomCommandCallBack
IMRecvCustomCommandCallBack(roomID: string, fromUser: ZegoUser, command: string): void
Custom signaling notification
NameTypeDescription
roomIDstringRoom ID
fromUserZegoUserSend message user information
commandstringCustom message received

RecvRoomTransparentMessageCallBack

RecvRoomTransparentMessageCallBack
RecvRoomTransparentMessageCallBack(roomID: string, message: ZegoRoomRecvTransparentMessage): void
Transparent message notification
NameTypeDescription
roomIDstringRoom ID
messageZegoRoomRecvTransparentMessageReceive the transparent message from the room

roomExtraInfoUpdateCallBack

roomExtraInfoUpdateCallBack
roomExtraInfoUpdateCallBack(roomID: string, roomExtraInfoList: ZegoRoomExtraInfo[]): void
Room extra message update callback
NameTypeDescription
roomIDstringroom ID
roomExtraInfoListZegoRoomExtraInfo[]List of the extra info updated.

tokenWillExpireCallBack

tokenWillExpireCallBack
tokenWillExpireCallBack(roomID: string): void

Parameters

NameTypeDescription
roomIDstringThe ID of the room where the token will expire

Details

Detailed description: the token will expire notification, please take the initiative to call renewToken to update the token after receiving the notification

Trigger condition: The callback is triggered 30s before the expiration time contained in the token

Limit frequency: None

Pay attention to the interface: renewToken

Important reminder: The token expiration time is taken from the token, please make sure that the server time that generates the token is accurate

Supported version: 2.6.0

Obsolete time: None

ZegoRangeAudioEvent

Range Audio function related events.

Details

Detailed description: Describe the event name and its corresponding callback parameters. Business scenario: Used to constrain the parameters of the registration event interface on and the deregistration event interface off.

Properties

microphoneStateUpdate

microphoneStateUpdate
microphoneStateUpdate: MicrophoneStateUpdateCallBack

Microphone status update event.

publishQualityUpdate

publishQualityUpdate

Audio sending quality.

playQualityUpdate

playQualityUpdate

Audio reception quality.

aiDenoiseError

aiDenoiseError
aiDenoiseError: AiDenoiseErrorCallBack

AI noise reduction function error callback.

audioSourceWithinRangeUpdate

audioSourceWithinRangeUpdate
audioSourceWithinRangeUpdate: AudioSourceWithinRangeUpdateCallBack

List callbacks in scope

Methods

AudioSourceWithinRangeUpdateCallBack

AudioSourceWithinRangeUpdateCallBack
AudioSourceWithinRangeUpdateCallBack(userID: string, position: number[]): void
Description: user in range callback.
NameTypeDescription
userIDstringuserID
positionnumber[]position info

MicrophoneStateUpdateCallBack

MicrophoneStateUpdateCallBack
MicrophoneStateUpdateCallBack(state: ZegoRangeAudioMicrophoneState, errorCode: number, extendedData?: string): void
Microphone and audio uplink status update callback

Parameters

NameTypeDescription
stateZegoRangeAudioMicrophoneStateMicrophone update status
errorCodenumberError code
extendedDatastringDescription information

Details

Detailed description: Notification of the upstream status of the microphone and audio. Turning on sending audio is an asynchronous process, and the state switching in the middle is called back through this interface.

Trigger condition: call the enableMicrophone interface of ZegoExpressRangeAudio.

Important reminder: You must listen before the enableMicrophone interface is called.

Supported version: 2.10.0

RangeAudioPlayQualityUpdateCallBack

RangeAudioPlayQualityUpdateCallBack
RangeAudioPlayQualityUpdateCallBack(userID: string, stats: RangeAudioPlayStats): void
Audio reception quality.

Parameters

NameTypeDescription
userIDstringUser ID.
statsRangeAudioPlayStatsA collection of indicators related to audio reception quality.

Details

Detailed description: Quality notification for audio downstream.

Trigger condition: call the enableMicrophone interface of ZegoExpressRangeAudio.

Supported version: 2.20.0

RangeAudioPublishQualityUpdateCallBack

RangeAudioPublishQualityUpdateCallBack
RangeAudioPublishQualityUpdateCallBack(userID: string, stats: RangeAudioPublishStats): void
Audio sending quality.

Parameters

NameTypeDescription
userIDstringUser ID.
statsRangeAudioPublishStatsA collection of indicators related to audio transmission quality.

Details

Detailed description: Quality notification for audio upstream.

Trigger condition: call the enableMicrophone interface of ZegoExpressRangeAudio.

Supported version: 2.20.0

AiDenoiseErrorCallBack

AiDenoiseErrorCallBack
AiDenoiseErrorCallBack(errorCode: number, extendedData: string): void
AI noise reduction error callback.

Parameters

NameTypeDescription
errorCodenumbererror code.
extendedDatastringError description information.

Details

Detailed description: AI noise reduction error callback.

Trigger condition: Calling the enableAiDenoise or enableMicrophone interface of ZegoExpressRangeAudio to use the AI ​​noise reduction function is abnormal.

Supported version: 2.21.0

ZegoRangeAudioUserUpdateCheckConfig

Details

Check for in range user change configuration

Properties

frequency

frequency
frequency: number

the frequency to check user in range changes

ZegoRoomConfig

Room related configuration

Properties

userUpdate

userUpdate
userUpdate: boolean

Set whether roomUserUpdate is called back, the default is false, no callback

maxMemberCount

maxMemberCount
maxMemberCount: number

The maximum number of users in the room, pass 0 as unlimited, and the default is unlimited; only the first user who logs in to the room will take effect

ZegoRoomExtraInfo

Properties

key

key
key: string

The key of the room extra information

value

value
value: string

The value of the room extra information

updateUser

updateUser
updateUser: ZegoUser

The user who update the room extra information

updateTime

updateTime
updateTime: number

Update time of the room extra information

ZegoRoomRecvTransparentMessage

Receive the transparent message from the room

Properties

sendUser

sendUser
sendUser: ZegoUser

send user

content

content
content: Uint8Array

Received message content

ZegoRoomSendTransparentMessage

Transparent message info.

Details

Room transparent message, including room id, message content, sending user, sending type, sending mode, timeout period

Properties

sendMode

sendMode

send mode

sendType

sendType

send type

content

content
content: Uint8Array

Message send content.

recvUserList

recvUserList
recvUserList: ZegoUser[]

Message receiver list, when sendType appointed ZegoRoomTransparentMessageModeOnlyServer don't fill in. When appointed ZegoRoomTransparentMessageModeClientAndServer or ZegoRoomTransparentMessageModeOnlyClient, empty room will be sent to all online users.

timeOut

timeOut
timeOut: number

send message timeout, The default value is 10s.

ZegoSEIConfig

Details

Supported versions: 2.16.0 and above.

Properties

unregisterSEIFilter

unregisterSEIFilter
unregisterSEIFilter: string

Detail description: The SEI (nalu type = 6, payload type = 5) type of H.264 is used for packaging, because the video encoder itself will generate SEI with a payload type of 5, or when the video file is used to push the stream, the video file may also be There is such a SEI, so when using this type, the user needs to plug the uuid + content into the SEI sending interface as a buffer; at this time, in order to distinguish the SEI generated by the video encoder itself, the App can fill in the service specific when sending this type of SEI uuid (uuid length is 16 bytes), when the receiver uses the SDK to parse the SEI with the payload type of 5, it will filter out the SEI matching the uuid according to the set filter string and throw it to the business. If the filter string is not set, the SDK will Throw any SEI received to the developer.

Business scenario: Send SEI and use H.264 SEI (nalu type = 6, payload type = 5) to package.

SEIPass

SEIPass
SEIPass: boolean

Release restrictions on sending and receiving SEI content with payloadType 5. For the SEI content whose payloadType is 5, when the parameter value is set to true and unregisterSEIFilter is not set, all SEI sending and receiving will be released; when the parameter value is set to false (default value), only SEI that conforms to unregisterSEIFilter will be sent and received .

emulationPreventionByte

emulationPreventionByte
emulationPreventionByte: boolean

SEI switch Anti-competition code processing switch, the default value is false, that is, off. When sending SEI binary data, it may be the same as the slice start identifier of the NALU in H264, resulting in an error in the NALU slice. Therefore, ZegoSEIConfig adds the emulationPreventionByte attribute SEI switch anti-competition code processing, that is, encode the content of the SEI data that is the same as the identifier, and then send it out, and decode it when the streaming end receives it, which can effectively avoid this situation.

ZegoScreen

Create screen sharing media stream related parameter constraints

Details

This class is used to constrain the source.screen parameter of the createStream interface.

  • Use cases: Create a screen sharing media stream.
  • Caution: When the videoQuality is 4, the camera adds width / height / frameRate / bitrate attributes. These parameters only support positive integers, and these four attributes must also be passed to the SDK.

Properties

audio

audio
audio: boolean

Whether audio is required, default is false

videoQuality

videoQuality
videoQuality: 1|2|3|4

Generally speaking, the choice of screen sharing video quality should be determined according to the actual situation and scene. The videoQuality in screen provides three preset values:

1: The frame rate is larger, which is suitable for scenes that require high fluency. 2: Suitable for scenes that strike a balance between fluency and clarity. 3: Large bit rate, suitable for scenes with high definition requirements. In addition to the above three preset values, videoQuality also provides a custom value of 4, which can customize the frame rate and bitrate. The screen adds frameRate / bitrate attributes. These two attributes need to be passed to the SDK when used.

Video quality level, the default quality level is 2 1 Frame rate: 20 Code rate: 800K 2 Frame rate: 15 Code rate: 1500K 3 Frame rate: 5 Code rate: 2000K 4 Frame rate: frameRate Code rate: bitrate (k)

width

width
width: number | ConstraintExtend

wide resolution

height

height
height: number | ConstraintExtend

High resolution

bitrate

bitrate
bitrate: number

bitrate

frameRate

frameRate
frameRate: number | ConstraintExtend

frameRate

bitRate

bitRate
bitRate: number

bitRate(use bitrate instead)

startBitrate

startBitrate
startBitrate: "default" | "target"

The starting bit rate, the default is "target", environmental requirements: Google kernel browser and SDK version 2.7.0 and above. A value of "default" means to use webrtc's default start bitrate of 300kbps and then slowly increase; a value of "target" means to quickly increase to the set target bitrate.

videoOptimizationMode

videoOptimizationMode
videoOptimizationMode: "default" | "motion" | "detail"

Video optimization mode, default to "default";

A value of "motion" indicates smooth mode. In most cases, the SDK will not reduce the frame rate, but may reduce the transmission resolution.

A value of "detail" indicates clear mode. In most cases, the SDK will not reduce the transmission resolution, but may reduce the frame rate

sourceID

sourceID
sourceID: string

Specify the screen shared screen ID, only the Chrome kernel browser is used

minBitrate

minBitrate
minBitrate: number

The minimum streaming bit rate. The minimum bit rate for acceptable video quality degradation when the network is poor.

  • Use cases: If you want the video to be consistently high quality, set minBitrate to a value close to the target bitrate. Push streams that do not require high video quality can set the minBitrate to a lower value.
  • Default value: The default minimum bitrate is 60% of the target bitrate.

keyFrameInterval

keyFrameInterval
keyFrameInterval: number

The length of the video key frame interval, in seconds. Screen sharing can reduce the performance pressure of video encoding by increasing the interval of keyframes.

  • Default value: 2 s.
  • Value range: [2, 6].

ANS

ANS
ANS: boolean

Whether to turn on noise reduction. It is turned off by default.

AGC

AGC
AGC: boolean

Whether to turn on the automatic gain. It is turned off by default.

AEC

AEC
AEC: boolean

Whether echo cancellation is enabled or not. It is enabled by default.

ZegoServerResponse

Properties

errorCode

errorCode
errorCode: number

Return an error code, 0 means success

extendedData

extendedData
extendedData: string

Extended Information

ZegoSnapshotOptions

snapshot setting options.

Properties

imageType

imageType
imageType: string

Image format, the default is image/png

  • Use cases: Specifies the image format of the screenshot.

quality

quality
quality: number

Image quality, 0-1, default 1.

  • Use cases: Specifies the image quality of the screenshot.

save

save
save: boolean

Whether to save and download screenshots to a local file.

fileName

fileName
fileName: string

The name of the save file, only takes effect when save is set to true.

ZegoSongLineScoreInfo

Score completion information for each line of the song.

Properties

lineIndex

lineIndex
lineIndex: number

The index of the row.

previousScore

previousScore
previousScore: number

Score the score to complete this sentence.

averageScore

averageScore
averageScore: number

The average score.

totalScore

totalScore
totalScore: number

Total score.

ZegoSoundLevelInfo

Sound wave info

Properties

streamID

streamID
streamID: string

Stream ID

soundLevel

soundLevel
soundLevel: number

Sound wave size, value range [0,100], usually when a person speaks normally, the sound wave of the microphone will fluctuate to more than 10.

type

type
type: "push" | "pull"

Used to distinguish between push and pull flows, "push" means publishing stream and "pull" means playing stream.

ZegoStartScoreParams

Start scoring related parameters.

Properties

resourceID

resourceID
resourceID: string

The resource ID for the accompaniment or climactic clip.

localStream

localStream
localStream: MediaStream

A media stream object that collects microphone sound.

player

player
player: HTMLMediaElement

h5 player to play accompaniments.

enableSongLineScoreCompleteEvent

enableSongLineScoreCompleteEvent
enableSongLineScoreCompleteEvent: boolean

Enables the scoring completion callback for each row.

ZegoStreamCompositorInputOption

Local mixed-flow input stream configuration

Properties

layout

layout

Layout items for layers

objectFit

objectFit
objectFit: string

How video or image content adapts to the layer it is on,"cover" | "contain" | "fill"

contentType

contentType
contentType: string

Mixed types of input streams,"VIDEO" | "AUDIO" | "ALL"

volume

volume
volume: number

The output volume of the input stream, [0, 100]

ZegoStreamCompositorLayoutOption

Local mixed-flow input stream configuration

Properties

x

x
x: number

The horizontal displacement of the upper left corner of the input layer relative to the upper left corner of the canvas

y

y
y: number

The vertical displacement of the upper left corner of the input layer relative to the upper left corner of the canvas.

width

width
width: number

The width of the layer (px)

height

height
height: number

The height of the layer (px)

zOrder

zOrder
zOrder: number

The order of the layer

ZegoStreamCompositorOutputConfig

Local mixed-flow output stream configuration

Properties

width

width
width: number

output width

height

height
height: number

output height

frameRate

frameRate
frameRate: number

output frameRate

bitrate

bitrate
bitrate: number

output bitrate

ZegoStreamList

Information of media stream

Properties

streamID

streamID
streamID: string

Stream ID

user

user
user: ZegoUser

User corresponding to the stream

extraInfo

extraInfo
extraInfo: string

Stream additional information

urlsFLV

urlsFLV
urlsFLV: string

flv play address

urlsRTMP

urlsRTMP
urlsRTMP: string

rtmp playback address

urlsHLS

urlsHLS
urlsHLS: string

hls play address

urlsHttpsFLV

urlsHttpsFLV
urlsHttpsFLV: string

FLV playback address of https protocol

urlsHttpsHLS

urlsHttpsHLS
urlsHttpsHLS: string

hls play address of https protocol

ZegoStreamOptions

Configuration parameter constraints of the createZegoStream interface

Details

This class is used to constrain the configuration parameters of the createStream interface.

  • Use cases: Create zegoLocalStream instance object.
  • Caution: Only one of the three parameters of camera, screen and custom can be filled in each time the interface createStream is called.

Properties

camera

camera
camera: { video?: boolean | ZegoCaptureCamera; audio?: boolean | ZegoCaptureMicrophone; }

Camera microphone collection stream related configuration; Before version 3.8.0, this configuration only takes effect when createZegoStream is called, and will not be used in subsequent calls to collection-related interfaces. After version 3.8.0, this configuration will be used if no parameters are passed when subsequent calls to collection-related interfaces are made, and new configuration parameters will be used if parameters are passed.

screen

screen
screen: { video?: boolean | ZegoCaptureScreenVideo; audio?: boolean | ZegoCaptureScreenAudio; }

Screen capture collection stream related configuration; Before version 3.8.0, this configuration only takes effect when createZegoStream is called, and will not be used in subsequent calls to collection-related interfaces. After version 3.8.0, this configuration will be used if no parameters are passed when subsequent calls to collection-related interfaces are made, and new configuration parameters will be used if parameters are passed.

custom

custom
custom: { video?: ZegoCustomVideo; audio?: ZegoCustomAudio; }

Third-party stream collection related configuration; Before version 3.8.0, this configuration only takes effect when createZegoStream is called, and will not be used in subsequent calls to collection-related interfaces. After version 3.8.0, this configuration will be used if no parameters are passed when subsequent calls to collection-related interfaces are made, and new configuration parameters will be used if parameters are passed.

autoCapture

autoCapture
autoCapture: boolean

Whether to automatically capture, default is true; When autoCapture is false, the configurations passed in by camera, screen, and custom are not effective, and relevant configuration parameters need to be passed in the capture interface.

autoPlay

autoPlay
autoPlay: boolean

Whether to automatically play the preview video. When autoPlay is true, you need to pass in the parameters captureView and view.

videoBitrate

videoBitrate
videoBitrate: number | { bitrate?: number; startBitrate?: "default" | "target"; minBitrate?: number; }

Video bit rate, unit is kbps.

audioBitrate

audioBitrate
audioBitrate: number

Audio code rate, unit is kbps.

captureView

captureView
captureView: HTMLElement

playCaptureVideo Mount node for previewing capture streams. This parameter is used when autoPlay is true.

view

view
view: HTMLElement

playVideo Preview the mounted node of the video to be pushed or the video being pushed. This parameter is used when autoPlay is true.

ZegoStreamRelayCDNInfo

Including the URL of the retweet CDN, retweet status, etc.

Properties

url

url
url: string

CDN url

state

state
state: "NO_RELAY" | "RELAY_REQUESTING" | "RELAYING"

NO_RELAY: not relay state, RELAY_REQUESTING: requesting relay state, RELAYING: relaying state

updateReason

updateReason
updateReason: string

change reason

stateTime

stateTime
stateTime: number

update time

ZegoStreamViewOptions

Media streaming component options.

Properties

mirror

mirror
mirror: boolean

Mirror display, true is on, false is off, the default is off.

objectFit

objectFit
objectFit: "cover" | "contain" | "fill"

Video screen display mode, "cover" is to cover the container; "contain" is to display all contents; "fill" is to stretch and fill.

muted

muted
muted: boolean

Whether to mute, true to turn on mute, false to turn off mute. The default playback of the local stream is muted, and the default playback of the remote stream is off mute.

enableAutoplayDialog

enableAutoplayDialog
enableAutoplayDialog: boolean

The pop-up window for auto-play failure is enabled by default. When auto-play fails, the SDK will pop up the window to guide the user to click on the page to resume audio and video playback. Can be set to false to disable.

clearLastFrame

clearLastFrame
clearLastFrame: boolean

Whether to remove the last frame when the video data is interrupted. true to clear, false to keep, the default is true.

ZegoSwitchRoomConfig

switch room related configuration

Details

Configuration of the toRoomID room in the switchRoom interface

Properties

token

token
token: string

The authentication token for logging into the toRoomID room is obtained by registering the project key in the architecture console, plus the specified algorithm. The test phase can be accessed through the interface provided by ZEGO, and the formal environment must be implemented by the user.

maxMemberCount

maxMemberCount
maxMemberCount: number

The maximum number of users in the room, pass 0 as unlimited, and the default is unlimited; only the first user who logs in to the room will take effect

isUserStatusNotify

isUserStatusNotify
isUserStatusNotify: boolean

Set whether roomUserUpdate is callback, default is false no callback

ZegoTurnServer

TURN server configuration information.

Details

TURN server configuration information.

Properties

url

url
url: string

The URL address of the TURN server.

username

username
username: string

Username to use during authentication.

credential

credential
credential: string

The credential to use when logging into the server.

ZegoUser

Properties

userID

userID
userID: string

Mobile phone numbers, ID number, passport number, real name, etc. should not be filled in user sensitive information in this field. User ID, generated by the developer, a string of up to 64 bytes. Only supports numbers, English characters and'~','!','@','#','$','','^','&','*','(',')', '_','+','=','-',',';',''',',','.

userName

userName
userName: string

Mobile phone numbers, ID number, passport number, real name, etc. should not be filled in user sensitive information in this field. User name, generated by the developer, a string with a maximum length of 256 bytes

ZegoVideoCodec

Properties

H264

H264
H264: boolean

Whether to support H264 encoding and decoding capabilities

VP8

VP8
VP8: boolean

Whether to support VP8 encoding and decoding capabilities

H265

H265
H265: boolean

Whether to support H265 codec capability

ZegoWatermark

Mix stream wate rmark

Details

Configure a watermark image URL and the layout of the watermark in the screen.

Properties

imageURL

imageURL
imageURL: string

The path of the watermark image. Support local file absolute path (file://xxx), Asset resource path (asset://xxx) and Android URI path (String path = "uri://" + uri.toString();). The format supports png, jpg.

layout

layout

Watermark image layout

ZegoWebPlayOption

Properties

video

video
video: boolean

Whether to pull the video, the default is true; Normally, it is recommended not to fill in. SDK will choose whether to pull audio and video according to the actual device status.

audio

audio
audio: boolean

Whether to pull audio, the default is true; Normally, it is recommended not to fill in. SDK will choose whether to pull audio and video according to the actual device status.

streamParams

streamParams
streamParams: string

Pull stream extra parameters; the format of authentication parameter streamParams is as follows:'zg_expired=XX&zg_nonce=XX&zg_token=XX', only pass in when authentication is required, otherwise please ignore

resourceMode

resourceMode
resourceMode: 0 | 1 | 2 | 5

Streaming mode, the default is 0. 0 means pulling the stream only from RTC; 1 means pulling the stream only from CDN; 2 means pulling the stream only from L3; 5 means custom mode, the SDK selects the push resource according to the customResourceConfig parameter of the push setting. .

isSEIStart

isSEIStart
isSEIStart: boolean

Detailed description: Whether to parse SEI.

streamType

streamType
streamType: 0 | 1 | 2

Pull stream size flow type 0 refers to low stream, 1 refers to large stream, and 2 refers to automatic

CDNPlayer

CDNPlayer
CDNPlayer: any

ZegoExpressPlayer or ZegoCDNPlayer instance object currently only supports flv format. If you use ZegoExpressPlayer (the player supports version 1.3.0 and above), there is no need to configure the CDNVideo field, and the SDK will use the container specified by the player for playback.

CDNVideo

CDNVideo
CDNVideo: HTMLMediaElement

<video> tag element for playing CDN assets.

playoutDelayHint

playoutDelayHint
playoutDelayHint: number

Set the streaming audio and video playback delay in seconds. If the network condition is poor, the browser may increase the playback delay to reduce lag. Since 3.7.0, this parameter is deprecated and jitterBufferTarget is used instead.

jitterBufferTarget

jitterBufferTarget
jitterBufferTarget: number

Set the streaming audio and video playback delay in seconds. If the network condition is poor, the browser may increase the playback delay to reduce lag. If enableLowLatency is set to true, this parameter has no effect. This parameter is supported since version 3.7.0.

enableLowLatency

enableLowLatency
enableLowLatency: boolean

Whether to allow ultra-low latency play, the default is false; When set to true, the jitterBufferTarget parameters have no effect. When ultra-low latency playback is enabled, priority is given to ensuring low latency, but lags may occur when the network is weak. This parameter is supported since version 3.7.0.

customResourceConfig

customResourceConfig
customResourceConfig: ZegoCustomPlayerResourceConfig

When [resourceMode] is 5, it is the configuration of the streaming resource type when customizing the streaming resource strategy. This parameter is supported since version 3.7.0.

codecTemplateID

codecTemplateID
codecTemplateID: number

The bit rate template ID, used to pull the stream of the specified bit rate template. An integer with a value greater than 100, the ID must be unique.

adaptiveSwitch

adaptiveSwitch
adaptiveSwitch: boolean

Whether to enable adaptive switching of streams, 1 means on and 0 means off. Only valid if [resourceMode] is L3. If you need to use it, please contact ZEGO technical support, otherwise this parameter can be ignored.

adaptiveTemplateIDList

adaptiveTemplateIDList
adaptiveTemplateIDList: number[]

List of adaptive transcoding template IDs for streams. Only valid if [resourceMode] is L3. If you need to use it, please contact ZEGO technical support, otherwise this parameter can be ignored.

transcodeOnDecodeFail

transcodeOnDecodeFail
transcodeOnDecodeFail: boolean

Allows automatic use of single-stream transcoding h264 or the encoding template specified by codecTemplateID when video decoding fails

ZegoWebPublishOption

Properties

streamParams

streamParams
streamParams: string

Streaming alternative parameters; the format of alternative parameters streamParams is as follows:'zg_expired=XX&zg_nonce=XX&zg_token=XX', only need to configure authentication before passing in (optional function)

extraInfo

extraInfo
extraInfo: string

Stream additional information

videoCodec

videoCodec
videoCodec: 'VP8' | 'H264' | 'H265'

Push video encoding,'VP8' (string) or 'H264' (string). The default value is 'H264'.

roomID

roomID
roomID: string

Room ID. It is required after enabling the multi-room function. Choose which room to stream in.

isSEIStart

isSEIStart
isSEIStart: boolean

SEIType

SEIType
SEIType: ZegoSEIType

SEI type

forceSynchronousNetworkTime

forceSynchronousNetworkTime
forceSynchronousNetworkTime: number

Whether to synchronize the network time when pushing the stream. And must be used in conjunction with the setStreamAlignmentProperty method. Used to align multiple streams on the mixing service or pull-stream side, such as the chorus scene of KTV. Pass 1 to enable, 0 to disable, and the default is to disable.

enableDTX

enableDTX
enableDTX: boolean

Whether to enable DTX silence detection, which is used to reduce the audio bitrate of the stream when there is no sound. The default is to turn off DTX.

inspectFlag

inspectFlag
inspectFlag: ZegoInspectFlagType
  • Caution: When set to not allowed for submission, the review service provider will not pull this stream for review; In the business scenario where stream injection is used to achieve cross-room PK, it is recommended to set this field to "Not allowed" to avoid the same stream being reviewed multiple times in multiple rooms.

trafficControlFocusOnMode

trafficControlFocusOnMode
trafficControlFocusOnMode: TrafficControlFocusOnMode

The factor that triggers traffic control, the default is TrafficControlFounsOnLocalOnly

trafficControlMinVideoBitrate

trafficControlMinVideoBitrate
trafficControlMinVideoBitrate: number

Minimum video bitrate, in kbps,When the minimum video bit rate is not reached, the video is sent at a very low frame rate

enableTrafficControl

enableTrafficControl
enableTrafficControl: boolean

Flow control switch, Used to control adaptive bitrate,the default is on, true: on, false: off.

enableAutoSwitchVideoCodec

enableAutoSwitchVideoCodec
enableAutoSwitchVideoCodec: boolean

When videoCodec is not available, whether to automatically switch to available videoCodec, default is false. For example: The current device does not support H264. After turning on this configuration, the SDK will automatically switch to VP8.

trafficControlMinVideoMode

trafficControlMinVideoMode
trafficControlMinVideoMode: TrafficControlMinVideoBitrateMode

The video sending mode when the streaming control triggers the lowest bit rate.

Previous

Class

Next

Enum

On this page

Back to top