Options
All
  • Public
  • Public/Protected
  • All
Menu

Video SDK 3.7.0 API Reference for Electron

This Agora Electron SDK is developed upon the Native SDK for macOS and the Native SDK for Windows, with the Node.js C++ plug-in units. The Electron SDK supports all the functions of the Agora Native SDK. Agora provides ensured quality of experience (QoE) for worldwide Internet-based voice and video communications through a virtual global network optimized on all platforms.

  • The AgoraRtcEngine class provides the main methods that can be invoked by your application.

  • The AgoraRtcEngine.on listens to events during runtime.

  • The AgoraRtcChannel class provides methods that enable real-time communications in a specified channel. By creating multiple AgoraRtcChannel objects, the user can join multiple channels.

  • The AgoraRtcChannel.on listens to events and statistics of a specified channel.

Methods

Channel management

Method Description
initialize Initializes an AgoraRtcEngine instance.
release Releases an AgoraRtcEngine instance.
setChannelProfile Sets the channel profile.
setClientRole Sets the role of the user (interactive live streaming only).
setClientRoleWithOptions Sets the role and level of the user (interactive live streaming only).
joinChannel Allows a user to join a channel.
switchChannel Switches to a different channel (interactive live streaming only).
leaveChannel Allows a user to leave a channel.
subscribe Subscribes to the remote user and initializes the video sink
renewToken Renews the token.
getConnectionState Gets the connection state of the app.
on Monitors the events during AgoraRtcEngine runtime.
off Stops monitoring the events during AgoraRtcEngine runtime.

Audio management

Method Description
enableAudio Enables the audio module.
disableAudio Disables the audio module.
setAudioProfile Sets the audio parameters and application scenarios.
adjustRecordingSignalVolume Adjusts the volume of the signal captured by the microphone.
adjustLoopbackRecordingSignalVolume Adjusts the volume of the signal captured by the sound card.
adjustPlaybackSignalVolume Adjusts the playback volume of the voice.
adjustUserPlaybackSignalVolume Adjusts the playback volume of a specified remote user.
enableLocalAudio Enables/disables the local audio capture.
muteLocalAudioStream Stops/Resumes sending the local audio stream.
muteRemoteAudioStream Stops/Resumes receiving a specified remote audio stream.
muteAllRemoteAudioStreams Stops/Resumes receiving all remote audio streams.
setDefaultMuteAllRemoteAudioStreams Sets whether to receive all remote audio streams by default.

Video management

Method Description
enableVideo Enables the video module.
disableVideo Disables the video module.
setVideoEncoderConfiguration Sets the video encoder configuration.
setupLocalVideo Sets the local video view.
setupViewContentMode Sets the view content mode.
setRenderMode Sets the view render mode.
startPreview Starts the local video preview.
stopPreview Stops the local video preview.
enableLocalVideo Enables/Disables the local video capture.
muteLocalVideoStream Stops/Resumes sending the local video stream.
muteRemoteVideoStream Stops/Resumes receiving a specified remote video stream.
muteAllRemoteVideoStreams Stops/Resumes receiving all remote video streams.
setDefaultMuteAllRemoteVideoStreams Sets whether to receive all remote video streams by default.

Video sink

Method Description
initRender Initializes the video sink.
destroyRender Destroys the video sink.
resizeRender Resizes the rendered video.
setVideoRenderDimension Ses the pixels the rendered video.
setVideoRenderFPS Sets the frame rate of the rendered video.
setVideoRenderHighFPS Sets the high frame rate of the rendered video.
addVideoRenderToHighFPS Adds the rendered video with high frame rate.
removeVideoRenderFromHighFPS Removes the rendered video with high frame rate.

Video pre-process and post-process

Method Description
setBeautyEffectOptions Sets the image enhancement options.
enableVirtualBackground Enables/Disables the virtual background. (beta function)
setVideoDenoiserOptions Sets video noise reduction.
setLowlightEnhanceOptions Sets low-light enhancement.
setColorEnhanceOptions Sets color enhancement.

Multiple channels management

