Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtc2.RtcEngineEx Class Referenceabstract
Inheritance diagram for io.agora.rtc2.RtcEngineEx:
io.agora.rtc2.RtcEngine io.agora.rtc2.RtcEngineInternal

Public Member Functions

abstract int muteRemoteAudioStreamEx (int uid, boolean muted, RtcConnection connection)
 
abstract int muteRemoteVideoStreamEx (int uid, boolean muted, RtcConnection connection)
 
abstract int setRemoteRenderModeEx (int uid, int renderMode, int mirrorMode, RtcConnection connection)
 
abstract int setupRemoteVideoEx (VideoCanvas remote, RtcConnection connection)
 
abstract int setVideoEncoderConfigurationEx (VideoEncoderConfiguration config, RtcConnection connection)
 
abstract int updateChannelMediaOptionsEx (ChannelMediaOptions options, RtcConnection connection)
 
abstract int joinChannelEx (String token, RtcConnection connection, ChannelMediaOptions options, IRtcEngineEventHandler eventHandler)
 
abstract int leaveChannelEx (RtcConnection connection)
 
abstract int pushExternalVideoFrameEx (VideoFrame frame, RtcConnection connection)
 
abstract int pushExternalVideoFrameEx (AgoraVideoFrame frame, RtcConnection connection)
 
abstract int enableDualStreamModeEx (Constants.VideoSourceType sourceType, boolean enabled, SimulcastStreamConfig streamConfig, RtcConnection connection)
 
abstract int pushExternalEncodedVideoFrameEx (ByteBuffer data, EncodedVideoFrameInfo frameInfo, RtcConnection connection)
 
abstract RtcConnection.CONNECTION_STATE_TYPE getConnectionStateEx (RtcConnection connection)
 
abstract int sendCustomReportMessageEx (String id, String category, String event, String label, int value, RtcConnection connection)
 
abstract int sendStreamMessageEx (int streamId, byte[] message, RtcConnection connection)
 
abstract int createDataStreamEx (boolean reliable, boolean ordered, RtcConnection connection)
 
abstract int createDataStreamEx (DataStreamConfig config, RtcConnection connection)
 
abstract int joinChannelWithUserAccountEx (String token, String channelId, String userAccount, ChannelMediaOptions options, IRtcEngineEventHandler eventHandler)
 
abstract UserInfo getUserInfoByUserAccount (String userAccount, String channelId, String localUserAccount)
 
abstract UserInfo getUserInfoByUid (int uid, String channelId, String localUserAccount)
 
abstract int setRemoteVoicePositionEx (int uid, double pan, double gain, RtcConnection connection)
 
abstract int setRemoteVoice3DPositionEx (int uid, double azimuth, double elevation, double distance, RtcConnection connection)
 
abstract int addVideoWatermarkEx (String watermarkUrl, WatermarkOptions options, RtcConnection connection)
 
abstract int clearVideoWatermarkEx (RtcConnection connection)
 
- Public Member Functions inherited from io.agora.rtc2.RtcEngine
abstract int setChannelProfile (int profile)
 
abstract int setClientRole (int role)
 
abstract int setClientRole (int role, ClientRoleOptions options)
 
abstract int sendCustomReportMessage (String id, String category, String event, String label, int value)
 
abstract int joinChannel (String token, String channelName, String optionalInfo, int optionalUid)
 
abstract int joinChannel (String token, String channelId, int uid, ChannelMediaOptions options)
 
abstract int leaveChannel ()
 
abstract int leaveChannel (LeaveChannelOptions options)
 
abstract int renewToken (String token)
 
abstract int registerLocalUserAccount (String appId, String userAccount)
 
abstract int joinChannelWithUserAccount (String token, String channelName, String userAccount)
 
abstract int joinChannelWithUserAccount (String token, String channelName, String userAccount, ChannelMediaOptions options)
 
abstract UserInfo getUserInfoByUserAccount (String userAccount)
 
abstract UserInfo getUserInfoByUid (int uid)
 
abstract int enableWebSdkInteroperability (boolean enabled)
 
abstract RtcConnection.CONNECTION_STATE_TYPE getConnectionState ()
 
abstract int enableAudio ()
 
abstract int disableAudio ()
 
