The Agora Flutter SDK wraps the Agora RTC SDKs for Android and iOS, with which you can quickly implement real-time communication functionality in Android and iOS apps developed using the Flutter framework.
- The RtcEngine class provides the main methods that can be invoked by your application.
- The RtcEngineEventHandler class enables callbacks to your application.
- The RtcChannel class provides methods that enable real-time communications in a specified channel. By creating multiple RtcChannel instances, users can join multiple channels.
- The RtcChannelEventHandler class provides callbacks that report events and statistics of a specified channel.
Core management
Method | Description |
---|---|
create | Creates an RtcEngine instance. |
createWithConfig | Creates an RtcEngine instance and specifies the connection area. |
createWithContext | Creates an RtcEngine instance and specifies one or multiple connection areas. |
destroy | Destroys the RtcEngine instance. |
setChannelProfile | Sets the channel profile of the Agora RtcEngine. |
setClientRole | Sets the role of a user in a live interactive streaming. |
joinChannel | Allows a user to join a channel. |
switchChannel | Switches to a different channel (LiveBroadcasting profile only). |
leaveChannel | Allows a user to leave a channel. |
destroy | Destroys the RtcChannel instance. |
renewToken | Renews the token. |
getConnectionState | Gets the connection state of the app. |
Core events
Event | Description |
---|---|
connectionStateChanged | Occurs when the network connection state changes. |
joinChannelSuccess | Occurs when a user joins a channel. |
rejoinChannelSuccess | Occurs when a user rejoins a channel. |
leaveChannel | Occurs when a user leaves a channel. |
clientRoleChanged | Occurs when the user role in a live streaming changes. |
userJoined | Occurs when a remote user joins a channel. |
userOffline | Occurs when a remote user leaves a channel or goes offline. |
networkTypeChanged | Occurs when the network type changes. |
connectionLost | Occurs when the SDK loses connection to the server. |
tokenPrivilegeWillExpire | Occurs when the token expires in 30 seconds. |
requestToken | Occurs when the token expires. |
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 recording volume. |
adjustUserPlaybackSignalVolume | Adjusts the playback volume of a specified remote user. |
adjustPlaybackSignalVolume | Adjusts the playback volume of all remote users. |
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. |
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. |
Local media events
Event | Description |
---|---|
localAudioStateChanged | Occurs when the local audio state changes. |
localVideoStateChanged | Occurs when the local video state changes. |
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. |
audioPublishStateChanged | Occurs when the audio publishing state changes. |
videoPublishStateChanged | Occurs when the video publishing state changes. |
Remote media events
Event | Description |
---|---|
remoteAudioStateChanged | Occurs when the remote audio state changes. |
remoteVideoStateChanged | Occurs when the remote video state changes. |
firstRemoteVideoFrame | Occurs when the first remote video frame is rendered. |
audioSubscribeStateChanged | Occurs when the audio subscribing state changes. |
videoSubscribeStateChanged | Occurs when the video subscribe state changes. |
Statistics events
After joining a channel, SDK triggers this group of callbacks once every two seconds.
Event | Description |
---|---|
RtcStats | Reports the statistics of RtcEngine. |
networkQuality | Reports the network quality of each user. |
localAudioStats | Reports the statistics of the local audio stream. |
localVideoStats | Reports the statistics of the uploading local video stream. |
remoteAudioStats | Reports the statistics of the audio stream from each remote user/host. |
remoteVideoStats | Reports the statistics of the video stream from each remote user/host. |
Video pre-process and post-process
Method | Description |
---|---|
setBeautyEffectOptions | Sets the image enhancement options. |
enableVirtualBackground | Enables/Disables the virtual background. (beta function) |
Event | Description |
---|---|
virtualBackgroundSourceEnabled | Reports whether the virtual background is successfully enabled. (beta function) |
Multi-channel management
Method | Description |
---|---|
create | Initializes and gets an RtcChannel instance. To join multiple channels,
create multiple RtcChannel objects. |
RtcChannel | Provides methods that enable real-time communications in a specified channel. |
RtcChannelEventHandler | Provides callbacks that report events and statistics in a specified channel. |
Audio file playback and mixing
Method | Description |
---|---|
startAudioMixing | Starts playing and mixing the music file. |
stopAudioMixing | Stops playing or mixing the music file. |
pauseAudioMixing | Pauses playing and mixing the music file. |
resumeAudioMixing | Resumes playing and mixing the music file. |
adjustAudioMixingVolume | Adjusts the volume of 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 | Gets the volume of audio mixing for local playback. |
getAudioMixingPublishVolume | Gets the volume of audio mixing for remote playback. |
getAudioMixingDuration | Gets the duration (ms) of the music file. |
getAudioMixingCurrentPosition | Gets the playback position (ms) of the music file. |
setAudioMixingPosition | Sets the playback starting position (ms) of the music file. |
Event | Description |
---|---|
audioMixingStateChanged | Occurs when the state of the local user's audio mixing file changes. |
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 a specified audio effect. |
playEffect | Plays a specified audio effect. |
setEffectPosition | Sets the playback position of an audio effect file. |
getEffectDuration | Gets the duration of the audio effect file. |
getEffectCurrentPosition | Gets the playback position of the audio effect file. |
stopEffect | Stops playing a specified audio effect. |
stopAllEffects | Stops playing all audio effects. |
preloadEffect | Preloads a specified audio effect file into the memory. |
unloadEffect | Releases a specified preloaded 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. |
Event | Description |
---|---|
audioEffectFinished | Occurs when the audio effect file playback finishes. |
Virtual metronome
Method | Description |
---|---|
startRhythmPlayer | Enables the virtual metronome. |
stopRhythmPlayer | Disables the virtual metronome. |
configRhythmPlayer | Configures the virtual metronome. |
Voice Effect
Method | Description |
---|---|
setAudioEffectPreset | Sets an SDK preset audio effect. |
setVoiceBeautifierPreset | Sets an SDK preset voice beautifier effect. |
setVoiceBeautifierParameters | Sets parameters for SDK preset voice beautifier effects. |
setAudioEffectParameters | Sets parameters for SDK preset audio effects. |
setLocalVoicePitch | Sets the voice pitch of the local speaker. |
setLocalVoiceEqualization | Sets the local voice equalization effect. |
setLocalVoiceReverb | Sets the local voice reverberation. |
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. |
CDN publisher
This group of methods apply to LiveBroadcasting
profile only.
Method | Description |
---|---|
setLiveTranscoding | Sets the video layout and audio settings for CDN live. |
addPublishStreamUrl | Publishes the local stream to the CDN. |
removePublishStreamUrl | Removes an RTMP or RTMPS stream from the CDN. |
Event | Description |
---|---|
rtmpStreamingStateChanged | Occurs when the state of the RTMP or RTMPS streaming changes. |
transcodingUpdated | Occurs when the publisher's transcoding settings are updated. |
rtmpStreamingEvent | Reports events during the RTMP or RTMPS streaming. |
Channel Media Relay
Method | Description |
---|---|
startChannelMediaRelay | Starts to relay media streams across channels. |
updateChannelMediaRelay | Updates the channels for media stream relay. |
stopChannelMediaRelay | Stops the media stream relay. |
stopChannelMediaRelay | Stops the media stream relay. |
Event | Description |
---|---|
channelMediaRelayStateChanged | Occurs when the state of the media stream relay changes. |
channelMediaRelayEvent | Reports events during the media stream relay. |
Audio volume indication
Method | Description |
---|---|
enableAudioVolumeIndication | Enables the audioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume. |
Event | Description |
---|---|
audioVolumeIndication | Reports which users are speaking and the speakers' volume, and whether the local user is speaking. |
activeSpeaker | Reports which user is the loudest speaker. |
Face detection
Method | Description |
---|---|
enableFaceDetection | Enables/Disables face detection for the local user. |
Event | Description |
---|---|
facePositionChanged | Reports the face detection result of the local user. |
Audio routing control
Method | Description |
---|---|
setDefaultAudioRoutetoSpeakerphone | Sets the default audio playback route. |
setEnableSpeakerphone | Enables/Disables the audio playback route to the speakerphone. |
isSpeakerphoneEnabled | Checks whether the speakerphone is enabled. |
Event | Description |
---|---|
audioRouteChanged | Occurs when the local audio playback route changes. |
In-ear monitoring
Method | Description |
---|---|
enableInEarMonitoring | Enables in-ear monitoring. |
setInEarMonitoringVolume | Sets the volume of the in-ear monitor. |
Dual video stream mode
Method | Description |
---|---|
enableDualStreamMode | Enables/disables dual video stream mode. |
setRemoteVideoStreamType | Sets the video stream type of the remotely subscribed video stream. |
setRemoteDefaultVideoStreamType | Sets the default video stream type of the remotely subscribed video stream. |
Stream fallback
Method | Description |
---|---|
setLocalPublishFallbackOption | Sets the fallback option for the locally published video stream under unreliable network conditions. |
setRemoteSubscribeFallbackOption | Sets the fallback option for the remotely subscribed video stream under unreliable network conditions. |
setRemoteUserPriority | Sets the priority of a remote user's stream. |
Event | Description |
---|---|
localPublishFallbackToAudioOnly | Occurs when the locally published video stream falls back to audio only due to poor network conditions or switches back to the video stream after the network conditions improve. |
remoteSubscribeFallbackToAudioOnly | Occurs when the remotely subscribed video stream falls back to audio ly due to poor network conditions or switches back to the video stream after the network conditions improve. |
Pre-call network test
Method | Description |
---|---|
startEchoTest | Starts an audio call 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 probe test. |
stopLastmileProbeTest | Stops the last-mile probe test. |
Event | Description |
---|---|
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. |
Media metadata
This group of methods apply to LiveBroadcasting
profile only.
Method | Description |
---|---|
registerMediaMetadataObserver | Registers a media metadata observer object. |
setMaxMetadataSize | Sets the maximum size of the metadata. |
sendMetadata | Sends the metadata. |
unregisterMediaMetadataObserver | Unregisters the metadata observer. |
Watermark
This group of methods apply to LiveBroadcasting
profile only.
Method | Description |
---|---|
addVideoWatermark | Adds a watermark image to the local video. |
clearVideoWatermarks | Removes the added watermark image from the 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 the audio recording on the client. |
Camera control
Method | Description |
---|---|
switchCamera | Switches between front and rear cameras. |
isCameraZoomSupported | Checks whether the camera zoom function is supported. |
isCameraTorchSupported | Checks whether the camera flash function is supported. |
isCameraFocusSupported | Checks whether the camera manual focus function is supported. |
isCameraExposurePositionSupported | Checks whether the camera exposure function is supported. |
isCameraAutoFocusFaceModeSupported | Checks whether the camera face auto-focus function is supported. |
setCameraZoomFactor | Sets the camera zoom ratio. |
getCameraMaxZoomFactor | Gets the maximum zoom ratio of the camera. |
setCameraFocusPositionInPreview | Sets the camera manual focus position. |
setCameraExposurePosition | Sets the camera exposure position. |
setCameraTorchOn | Enables the camera flash function. |
setCameraAutoFocusFaceModeEnabled | Enables the camera auto-face focus function. |
Event | Description |
---|---|
cameraFocusAreaChanged | Occurs when the camera focus area changes. |
cameraExposureAreaChanged | Occurs when the camera exposure area changes. |
Stream message
Method | Description |
---|---|
createDataStreamWithConfig | Creates a data stream. |
sendStreamMessage | Sends data stream messages. |
Event | Description |
---|---|
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. |
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. |
getCallId | Gets the current call ID. |
rate | Allows a user to rate a call after the call ends. |
complain | Allows a user to complain about the call quality after a call ends. |
getSdkVersion | Gets the Agora SDK version. |
getErrorDescription | Retrieves the description of a warning or error code. |
Miscellaneous events
Event | Description |
---|---|
warning | Occurs when a warning occurs. |
error | Occurs when an error occurs. |
apiCallExecuted | Occurs when an API method is executed. |