API Description
createChannel Creates and gets an AgoraRtcChannel object.
AgoraRtcChannel Provides methods that enable real-time communications in a specified channel.
AgoraRtcChannel.on Provides callbacks that report events and statistics in a specified channel.

Screen sharing

Common methods Description
getScreenDisplaysInfo Gets the display ID.
getScreenWindowsInfo Gets the window ID.
getScreenCaptureSources Gets a list of shareable screens and windows (for macOS and Windows only).
Methods for the main process Description
startScreenCaptureByDisplayId Shares the whole or part of a screen by specifying the display ID (for macOS and Windows only).
startScreenCaptureByScreen Shares the whole or part of a screen by specifying the screen symbol.
startScreenCaptureByWindow Shares the whole or part of a window by specifying the window symbol.
stopScreenCapture Stops screen sharing.
updateScreenCaptureParameters Updates the screen sharing parameters.
setScreenCaptureContentHint Sets the content hint for screen sharing.
setScreenCaptureScenario Sets the screen sharing scenario (for macOS and Windows only).
updateScreenCaptureRegion Updates the screen sharing region.
Methods for the second instance Description
videoSourceStartScreenCaptureByScreen Shares the whole or part of a screen by specifying the screen rect when using the video source.
videoSourceStartScreenCaptureByWindow Shares the whole or part of a window by specifying the window ID when using the video source.
videoSourceSetVideoProfile Sets the video profile for the video captured by the camera device.
stopScreenCapture2 Stops the screen sharing when using the video source.
startScreenCapturePreview Starts the local video preview when using the video source.
stopScreenCapturePreview Stops the local video preview when using the video source.
videoSourceUpdateScreenCaptureRegion Updates the screen sharing region when using the video source.
videoSourceUpdateScreenCaptureParameters Updates the screen sharing parameters when using the video source.
videoSourceSetScreenCaptureContentHint Sets the content hint when using the video source.

Audio file playback and mixing

Method Description
startAudioMixing Starts playing and mixing the music file.
stopAudioMixing Stops playing and mixing the music file.
pauseAudioMixing Pauses playing and mixing the music file.
resumeAudioMixing Resumes playing and mixing the music file.
adjustAudioMixingVolume Adjusts the volume during audio mixing.
adjustAudioMixingPlayoutVolume Adjusts the volume of audio mixing for local playback.
adjustAudioMixingPublishVolume Adjusts the volume of audio mixing for remote playback.
setAudioMixingPitch Sets the pitch of the local music file.
getAudioMixingPlayoutVolume Adjusts the audio mixing volume for publishing (for remote users).
getAudioMixingPublishVolume Retrieves the audio mixing volume for publishing.
getAudioMixingCurrentPosition Gets the playback position (ms) of the music file.
setAudioMixingPosition Sets the playback position of the music file.
getAudioTrackCount Gets the audio track index of the current music file (for Android, iOS, and Windows only).
selectAudioTrack Specifies the playback track of the current music file (for Android, iOS, and Windows only).
setAudioMixingPlaybackSpeed Sets the playback speed of the current music file.
setAudioMixingDualMonoMode Sets the channel mode of the current music file.

Audio effect playback

Method Description
getEffectsVolume Gets the volume of the audio effects.
setEffectsVolume Sets the volume of the audio effects.
setVolumeOfEffect Sets the volume of the audio effect.
playEffect Plays a specified audio effect.
stopEffect Stops playing a specified audio effect.
preloadEffect Preloads a specified audio effect file into the memory.
unloadEffect Releases a specified audio effect from the memory.
pauseEffect Pauses a specified audio effect.
pauseAllEffects Pauses all audio effects.
resumeEffect Resumes playing a specified audio effect.
resumeAllEffects Resumes playing all audio effects.
getEffectDuration Gets the duration of the audio effect file.
setEffectPosition Sets the playback position of an audio effect file.
getEffectCurrentPosition Gets the playback position of the audio effect file.

Audio file information

Method Description
getAudioFileInfo Gets the information of a specified audio file.

Voice Effect