abstract int pauseAudio ()
 
abstract int resumeAudio ()
 
abstract int setAudioProfile (int profile)
 
abstract int setAudioProfile (int profile, int scenario)
 
abstract int setHighQualityAudioParameters (boolean fullband, boolean stereo, boolean fullBitrate)
 
abstract int adjustRecordingSignalVolume (int volume)
 
abstract int adjustPlaybackSignalVolume (int volume)
 
abstract int enableAudioVolumeIndication (int interval, int smooth)
 
abstract int enableAudioQualityIndication (boolean enabled)
 
abstract int enableLocalAudio (boolean enabled)
 
abstract int muteLocalAudioStream (boolean muted)
 
abstract int muteRemoteAudioStream (int uid, boolean muted)
 
abstract int adjustUserPlaybackSignalVolume (int uid, int volume)
 
abstract int muteAllRemoteAudioStreams (boolean muted)
 
abstract int setDefaultMuteAllRemoteAudioStreams (boolean muted)
 
abstract int enableVideo ()
 
abstract int disableVideo ()
 
abstract int setVideoProfile (int profile, boolean swapWidthAndHeight)
 
abstract int setVideoEncoderConfiguration (VideoEncoderConfiguration config)
 
abstract int setCameraCapturerConfiguration (CameraCapturerConfiguration config)
 
abstract int setupLocalVideo (VideoCanvas local)
 
abstract int setupRemoteVideo (VideoCanvas remote)
 
abstract int setLocalRenderMode (int renderMode)
 
abstract int setLocalRenderMode (int renderMode, int mirrorMode)
 
abstract int setRemoteRenderMode (int userId, int renderMode)
 
abstract int setRemoteRenderMode (int userId, int renderMode, int mirrorMode)
 
abstract int startPreview ()
 
abstract int startPreview (Constants.VideoSourceType sourceType)
 
abstract int stopPreview ()
 
abstract int stopPreview (Constants.VideoSourceType sourceType)
 
abstract int enableLocalVideo (boolean enabled)
 
abstract int startSecondaryCameraCapture (CameraCapturerConfiguration config)
 
abstract int stopSecondaryCameraCapture ()
 
abstract int muteLocalVideoStream (boolean muted)
 
abstract int muteRemoteVideoStream (int userId, boolean muted)
 
abstract int muteAllRemoteVideoStreams (boolean muted)
 
abstract int setDefaultMuteAllRemoteVideoStreams (boolean muted)
 
abstract int setBeautyEffectOptions (boolean enabled, BeautyOptions options)
 
abstract int setDefaultAudioRoutetoSpeakerphone (boolean defaultToSpeaker)
 
abstract int setEnableSpeakerphone (boolean enabled)
 
abstract boolean isSpeakerphoneEnabled ()
 
abstract int enableInEarMonitoring (boolean enabled)
 
abstract int enableInEarMonitoring (boolean enabled, int includeAudioFilters)
 
abstract int setInEarMonitoringVolume (int volume)
 
abstract int useExternalAudioDevice ()
 
abstract int setLocalVoicePitch (double pitch)
 
abstract int setLocalVoiceEqualization (Constants.AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)
 
abstract int setLocalVoiceReverb (Constants.AUDIO_REVERB_TYPE reverbKey, int value)
 
abstract int setLocalVoiceChanger (int voiceChanger)
 
abstract int setLocalVoiceReverbPreset (int reverbPreset)
 
abstract int setAudioEffectPreset (int preset)
 
abstract int setVoiceBeautifierPreset (int preset)
 
abstract int setVoiceConversionPreset (int preset)
 
abstract int setAudioEffectParameters (int preset, int param1, int param2)
 
abstract int setVoiceBeautifierParameters (int preset, int param1, int param2)
 
abstract int setVoiceConversionParameters (int preset, int param1, int param2)
 
abstract int enableSoundPositionIndication (boolean enabled)
 
abstract int setRemoteVoicePosition (int uid, double pan, double gain)
 
abstract int setRemoteVoice3DPosition (int uid, double azimuth, double elevation, double distance)
 
abstract int startAudioMixing (String filePath, boolean loopback, boolean replace, int cycle)
 
abstract int stopAudioMixing ()
 
abstract int pauseAudioMixing ()
 
abstract int resumeAudioMixing ()
 
abstract int adjustAudioMixingVolume (int volume)
 
abstract int adjustAudioMixingPlayoutVolume (int volume)
 
abstract int adjustAudioMixingPublishVolume (int volume)
 
abstract int getAudioMixingPlayoutVolume ()
 
abstract int getAudioMixingPublishVolume ()
 
abstract int getAudioMixingDuration ()
 
abstract int getAudioMixingCurrentPosition ()
 
abstract int setAudioMixingPosition (int pos)
 
abstract IAudioEffectManager getAudioEffectManager ()
 
abstract int startAudioRecording (String filePath, int quality)
 
abstract int startAudioRecording (AudioFileRecordingConfig config)
 
abstract int stopAudioRecording ()
 
abstract int startEchoTest ()
 
abstract int startEchoTest (int intervalInSeconds)
 
abstract int stopEchoTest ()
 
abstract int startLastmileProbeTest (LastmileProbeConfig config)
 
abstract int stopLastmileProbeTest ()
 
abstract int setExternalAudioSink (int sampleRate, int channels)
 
abstract int pullPlaybackAudioFrame (byte[] data, int lengthInByte)
 
abstract int pullPlaybackAudioFrame (ByteBuffer data, int lengthInByte)
 
abstract int setExternalAudioSource (boolean enabled, int sampleRate, int channels)
 
abstract int setExternalAudioSource (boolean enabled, int sampleRate, int channels, int sourceNumber, boolean localPlayback, boolean publish)
 
abstract int pushExternalAudioFrame (byte[] data, long timestamp)
 
abstract int pushExternalAudioFrame (ByteBuffer data, long timestamp, int sourceId)
 
abstract int setExternalVideoSource (boolean enable, boolean useTexture, boolean encodedFrame)
 
abstract boolean pushExternalVideoFrame (AgoraVideoFrame frame)
 
abstract boolean pushExternalVideoFrame (VideoFrame frame)
 
abstract int pushExternalEncodedVideoFrame (ByteBuffer data, EncodedVideoFrameInfo frameInfo)
 
abstract boolean isTextureEncodeSupported ()
 
abstract int registerAudioFrameObserver (IAudioFrameObserver observer)
 
abstract int registerAudioEncodedFrameObserver (AudioEncodedFrameObserverConfig config, IAudioEncodedFrameObserver observer)
 
abstract int setRecordingAudioFrameParameters (int sampleRate, int channel, int mode, int samplesPerCall)
 
abstract int setPlaybackAudioFrameParameters (int sampleRate, int channel, int mode, int samplesPerCall)
 
abstract int setMixedAudioFrameParameters (int sampleRate, int channel, int samplesPerCall)
 
abstract int addVideoWatermark (AgoraImage watermark)
 
abstract int addVideoWatermark (String watermarkUrl, WatermarkOptions options)
 
abstract int clearVideoWatermarks ()
 
abstract int setRemoteUserPriority (int uid, int userPriority)
 
abstract int setLocalPublishFallbackOption (int option)
 
abstract int setRemoteSubscribeFallbackOption (int option)
 
abstract int enableDualStreamMode (boolean enabled)
 
abstract int enableDualStreamMode (Constants.VideoSourceType sourceType, boolean enabled)
 
abstract int enableDualStreamMode (Constants.VideoSourceType sourceType, boolean enabled, SimulcastStreamConfig streamConfig)
 
abstract int setRemoteVideoStreamType (int uid, int streamType)
 
abstract int setRemoteDefaultVideoStreamType (int streamType)
 
abstract int setEncryptionSecret (String secret)
 
abstract int setEncryptionMode (String encryptionMode)
 
abstract int enableEncryption (boolean enabled, EncryptionConfig config)
 
abstract int addInjectStreamUrl (String url, LiveInjectStreamConfig config)
 
abstract int removeInjectStreamUrl (String url)
 
abstract int addPublishStreamUrl (String url, boolean transcodingEnabled)
 
abstract int removePublishStreamUrl (String url)
 
abstract int setLiveTranscoding (LiveTranscoding transcoding)
 
abstract int createDataStream (boolean reliable, boolean ordered)
 
abstract int createDataStream (DataStreamConfig config)
 