Method Description
setLocalVoicePitch Changes the voice pitch of the local speaker.
enableLocalVoicePitchCallback Enables reporting the voice pitch of the local user.
setLocalVoiceEqualization Sets the local video equalization effect.
setLocalVoiceReverb Sets the local voice reverberation.
setVoiceBeautifierPreset Sets an SDK preset voice beautifier effect.
setVoiceBeautifierParameters Sets parameters for SDK preset voice beautifier effects.
setAudioEffectPreset Sets an SDK preset audio effect.
setAudioEffectParameters Sets parameters for SDK preset audio effects.
setVoiceConversionPreset Sets an SDK preset voice conversion effect.

Sound position indication

Method Description
enableSoundPositionIndication Enables/Disables stereo panning for remote users.
setRemoteVoicePosition Sets the sound position and gain of a remote user.

Media Push

This group of methods apply to Live Streaming only.

Method Description
startRtmpStreamWithoutTranscoding Starts pushing media streams to a CDN without transcoding.
startRtmpStreamWithTranscoding Starts pushing media streams to a CDN and sets the transcoding configuration.
updateRtmpTranscoding Updates the transcoding configuration.
stopRtmpStream Stops pushing media streams to a CDN.
setLiveTranscoding Sets the video layout and audio for CDN live.
addPublishStreamUrl Adds a CDN stream address.
removePublishStreamUrl Removes a CDN stream address.

Channel Media Relay

This group of methods apply to Live Streaming only.

Method Description
startChannelMediaRelay Starts to relay media streams across channels.
updateChannelMediaRelay Updates the channels for media stream relay.
pauseAllChannelMediaRelay Pauses the media stream relay to all destination channels.
resumeAllChannelMediaRelay Resumes the media stream relay to all destination channels.
stopChannelMediaRelay Stops the media stream relay.

Audio volume indication

Method Description
enableAudioVolumeIndication Reports on which users are speaking and the speakers' volume.

Dual video stream mode

Method Description
enableDualStreamMode Sets the stream mode to single-stream (default) or dual-stream mode.
setRemoteVideoStreamType Sets the remote user’s video stream type received by the local user when the remote user sends dual streams.
setRemoteDefaultVideoStreamType Sets the default video-stream type for the video received by the local user when the remote user sends dual streams.

Stream fallback

Method Description
setLocalPublishFallbackOption Sets the fallback option for the published video stream under unreliable network conditions.
setRemoteSubscribeFallbackOption Sets the fallback option for the remote stream under unreliable network conditions.
setRemoteUserPriority Prioritizes a remote user's stream.

Pre-call network test

Method Description
startEchoTestWithInterval Starts an audio call test.
startEchoTestWithConfig Starts an audio and video call loop test.
stopEchoTest Stops the audio call test.
enableLastmileTest Enables the network connection quality test.
disableLastmileTest Disables the network connection quality test.
startLastmileProbeTest Starts the last-mile network probe test.
stopLastmileProbeTest Stops the last-mile network probe test.

Media Metadata

Method Description
registerMediaMetadataObserver Registers a media metadata observer.
unRegisterMediaMetadataObserver Unregisters a media metadata observer.
setMaxMetadataSize Sets the maximum size of the media metadata.
sendMetadata Sends the media metadata.

Watermark

This group of methods apply to Live Streaming only.

Method Description
addVideoWatermark Adds a watermark image to the local video.
clearVideoWatermarks Removes the watermark image.

Video snapshot

Method Description
takeSnapshot Takes a snapshot of a video stream.

Encryption

Method Description
enableEncryption Enables/Disables the built-in encryption.

Audio recorder

Method Description
startAudioRecordingWithConfig Starts an audio recording on the client.
stopAudioRecording Stops an audio recording on the client.

Audio playback device management