abstract int sendStreamMessage (int streamId, byte[] message)
 
abstract int setVideoQualityParameters (boolean preferFrameRateOverImageQuality)
 
abstract int setLocalVideoMirrorMode (int mode)
 
abstract int switchCamera ()
 
abstract boolean isCameraZoomSupported ()
 
abstract boolean isCameraTorchSupported ()
 
abstract boolean isCameraFocusSupported ()
 
abstract boolean isCameraExposurePositionSupported ()
 
abstract boolean isCameraAutoFocusFaceModeSupported ()
 
abstract boolean isCameraFaceDetectSupported ()
 
abstract int setCameraZoomFactor (float factor)
 
abstract float getCameraMaxZoomFactor ()
 
abstract int setCameraFocusPositionInPreview (float positionX, float positionY)
 
abstract int setCameraExposurePosition (float positionXinView, float positionYinView)
 
abstract int enableFaceDetection (boolean enabled)
 
abstract int setCameraTorchOn (boolean isOn)
 
abstract int setCameraAutoFocusFaceModeEnabled (boolean enabled)
 
abstract String getCallId ()
 
abstract int rate (String callId, int rating, String description)
 
abstract int complain (String callId, String description)
 
abstract int setLogFile (String filePath)
 
abstract int setLogFilter (int filter)
 
abstract int setLogLevel (int level)
 
abstract int setLogFileSize (long fileSizeInKBytes)
 
abstract long getNativeHandle ()
 
abstract long getNativeMediaPlayer (int sourceId)
 
void addHandler (IRtcEngineEventHandler handler)
 
void removeHandler (IRtcEngineEventHandler handler)
 
abstract boolean enableHighPerfWifiMode (boolean enable)
 
abstract void monitorHeadsetEvent (boolean monitor)
 
abstract void monitorBluetoothHeadsetEvent (boolean monitor)
 
abstract void setPreferHeadset (boolean enabled)
 
abstract int setParameters (String parameters)
 
abstract String getParameter (String parameter, String args)
 
abstract int registerMediaMetadataObserver (IMetadataObserver observer, int type)
 
abstract int unregisterMediaMetadataObserver (IMetadataObserver observer, int type)
 
abstract int startChannelMediaRelay (ChannelMediaRelayConfiguration channelMediaRelayConfiguration)
 
abstract int stopChannelMediaRelay ()
 
abstract int updateChannelMediaRelay (ChannelMediaRelayConfiguration channelMediaRelayConfiguration)
 
abstract int updateChannelMediaOptions (ChannelMediaOptions options)
 
abstract int startRecordingService (String recordingKey)
 
abstract int stopRecordingService (String recordingKey)
 
abstract int refreshRecordingServiceStatus ()
 
abstract int muteRecordingSignal (boolean muted)
 
abstract int startPlayingStream (String url)
 
abstract int stopPlayingStream ()
 
abstract int setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel)
 
abstract int enableAudioSpectrumMonitor (int intervalInMS)
 
abstract int disableAudioSpectrumMonitor ()
 
abstract int registerAudioSpectrumObserver (IAudioSpectrumObserver observer)
 
abstract int unRegisterAudioSpectrumObserver (IAudioSpectrumObserver observer)
 
abstract double getEffectsVolume ()
 
abstract int setEffectsVolume (double volume)
 
abstract int preloadEffect (int soundId, String filePath)
 
abstract int playEffect (int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish)
 
abstract int playAllEffects (int loopCount, double pitch, double pan, double gain, boolean publish)
 
abstract int getVolumeOfEffect (int soundId)
 
abstract int setVolumeOfEffect (int soundId, double volume)
 
abstract int pauseEffect (int soundId)
 
abstract int pauseAllEffects ()
 
abstract int resumeEffect (int soundId)
 
abstract int resumeAllEffects ()
 
abstract int stopEffect (int soundId)
 
abstract int stopAllEffects ()
 
abstract int unloadEffect (int soundId)
 
abstract int unloadAllEffects ()
 
abstract int configPublisher (PublisherConfiguration config)
 
abstract int setVideoCompositingLayout (VideoCompositingLayout layout)
 
abstract int clearVideoCompositingLayout ()
 
abstract int registerVideoEncodedImageReceiver (IVideoEncodedImageReceiver receiver)
 
abstract int takeSnapshot (int uid, String filePath)
 
abstract int enableContentInspect (boolean enabled, ContentInspectConfig config)
 
abstract int setAudioOptionParams (String params)
 
abstract String getAudioOptionParams ()
 
abstract int setAudioSessionParams (String params)
 
abstract String getAudioSessionParams ()
 
abstract int enableExtension (String vendor, String extension, boolean enable)
 
abstract int enableExtension (String vendor, String extension, boolean enable, Constants.MediaSourceType sourceType)
 
abstract int setExtensionProperty (String vendor, String extension, String key, String value)
 
abstract int setExtensionProperty (String vendor, String extension, String key, String value, Constants.MediaSourceType sourceType)
 
abstract int setExtensionProviderProperty (String vendor, String key, String value)
 
abstract int startScreenCapture (Intent mediaProjectionPermissionResultData, ScreenCaptureParameters parameters)
 
abstract int stopScreenCapture ()
 
abstract int registerVideoFrameObserver (IVideoFrameObserver observer)
 
abstract IMediaPlayer createMediaPlayer ()
 
abstract int enableExternalAudioSourceLocalPlayback (boolean enabled)
 

Additional Inherited Members

- Static Public Member Functions inherited from io.agora.rtc2.RtcEngine
static synchronized RtcEngine create (Context context, String appId, IRtcEngineEventHandler handler) throws Exception
 
static synchronized RtcEngine create (RtcEngineConfig config) throws Exception
 
static synchronized boolean loadExtension (String name)
 
static synchronized void destroy ()
 
static SurfaceView CreateRendererView (Context context)
 
static TextureView CreateTextureView (Context context)
 
static int getRecommendedEncoderType ()
 
static String getSdkVersion ()
 
static String getMediaEngineVersion ()
 
static String getErrorDescription (int error)
 
- Static Protected Attributes inherited from io.agora.rtc2.RtcEngine
static RtcEngineImpl mInstance = null
 

Member Function Documentation

◆ muteRemoteAudioStreamEx()

abstract int io.agora.rtc2.RtcEngineEx.muteRemoteAudioStreamEx ( int  uid,
boolean  muted,
RtcConnection  connection 
)
abstract

Stops or resumes receiving the audio stream of a specified user with specified connection.

Note
Once you leave the channel, the settings in this method becomes invalid.
Parameters
uidID of the specified remote user.
muteDetermines whether to receive or stop receiving the specified audio stream:
  • true: Stop receiving the specified audio stream.
  • false: (Default) Receive the specified audio stream.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteRemoteVideoStreamEx()

abstract int io.agora.rtc2.RtcEngineEx.muteRemoteVideoStreamEx ( int  uid,
boolean  muted,
RtcConnection  connection 
)
abstract

Stops or resumes receiving the video stream of a specified user with specified connection.

Note
Once you leave the channel, the settings in this method becomes invalid.
Parameters
uidID of the specified remote user.
mutedDetermines whether to receive or stop receiving a specified video stream:
  • true: Stop receiving the specified video stream.
  • false: (Default) Receive the specified video stream.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteRenderModeEx()

abstract int io.agora.rtc2.RtcEngineEx.setRemoteRenderModeEx ( int  uid,
int  renderMode,
int  mirrorMode,
RtcConnection  connection 
)
abstract

Updates the display mode of the video view of a remote user with the specified connection.

After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.

Note
  • Ensure that you have called setupRemoteVideo to initialize the remote video view before calling this method.
  • During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user.
Parameters
uidID of the remote user.
renderModeSets the remote display mode:
  • RENDER_MODE_HIDDEN(1): Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.
  • RENDER_MODE_FIT(2): Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio will be filled with black.
mirrorModeSets the remote video mirror mode:
  • VIDEO_MIRROR_MODE_ENABLED(1): Enable the mirror mode.
  • VIDEO_MIRROR_MODE_DISABLED(2): Disable the mirror mode.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setupRemoteVideoEx()

abstract int io.agora.rtc2.RtcEngineEx.setupRemoteVideoEx ( VideoCanvas  remote,
RtcConnection  connection 
)
abstract

Initializes the video view of a remote user with a specified connection ID.