Method Description
setAudioPlaybackDevice Sets the audio playback device using the device ID.
getAudioPlaybackDevices Gets the audio playback device using the device ID.
getPlaybackDeviceInfo Gets the information of the audio playback device.
getCurrentAudioPlaybackDevice Gets the current audio playback device.
getDefaultAudioPlaybackDevices Gets the default audio playback device of the system.
followSystemPlaybackDevice Sets the audio playback device used by the SDK to follow the system default audio playback device.
setAudioPlaybackDeviceMute Mutes/Unmutes the audio playback device.
getAudioPlaybackDeviceMute Gets the mute state of the audio playback device.
setAudioPlaybackVolume Sets the volume of the audio playback device.
getAudioPlaybackVolume Gets the volume of the audio playback device.
startAudioPlaybackDeviceTest Starts the audio playback device test.
stopAudioPlaybackDeviceTest Stops the audio playback device test.
startAudioDeviceLoopbackTest Starts the audio device loopback test.
stopAudioDeviceLoopbackTest Stops the audio device loopback test.

Audio recording device management

Method Description
setAudioRecordingDevice Sets the audio recording device using the device ID.
getAudioRecordingDevices Gets the audio recording device using the device ID.
getRecordingDeviceInfo Gets the information of the audio recording device.
getCurrentAudioRecordingDevice Gets the current audio recording device.
getDefaultAudioRecordingDevices Gets the default audio recording device of the system.
followSystemRecordingDevice Sets the audio recording device used by the SDK to follow the system default audio recording device.
setAudioRecordingDeviceMute Mutes/Unmutes the audio recording device.
getAudioRecordingDeviceMute Gets the mute state of the audio recording device.
setAudioRecordingVolume Sets the volume of the recording device.
getAudioRecordingVolume Gets the volume of the recording device.
startAudioRecordingDeviceTest Starts the recording device test.
stopAudioRecordingDeviceTest Stops the recording device test.
startAudioDeviceLoopbackTest Starts the audio device loopback test.
stopAudioDeviceLoopbackTest Stops the audio device loopback test.

Video device management

Method Description
setVideoDevice Sets the device with the device ID.
getVideoDevices Gets the video-capture device that is in use.
getCurrentVideoDevice Gets the current video device.
startVideoDeviceTest Starts the video playback device test.
stopVideoDeviceTest Stops the video playback device test.

Stream message

Method Description
createDataStreamWithConfi Creates a data stream.
sendStreamMessage Sends data stream messages.

Miscellaneous audio control

Method Description
enableLoopbackRecording Enables loopback recording.

Miscellaneous video control

Method Description
setCameraCapturerConfiguration Sets the camera capturer configuration.

Miscellaneous methods

Method Description
setCloudProxy Sets the Agora cloud proxy service.
enableDeepLearningDenoise Enables/Disables deep-learning noise reduction.
sendCustomReportMessage Reports and analyzes customized messages.
getCallId Gets the current call ID.
rate Allows the user to rate the call and is called after the call ends.
complain Allows a user to complain about the call quality after a call ends.
getVersion Gets the SDK version number.
getErrorDescription Gets the warning or error description.

Customized methods

Method Description
setParameters Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.

Other methods for the second instance

Agora Electron SDK provides the second instance videoSource for screen sharing. For methods related to screen sharing, see Screen sharing.

Method Description
videoSourceInitialize Initializes the videoSource object.
videoSourceRelease Releases the videoSource object.
videoSourceSetLogFile Specifies an SDK output log file when using the video source.
setupLocalVideoSource Sets the local video view of videoSource
videoSourceJoin Allows videoSource to join a channel.
videoSourceLeave Allows videoSource to leave a channel.
videoSourceSetChannelProfile Sets the channel profile.
videoSourceRenewToken Renews the Token when using the video source.
videoSourceEnableAudio Enables the audio module.
videoSourceEnableLoopbackRecording Enables loopback audio capturing.
videoSourceEnableEncryption Enables/Disables the built-in encryption.
videoSourceSetParameters Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options when using the video source.

AgoraRtcEngine.on

Agora Electron SDK use the AgoraRtcEngine.on listens to the events above:

Event Description
warning Occurs when a warning occurs.
error Occurs when an error occurs.
joinedChannel Occurs when a user joins a channel.
rejoinedChannel Occurs when a user rejoins a channel.
leaveChannel Occurs when a user leaves a channel.
clientRoleChanged Occurs when the user role in the live streaming changes.
userJoined Occurs when a remote user joins a channel.
connectionStateChanged Occurs when the network connection state changes.
connectionLost Occurs when the network connection state changes.
apiCallExecuted Occurs when an API method is executed.
tokenPrivilegeWillExpire Occurs when the token expires in 30 seconds.
requestChannelKey Occurs when the Channel Key expires.
localUserRegistered Occurs when the local user successfully registers a user account.
userInfoUpdated Occurs when the SDK gets the user ID and user account of the remote user.
groupAudioVolumeIndication Occurs when the state of the microphone changes.
activeSpeaker Reports which user is the loudest speaker.
rtcStats Reports the statistics of AgoraRtcEngine.
localVideoStats Reports the statistics of the uploading local video stream.
remoteVideoStats Reports the statistics of the video stream from each remote user/host.
localAudioStats Reports the statistics of the local audio stream.
remoteAudioStats Reports the statistics of the audio stream from each remote user/host.
audioMixingStateChanged Occurs when the state of the local user's audio mixing file changes.
remoteAudioMixingBegin Occurs when a remote user starts audio mixing.
remoteAudioMixingEnd Occurs when a remote user finishes audio mixing.
audioEffectFinished Occurs when the audio effect file playback finishes.
networkQuality Reports the network quality of each user.
lastmileQuality Reports the last-mile network quality of the local user before the user joins a channel.
lastmileProbeResult Reports the last-mile network probe result.
firstLocalAudioFramePublished Occurs when the first audio frame is published.
firstLocalVideoFramePublished Occurs when the first video frame is published.
firstLocalVideoFrame Occurs when the first local video frame is rendered.
videoSizeChanged Occurs when the video size or rotation information of a specified remote user changes.
removeStream Occurs when the remote user leaves the channel.
userMuteVideo Occurs when a remote user stops/resumes sending the video stream.
cameraReady Occurs when the camera turns on and is ready to capture the video.
videoStopped Occurs when the video stops playing.
streamMessage Occurs when the local user receives a remote data stream within five seconds.
streamMessageError Occurs when the local user fails to receive the remote data stream.
rtmpStreamingStateChanged Occurs when the state of Media Push changes.
transcodingUpdated Occurs when the publisher's transcoding is updated.
rtmpStreamingEvent Reports events during Media Push.
audioDeviceVolumeChanged Occurs when the volume of the playback, microphone, or application changes.
localAudioStateChanged Occurs when the local audio state changes.
remoteAudioStateChanged Occurs when the remote audio state changes.
localVideoStateChanged Occurs when the local video state changes.
remoteVideoStateChanged Occurs when the remote video stream state changes.
audioPublishStateChanged Occurs when the audio publishing state changes.
videoPublishStateChanged Occurs when the video publishing state changes.
audioSubscribeStateChanged Occurs when the audio subscribing state changes.
videoSubscribeStateChanged Occurs when the audio subscribing state changes.
audioDeviceStateChanged Occurs when the audio device state changes.
videoDeviceStateChanged Occurs when the video device state changes.
cameraFocusAreaChanged Occurs when the camera focus area changes.
cameraExposureAreaChanged Occurs when the camera exposure area changes.
transcodingUpdated Occurs when the publisher's transcoding settings are updated.
channelMediaRelayState Occurs when the state of the media stream relay changes.
channelMediaRelayEvent Reports events during the media stream relay.
localPublishFallbackToAudioOnly Occurs:
  • When the published media stream falls back to an audio-only stream due to poor network conditions.

  • When the published media stream switches back to the video after the network conditions improve.
  • remoteSubscribeFallbackToAudioOnly Occurs:
  • When the remote media stream falls back to audio-only due to poor network conditions.

  • When the remote media stream switches back to the video after the network conditions improve.
  • receiveMetadata Occurs when the receiver receives the media metadata.
    sendMetadataSuccess Occurs when the sender sends the media metadata successfully.
    videoSourceJoinedSuccess Occurs when a user joins a channel. (The second instance)
    videoSourceRequestNewToken Occurs when the token expires. (The second instance)
    videoSourceLeaveChannel Occurs when a user leaves a channel. (The second instance)
    videoSourceLocalAudioStats Reports the statistics of the local audio stream. (The second instance)
    videoSourceLocalVideoStats Reports the statistics of the uploading local video stream. (The second instance)
    videoSourceVideoSizeChanged Occurs when the video size or rotation information of a specified remote user changes. (The second instance)
    videoSourceLocalVideoStateChanged Occurs when the local video state changes. (The second instance)
    videoSourceLocalAudioStateChanged Occurs when the local audio state changes. (The second instance)
    requestAudioFileInfo Reports the information of an audio file.
    channelMediaRelayEvent Reports events during the media stream relay.
    snapshotTaken Reports the result of taking a video snapshot.

    Warning codes

    Warning codes occur when the SDK encounters an error that might be recovered automatically. These are only notifications, and can generally be ignored.

    Warn Code Description
    -8 The specified view is invalid.
    Specify a view when using the video call function.
    -16 Failed to initialize the video function, possibly caused by a lack of resources.
    The users cannot see the video while the voice communication is not affected.
    -20 The request is pending, usually due to some module not being ready, and the SDK postponed processing the request.
    -103 No channel resources are available.
    Maybe because the server cannot allocate any channel resource.
    -104 A timeout occurs when looking up the channel.
    When joining a channel, the SDK looks up the specified channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server.
    -105 DEPRECATED Please use 10 in ConnectionChangeReason instead.
    The server rejects the request to look up the channel.
    The server cannot process this request or the request is illegal.
    -106 A timeout occurs when opening the channel.
    Once the specific channel is found, the SDK opens the channel. This warning usually occurs when the network condition is too poor for the SDK to connect to the server.
    -107 The server rejects the request to open the channel.
    The server cannot process this request or the request is illegal.
    -111 A timeout occurs when switching to the live video.
    -118 A timeout occurs when setting the client role in the live streaming profile.
    -119 The client role a the live streaming profile is unauthorized.
    -121 The ticket to open the channel is invalid.
    -122 Try connecting to another server.
    -131 The channel connection cannot be recovered.
    -157 The necessary dynamical library is not integrated. For example, if you call the enableDeepLearningDenoise but do not integrate the dynamical library for the deep-learning noise reduction into your project, the SDK reports this error code.
    -701 An error occurs in opening the audio mixing file.
    -1014 Audio Device Module: A warning occurs in the playback device.
    -1016 Audio Device Module: A warning occurs in the recording device.
    -1019 Audio Device Module: No valid audio data is collected.
    -1020 Audio Device Module: The playback device fails.
    -1021 Audio Device Module: The recording device fails.
    -1029 During a call, the audio session category should be set to AVAudioSessionCategoryPlayAndRecord, and AgoraRtcEngine monitors this value. If the audio session category is set to other values, this warning code is triggered and AgoraRtcEngine will forcefully set it back to AVAudioSessionCategoryPlayAndRecord.
    -1025 The audio recording or playback is interrupted by system events (such as a phone call).
    -1031 Audio Device Module: The recorded audio voice is too low.
    -1032 Audio Device Module: The playback audio voice is too low.
    -1040 Audio device module: An exception occurs with the audio drive.
    Solutions:
  • Disable or re-enable the audio device.
  • Re-enable your device.
  • Update the sound card drive.
  • -1042 Audio device module: The audio capturing device is different from the audio playback device, which may cause echoes problem. Agora recommends using the same audio device to capture and playback audio.
    -1051 Audio Device Module: Howling is detected.
    -1052 Audio Device Module: The device is in the glitch state.
    -1053 Audio Device Module: A residual echo is detected. This may be caused by the delayed scheduling of system threads or a signal overflow.
    -1323 Audio device module: No available playback device. Solution: Plug in the audio device.
    -1324 Audio device module: The capture device is released improperly.
    Solutions:
  • Disable or re-enable the audio device.
  • Re-enable your device.
  • Update the sound card drive.
  • -1610 Super-resolution warning: The original video dimensions of the remote user exceed 640 × 480.
    -1611 Super-resolution warning: Another user is using super resolution.
    -1612 The device is not supported.

    Error codes

    Error codes occur when the SDK encounters an error that cannot be recovered automatically without any application intervention. For example, the SDK returns an error if it fails to turn on the camera, and reminds the user not to use the camera.

    Error Code Description
    0 No error occurs.
    -1 A general error occurs (no specified reason).
    -2 An invalid parameter is used. For example, the specific channel name includes illegal characters.
    -3 The SDK module is not ready.
    Possible solutions:
  • Check the audio device.
  • Check the completeness of the application.
  • Re-initialize the RTC engine.
  • -4 The SDK does not support this function.
    -5 The request is rejected.
    -6 The buffer size is not big enough to store the returned data.
    -7 The SDK is not initialized before calling this method.
    -9 No permission exists.
    Check if the user has granted access to the audio or video device.
    -10 An API method timeout occurs.
    Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (more than 10 seconds) for the SDK to process.
    -11 The request is canceled.
    This is for internal SDK use only, and it does not return to the application through any method or callback.
    -12 The method is called too often.
    This is for internal SDK use only, and it does not return to the application through any method or callback.
    -13 The SDK fails to bind to the network socket.
    This is for internal SDK use only, and it does not return to the application through any method or callback.
    -14 The network is unavailable.
    This is for internal SDK use only, and it does not return to the application through any method or callback.
    -15 No network buffers are available.
    This is for internal SDK internal use only, and it does not return to the application through any method or callback.
    -17 The request to join the channel is rejected.This error usually occurs when the user is already in the channel, and still calls the joinChannel method to join the channel.
    -18 The request to leave the channel is rejected.This error usually occurs:
  • When the user has left the channel and still calls leaveChannel to leave the channel. In this case, stop calling leaveChannel.
  • When the user has not joined the channel and still calls leaveChannel to leave the channel. In this case, no extra operation is needed.
  • -19 Resources are occupied and cannot be reused.
    -20 The SDK gives up the request due to too many requests.
    -21 In Windows, specific firewall settings can cause the SDK to fail to initialize and crash.
    -22 The application uses too much of the system resources and the SDK fails to allocate the resources.
    -101 The specified App ID is invalid.
    Please try to rejoin the channel with a valid App ID.
    -102 The specified channel name is invalid.
    Please try to rejoin the channel with a valid channel name.
    -103 AgoraRtcEngine fails to get server resources in the specified region. Try another region when initializing AgoraRtcEngine.
    -109 DEPRECATED Please use 9 in ConnectionChangeReason instead.
    The token expired due to one of the following reasons:
  • Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the Token to access the Agora service within 24 hours after the Token is generated. If the user does not access the Agora service after 24 hours, this Token is no longer valid.
  • Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel.
  • -110 DEPRECATED Please use 8 in ConnectionChangeReason instead.
    The token is invalid due to one of the following reasons:
  • The App Certificate for the project is enabled in Console, but the user is still using the App ID. Once the App Certificate is enabled, the user must use a token.
  • The uid is mandatory, and users must set the same uid as the one set in the joinChannel method.
  • -113 The user is not in the channel when calling the sendStreamMessage method.
    -114 The size of the sent data is over 1024 bytes when the user calls the sendStreamMessage method.
    -115 The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the sendStreamMessage method.
    -116 Too many data streams (over 5 streams) are created when the user calls the createDataStream method.
    -117 The data stream transmission timed out.
    -119 Switching roles fail.
    Please try to rejoin the channel.
    -120 Decryption fails. The user may have used a different encryption password to join the channel.
    Check your settings or try rejoining the channel.
    -123 The client is banned by the server.
    -124 Incorrect watermark file parameter.
    -125 Incorrect watermark file path.
    -126 Incorrect watermark file format.
    -127 Incorrect watermark file information.
    -128 Incorrect watermark file data format.
    -129 An error occurs in reading the watermark file.
    -130 Encryption is enabled when the user calls the addPublishStreamUrl method (Media Push does not support encrypted streams).
    -134 The User Account is invalid.
    -151 CDN related errors.
    Remove the original URL address and add a new one by calling the removePublishStreamUrl and addPublishStreamUrl methods.
    -152 The host publishes more than 10 URLs.
    Delete the unnecessary URLs before adding new ones.
    -153 The host manipulates other hosts' URLs.
    Check your app logic.
    -154 An error occurs in Agora's streaming server.
    Call the addPublishStreamUrl method to publish the streaming again.
    -155 The server fails to find the stream.
    -156 The format of the RTMP stream URL is not supported.
    Check whether the URL format is correct.
    -160 The client is already recording audio. To start a new recording, call stopAudioRecording to stop the current recording first, and then call startAudioRecording.
    -1001 Fails to load the media engine.
    -1002 Fails to start the call after enabling the media engine.
    -1003 DEPRECATED Please use error (4) in localVideoStateChanged instead.
    Fails to start the camera.
    -1004 Fails to start the video rendering module.
    -1005 Audio Device Module: A general error occurs (no specified reason).
    Check if the audio device is used by another application, or try rejoining the channel.
    -1006 Audio Device Module: An error occurs in using the Java resources.
    -1007 Audio Device Module: An error occurs in setting the sampling frequency.
    -1008 Audio Device Module: An error occurs in initializing the playback device.
    -1009 Audio Device Module: An error occurs in starting the playback device.
    -1010 Audio Device Module: An error occurs in stopping the playback device.
    -1011 Audio Device Module: An error occurs in initializing the recording device.
    -1012 Audio Device Module: An error occurs in starting the recording device.
    -1013 Audio Device Module: An error occurs in stopping the recording device.
    -1015 Audio Device Module: A playback error occurs.
    Check your playback device and try rejoining the channel.
    -1017 Audio Device Module: A recording error occurs.
    -1018 Audio Device Module: The recording fails.
    -1020 Audio Device Module: Abnormal audio playback frequency.
    -1021 Audio Device Module: Abnormal audio recording frequency.
    -1022 Audio Device Module: An error occurs in initializing the loopback device.
    -1023 Audio Device Module: An error occurs in starting the loopback device.
    -1027 Audio Device Module: No recording permission exists.
    Check if the recording permission is granted.
    -1033 Audio device module: The device is occupied.
    -1301 Audio device module: An audio driver abnomality or a compatibility issue occurs.
    Solutions: Disable and restart the audio device, or reboot the device.
    -1303 Audio device module: A recording driver abnomality or a compatibility issue occurs.
    Solutions: Disable and restart the audio device, or reboot the device.
    -1306 Audio device module: A playout driver abnomality or a compatibility issue occurs.
    Solutions: Disable and restart the audio device, or reboot the device.
    -1307 Audio device module: No audio device is available.
    Solutions: Plug in a proper audio device.
    -1309 Audio device module: An audio driver abnomality or a compatibility issue occurs.
    Solutions: Disable and restart the audio device, or reboot the device.
    -1311 Audio device module: Insufficient system memory or poor device performance.
    Solutions: Reboot the device or replace the device.
    -1314 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1319 Audio device module: Insufficient system memory or poor device performance.
    Solutions: Reboot the device or replace the device.
    -1320 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Replace the device.
  • -1322 Audio device module: No audio sampling device is available.
    Solutions: Plug in a proper recording device.
    -1323 Audio device module: No audio playout device is available.
    Solutions: Plug in a proper playback device.
    -1351 Audio device module: An audio driver abnormality or a compatibility issue occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1353 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1354 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1355 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1356 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1357 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1358 Audio device module: An audio driver abnormality occurs.
    Solutions:
  • Disable and then re-enable the audio device.
  • Reboot the device.
  • Upgrade your audio card driver.
  • -1359 Audio Device Module: No recording device exists.
    -1360 Audio Device Module: No playback device exists.
    -1501 Video Device Module: The camera is unauthorized.
    -1502 DEPRECATED Please use error (3) in localVideoStateChanged instead.
    Video Device Module: The camera is in use.
    -1600 Video Device Module: An unknown error occurs.
    -1601 Video Device Module: An error occurs in initializing the video encoder.
    The error is a serious error, please try to rejoin the channel.
    -1602 Video Device Module: An error occurs in encoding.
    The error is a serious error, please try to rejoin the channel.
    -1603 Video Device Module: An error occurs in setting the video encoder.