This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees.

Usually the app should specify the uid of the remote video in the method call before the remote user joins the channel. If the remote uid is unknown to the app, set it later when the app receives the onUserJoined callback.

To unbind the remote user from the view, set view in VideoCanvas as null.

Note
Ensure that you call this method in the UI thread.
Parameters
remoteThe remote video view settings: VideoCanvas.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoEncoderConfigurationEx()

abstract int io.agora.rtc2.RtcEngineEx.setVideoEncoderConfigurationEx ( VideoEncoderConfiguration  config,
RtcConnection  connection 
)
abstract

Sets the video encoder configuration with specified connection.

Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.

The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.

Parameters
configThe local video encoder configuration: VideoEncoderConfiguration.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ updateChannelMediaOptionsEx()

abstract int io.agora.rtc2.RtcEngineEx.updateChannelMediaOptionsEx ( ChannelMediaOptions  options,
RtcConnection  connection 
)
abstract

Updates the media options after joining the channel with specified connection.

Parameters
optionsThe channel media options: ChannelMediaOptions.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ joinChannelEx()

abstract int io.agora.rtc2.RtcEngineEx.joinChannelEx ( String  token,
RtcConnection  connection,
ChannelMediaOptions  options,
IRtcEngineEventHandler  eventHandler 
)
abstract

Joins a channel with the connection ID.

You can call this method multiple times to join more than one channels at a time.

Parameters
tokenThe token for authentication:
  • In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token.
  • In situations requiring high security: Set it as the token generated at your server. For details, see Get a token.
connectionRtcConnection is used to control different connection instances
  • when you join the same channel multiple times
optionsThe channel media options: ChannelMediaOptions.
eventHandlerThe pointer to the IRtcEngine event handler: IRtcEngineEventHandler.
Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveChannelEx()

abstract int io.agora.rtc2.RtcEngineEx.leaveChannelEx ( RtcConnection  connection)
abstract

Leaves the channel with the specified connection ID.

Parameters
connectionRtcConnection is used to control different connection instances
  • when you join the same channel multiple times
Returns
  • 0: Success.
  • < 0: Failure.

◆ pushExternalVideoFrameEx() [1/2]

abstract int io.agora.rtc2.RtcEngineEx.pushExternalVideoFrameEx ( VideoFrame  frame,
RtcConnection  connection 
)
abstract

Pushes the external video frame to the app.

Note
Ensure that you call setExternalVideoSource before calling this method.
Parameters
frameThe external video frame: VideoFrame.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ pushExternalVideoFrameEx() [2/2]

abstract int io.agora.rtc2.RtcEngineEx.pushExternalVideoFrameEx ( AgoraVideoFrame  frame,
RtcConnection  connection 
)
abstract

Pushes the external video frame to the app with specified connection.

Note
Ensure that you call setExternalVideoSource before calling this method.
Parameters
frameThe external video frame: ExternalVideoFrame.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success, which means that the external video frame is pushed successfully.
  • < 0: Failure, which means that the external video frame fails to be pushed.

◆ enableDualStreamModeEx()

abstract int io.agora.rtc2.RtcEngineEx.enableDualStreamModeEx ( Constants.VideoSourceType  sourceType,
boolean  enabled,
SimulcastStreamConfig  streamConfig,
RtcConnection  connection 
)
abstract

Enables or disables the dual video stream mode.

If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.

Parameters
sourceType
  • The video source type.
enabled
  • true: Enable the dual-stream mode.
  • false: (default) Disable the dual-stream mode.
streamConfig
  • The minor stream config
connection
  • An output parameter which is used to control different connection instances.

◆ pushExternalEncodedVideoFrameEx()

abstract int io.agora.rtc2.RtcEngineEx.pushExternalEncodedVideoFrameEx ( ByteBuffer  data,
EncodedVideoFrameInfo  frameInfo,
RtcConnection  connection 
)
abstract

Pushes the encoded external video frame to the app with specified connection.

Note
Ensure that you call setExternalVideoSource before calling this method.
Parameters
dataThe encoded external video data, which must be the direct buffer.
frameInfoThe encoded external video frame info: {EncodedVideoFrameInfo}. connection The connection. Use the connection you use when calling joinChannelEx. If you use joinChannel, use DEFAULT_CONNECTION_ID(0). 0: Success, which means that the encoded external video frame is pushed successfully.< 0: Failure, which means that the encoded external video frame fails to be pushed.

◆ getConnectionStateEx()

abstract RtcConnection.CONNECTION_STATE_TYPE io.agora.rtc2.RtcEngineEx.getConnectionStateEx ( RtcConnection  connection)
abstract

Gets the connection state of the SDK.

Parameters
connectionRtcConnection is used to control different connection instances.
Returns
The connection state:

◆ sendCustomReportMessageEx()

abstract int io.agora.rtc2.RtcEngineEx.sendCustomReportMessageEx ( String  id,
String  category,
String  event,
String  label,
int  value,
RtcConnection  connection 
)
abstract

Report custom event to argus.

Parameters
idCustom Event ID
categoryCustom Event category
eventCustom Event to report
labelCustom Event label
valueCustom Event value
connectionThe connection ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ sendStreamMessageEx()

abstract int io.agora.rtc2.RtcEngineEx.sendStreamMessageEx ( int  streamId,
byte[]  message,
RtcConnection  connection 
)
abstract

Sends data stream messages to all users in a channel.

Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB. The API controls the data channel transfer rate. Each client can send up to 6 kB of data per second. Each user can have up to five data channels simultaneously.

Parameters
streamIdStream ID
messageData to be sent.
connectionConnection ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ createDataStreamEx() [1/2]

abstract int io.agora.rtc2.RtcEngineEx.createDataStreamEx ( boolean  reliable,
boolean  ordered,
RtcConnection  connection 
)
abstract

Creates a data stream.

Each user can only have up to five data channels at the same time.

Parameters
reliable
  • True: The recipients will receive data from the sender within 5 seconds. If the recipient does not receive the sent data within 5 seconds, the data channel will report an error to the application.
  • False: The recipients will not receive any data, and it will not report any error upon data missing.
ordered
  • True: The recipients will receive data in the order of the sender.
  • False: The recipients will not receive data in the order of the sender.
Returns
  • > 0: the Stream ID when the data stream is created.
  • < 0: an error code when it fails to create the data srteam.

◆ createDataStreamEx() [2/2]

abstract int io.agora.rtc2.RtcEngineEx.createDataStreamEx ( DataStreamConfig  config,
RtcConnection  connection 
)
abstract

Creates a data stream.

Each user can create up to five data streams during the lifecycle of the RtcEngine.

Parameters
configThe config of data stream.
Returns

◆ joinChannelWithUserAccountEx()

abstract int io.agora.rtc2.RtcEngineEx.joinChannelWithUserAccountEx ( String  token,
String  channelId,
String  userAccount,
ChannelMediaOptions  options,
IRtcEngineEventHandler  eventHandler 
)
abstract

Joins the channel with a user account.

After the user successfully joins the channel, the SDK triggers the following callbacks:

  • The local client: onLocalUserRegistered and onJoinChannelSuccess . The remote client: onUserJoined and onUserInfoUpdated , if the user joining the channel is in the COMMUNICATION profile, or is a host in the LIVE_BROADCASTING profile.
Note
To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type.
Parameters
tokenThe token generated at your server:
  • For low-security requirements: You can use the temporary token generated at Console. For details, see Get a temporary toke.
  • For high-security requirements: Set it as the token generated at your server. For details, see Get a token.
channelIdThe channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
userAccountThe user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
optionsThe channel media options: ChannelMediaOptions
Returns
  • 0: Success.
  • < 0: Failure.
    • #ERR_INVALID_ARGUMENT (-2)
    • #ERR_NOT_READY (-3)
    • #ERR_REFUSED (-5)

◆ getUserInfoByUserAccount()

abstract UserInfo io.agora.rtc2.RtcEngineEx.getUserInfoByUserAccount ( String  userAccount,
String  channelId,
String  localUserAccount 
)
abstract

Gets the user information by passing in the user account.

After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo), and triggers the onUserInfoUpdated callback on the local client.

After receiving the oonUserInfoUpdated callback, you can call this method to get the user ID of the remote user from the userInfo object by passing in the user account.

Parameters
userAccountThe user account of the user. Ensure that you set this parameter.
channelIdThe channel name.
localUserAccountThe user account of the local user.
Returns
userInfo A userInfo object that identifies the user
  • not null: Success.
  • null: Failure.

◆ getUserInfoByUid()

abstract UserInfo io.agora.rtc2.RtcEngineEx.getUserInfoByUid ( int  uid,
String  channelId,
String  localUserAccount 
)
abstract

Gets the user information by passing in the user ID.

After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo), and triggers the onUserInfoUpdated callback on the local client.

After receiving the onUserInfoUpdated callback, you can call this method to get the user account of the remote user from the userInfo object by passing in the user ID.

Parameters
uidThe user ID of the remote user. Ensure that you set this parameter.
channelIdThe channel name.
localUserAccountThe user account of the local user.
Returns
userInfo A userInfo object that identifies the user
  • not null: Success.
  • null: Failure.

◆ setRemoteVoicePositionEx()

abstract int io.agora.rtc2.RtcEngineEx.setRemoteVoicePositionEx ( int  uid,
double  pan,
double  gain,
RtcConnection  connection 
)
abstract

Sets the sound position and gain of a remote user. When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.

Note
  • For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel.
  • This method requires hardware support. For the best sound positioning, we recommend using a wired headset.
  • Ensure that you call this method after joining a channel.
Parameters
uidThe ID of the remote user.
panThe sound position of the remote user. The value ranges from -1.0 to 1.0:
  • 0.0: the remote sound comes from the front.
  • -1.0: the remote sound comes from the left.
  • 1.0: the remote sound comes from the right.
gainGain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain.
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteVoice3DPositionEx()

abstract int io.agora.rtc2.RtcEngineEx.setRemoteVoice3DPositionEx ( int  uid,
double  azimuth,
double  elevation,
double  distance,
RtcConnection  connection 
)
abstract

Sets the 3D sound position of a remote user.

Note
  • For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel.
  • This method requires hardware support. For the best sound positioning, we recommend using a wired headset.
  • Ensure that you call this method after joining a channel.
Parameters
uidThe ID of the remote user.
azimuth
elevation
distance
connectionRtcConnection is used to control different connection instances.
Returns
  • 0: Success.
  • < 0: Failure.

◆ addVideoWatermarkEx()

abstract int io.agora.rtc2.RtcEngineEx.addVideoWatermarkEx ( String  watermarkUrl,
WatermarkOptions  options,
RtcConnection  connection 
)
abstract

Adds a watermark image to the local video.

Since
v2.9.1 to replace addVideoWatermark1.

This method adds a PNG watermark image to the local video stream in a live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the sampling device can see and capture it.

Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.

The watermark position depends on the settings in the {setVideoEncoderConfiguration} method:If the orientation mode of the encoding video is ORIENTATION_MODE_FIXED_LANDSCAPE, or the landscape mode in ORIENTATION_MODE_ADAPTIVE, the watermark uses the landscape orientation.If the orientation mode of the encoding video is ORIENTATION_MODE_FIXED_PORTRAIT, or the portrait mode in ORIENTATION_MODE_ADAPTIVE, the watermark uses the portrait orientation.When setting the watermark position, the region must be less than the dimensions set in the setVideoEncoderConfiguration method. Otherwise, the watermark image will be cropped. Ensure that you have called the RtcEngine#enableVideo enableVideo} method to enable the video module before calling this method.If you only want to add a watermark image to the local video for the audience in the CDN live streaming channel to see and capture, you can call this method or the { RtcEngine#setLiveTranscoding setLiveTranscoding} method.This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.If the dimensions the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.If you have enabled the local video preview by calling the RtcEngine#startPreview startPreview} method, you can use the visibleInPreview member in the WatermarkOptions class to set whether or not the watermark is visible in preview.If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer. watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from either the local file path or the assets file path. If you use the assets file path, you need to start with /assets/ when filling in this parameter. options The options of the watermark image to be added. See { io.agora.rtc.video.WatermarkOptions Watermark Options}. connection RtcConnection} is used to control different connection instances. 0: Success.< 0: Failure.

◆ clearVideoWatermarkEx()

abstract int io.agora.rtc2.RtcEngineEx.clearVideoWatermarkEx ( RtcConnection  connection)
abstract