Agora Java API Reference for Android
|
Public Member Functions | |
RtcEngineImpl (RtcEngineConfig config) throws Exception | |
Context | getContext () |
synchronized void | doDestroy () |
synchronized void | reinitialize (RtcEngineConfig config) |
synchronized void | addHandler (IAgoraEventHandler handler) |
synchronized void | removeHandler (IAgoraEventHandler handler) |
synchronized int | setupRemoteVideo (VideoCanvas remote) |
synchronized int | setupRemoteVideoEx (VideoCanvas remote, RtcConnection connection) |
synchronized int | setupLocalVideo (VideoCanvas local) |
synchronized int | setLocalRenderMode (int renderMode) |
synchronized int | setLocalRenderMode (int renderMode, int mirrorMode) |
synchronized int | setRemoteRenderMode (int userId, int renderMode) |
synchronized int | setRemoteRenderMode (int userId, int renderMode, int mirrorMode) |
synchronized int | setRemoteRenderModeEx (int userId, int renderMode, int mirrorMode, RtcConnection connection) |
synchronized int | setLocalVideoMirrorMode (int mode) |
synchronized int | addVideoWatermark (AgoraImage watermark) |
synchronized int | addVideoWatermark (String watermarkUrl, WatermarkOptions options) |
synchronized int | addVideoWatermarkEx (String watermarkUrl, WatermarkOptions options, RtcConnection connection) |
synchronized int | clearVideoWatermarkEx (RtcConnection connection) |
synchronized int | clearVideoWatermarks () |
synchronized int | enableDualStreamMode (boolean enabled) |
int | enableDualStreamMode (Constants.VideoSourceType sourceType, boolean enabled) |
int | enableDualStreamMode (Constants.VideoSourceType sourceType, boolean enabled, SimulcastStreamConfig streamConfig) |
synchronized void | monitorHeadsetEvent (boolean monitor) |
synchronized void | monitorBluetoothHeadsetEvent (boolean monitor) |
boolean | enableHighPerfWifiMode (boolean enable) |
synchronized int | joinChannel (String key, String channelName, String optionalInfo, int optionalUid) |
synchronized int | joinChannel (String token, String channelId, int uid, ChannelMediaOptions options) |
synchronized int | joinChannelEx (String token, String channelId, int uid, ChannelMediaOptions options, IRtcEngineEventHandler eventHandler, RtcConnection connection) |
synchronized int | updateChannelMediaOptions (ChannelMediaOptions options) |
synchronized int | updateChannelMediaOptionsEx (ChannelMediaOptions options, RtcConnection connection) |
synchronized int | leaveChannel () |
synchronized int | leaveChannel (LeaveChannelOptions options) |
synchronized int | leaveChannelEx (String channelId, RtcConnection connection) |
synchronized int | startEchoTest (int intervalInSeconds) |
synchronized int | startEchoTest () |
synchronized int | stopEchoTest () |
synchronized int | startLastmileProbeTest (LastmileProbeConfig config) |
synchronized int | stopLastmileProbeTest () |
synchronized int | enableVideo () |
synchronized int | disableVideo () |
synchronized int | enableLocalVideo (boolean enabled) |
synchronized int | startPreview () |
synchronized int | stopPreview () |
synchronized int | enableAudio () |
synchronized int | disableAudio () |
synchronized int | enableLocalAudio (boolean enabled) |
synchronized int | pauseAudio () |
synchronized int | resumeAudio () |
synchronized int | muteLocalAudioStream (boolean muted) |
synchronized int | muteLocalVideoStream (boolean muted) |
synchronized int | muteAllRemoteAudioStreams (boolean muted) |
synchronized int | setDefaultMuteAllRemoteAudioStreams (boolean muted) |
synchronized int | muteAllRemoteVideoStreams (boolean muted) |
synchronized int | setDefaultMuteAllRemoteVideoStreams (boolean muted) |
synchronized int | muteRemoteAudioStream (int uid, boolean muted) |
synchronized int | muteRemoteAudioStreamEx (int uid, boolean muted, RtcConnection connection) |
synchronized int | muteRemoteVideoStream (int uid, boolean muted) |
synchronized int | muteRemoteVideoStreamEx (int uid, boolean muted, RtcConnection connection) |
synchronized int | renewToken (String token) |
synchronized int | setDefaultAudioRoutetoSpeakerphone (boolean defaultToSpeaker) |
synchronized int | setEnableSpeakerphone (boolean speakerOn) |
synchronized boolean | isSpeakerphoneEnabled () |
synchronized int | startRecordingService (String recordingKey) |
synchronized int | stopRecordingService (String recordingKey) |
synchronized int | refreshRecordingServiceStatus () |
synchronized int | muteRecordingSignal (boolean muted) |
synchronized int | adjustRecordingSignalVolume (int volume) |
synchronized int | adjustPlaybackSignalVolume (int volume) |
synchronized int | adjustUserPlaybackSignalVolume (int uid, int volume) |
synchronized int | setRecordingAudioFrameParameters (int sampleRate, int channel, int mode, int samplesPerCall) |
synchronized int | setPlaybackAudioFrameParameters (int sampleRate, int channel, int mode, int samplesPerCall) |
synchronized int | setMixedAudioFrameParameters (int sampleRate, int channel, int samplesPerCall) |
synchronized int | setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel) |
synchronized int | registerAudioFrameObserver (IAudioFrameObserver observer) |
synchronized int | enableAudioSpectrumMonitor (int intervalInMS) |
synchronized int | disableAudioSpectrumMonitor () |
synchronized int | registerAudioSpectrumObserver (IAudioSpectrumObserver observer) |
synchronized int | unRegisterAudioSpectrumObserver (IAudioSpectrumObserver observer) |
synchronized int | registerAudioEncodedFrameObserver (AudioEncodedFrameObserverConfig config, IAudioEncodedFrameObserver observer) |
synchronized int | setHighQualityAudioParameters (boolean fullband, boolean stereo, boolean fullBitrate) |
synchronized int | enableInEarMonitoring (boolean enabled, int includeAudioFilters) |
synchronized int | enableInEarMonitoring (boolean enabled) |
synchronized int | enableWebSdkInteroperability (boolean enabled) |
synchronized int | setVideoQualityParameters (boolean preferFrameRateOverImageQuality) |
synchronized void | setPreferHeadset (boolean enabled) |
synchronized int | enableAudioVolumeIndication (int interval, int smooth) |
synchronized int | enableAudioQualityIndication (boolean enabled) |
synchronized int | enableTransportQualityIndication (boolean enabled) |
synchronized int | playRecap () |
synchronized int | enableRecap (int interval) |
synchronized int | setVideoProfile (int profile, boolean swapWidthAndHeight) |
synchronized int | setVideoProfile (int width, int height, int frameRate, int bitrate) |
synchronized int | setVideoEncoderConfiguration (VideoEncoderConfiguration config) |
synchronized int | setVideoEncoderConfigurationEx (VideoEncoderConfiguration config, RtcConnection connection) |
synchronized int | setAudioProfile (int profile, int scenario) |
synchronized int | setAudioProfile (int profile) |
synchronized int | monitorAudioRouteChange (boolean isMonitoring) |
synchronized int | switchCamera () |
synchronized boolean | isCameraZoomSupported () |
synchronized boolean | isCameraTorchSupported () |
synchronized boolean | isCameraFocusSupported () |
synchronized boolean | isCameraAutoFocusFaceModeSupported () |
synchronized boolean | isCameraExposurePositionSupported () |
synchronized int | setCameraZoomFactor (float factor) |
synchronized float | getCameraMaxZoomFactor () |
synchronized int | setCameraFocusPositionInPreview (float positionX, float positionY) |
synchronized int | setCameraTorchOn (boolean isOn) |
synchronized int | setCameraAutoFocusFaceModeEnabled (boolean enabled) |
synchronized int | setCameraCapturerConfiguration (CameraCapturerConfiguration config) |
int | setCameraExposurePosition (float positionXinView, float positionYinView) |
synchronized int | sendCustomReportMessage (String id, String category, String event, String label, int value) |
synchronized int | sendCustomReportMessageEx (String id, String category, String event, String label, int value, RtcConnection connection) |
synchronized IMediaPlayer | createMediaPlayer () |
synchronized int | enableRemoteVideo (boolean enabled, int uid) |
synchronized int | stopRemoteVideo (int uid) |
synchronized int | stopAllRemoteVideo () |
synchronized int | startAudioRecording (String filePath, int quality) |
synchronized int | startAudioRecording (AudioFileRecordingConfig config) |
synchronized int | stopAudioRecording () |
synchronized int | startPlayingStream (String url) |
synchronized int | stopPlayingStream () |
synchronized int | startAudioMixing (String filePath, boolean loopback, boolean replace, int cycle) |
synchronized int | stopAudioMixing () |
synchronized int | pauseAudioMixing () |
synchronized int | resumeAudioMixing () |
synchronized int | adjustAudioMixingVolume (int volume) |
synchronized int | adjustAudioMixingPublishVolume (int volume) |
synchronized int | getAudioMixingPublishVolume () |
synchronized int | adjustAudioMixingPlayoutVolume (int volume) |
synchronized int | getAudioMixingPlayoutVolume () |
synchronized int | getAudioMixingDuration () |
synchronized int | getAudioMixingCurrentPosition () |
synchronized int | setAudioMixingPosition (int pos) |
synchronized int | useExternalAudioDevice () |
synchronized int | setExternalAudioSource (boolean enabled, int sampleRate, int channels) |
synchronized int | setExternalAudioSource (boolean enabled, int sampleRate, int channels, int sourceCount, boolean localPlayback, boolean publish) |
synchronized int | pushExternalAudioFrame (byte[] data, long timestamp) |
synchronized int | pushExternalAudioFrame (ByteBuffer data, long timestamp, int sourceId) |
synchronized int | pushExternalAudioFrameEx (ByteBuffer data, long timestamp, int sourceId, RtcConnection connection) |
synchronized int | setExternalAudioSink (int sampleRate, int channels) |
synchronized int | pullPlaybackAudioFrame (byte[] data, int lengthInByte) |
synchronized int | pullPlaybackAudioFrame (ByteBuffer data, int lengthInByte) |
synchronized int | setLogFile (String filePath) |
synchronized int | setLogFilter (int filter) |
int | setLogFileSize (long fileSizeInKBytes) |
synchronized int | setProfile (String profile, boolean merge) |
synchronized String | getProfile () |
synchronized int | setParameters (String parameters) |
synchronized String | getParameters (String parameters) |
synchronized String | getParameter (String parameter, String args) |
synchronized String | makeQualityReportUrl (String channelName, String listenerUid, String speakerUid, int format) |
synchronized String | getCallId () |
synchronized RtcConnection.CONNECTION_STATE_TYPE | getConnectionState () |
synchronized RtcConnection.CONNECTION_STATE_TYPE | getConnectionStateEx (RtcConnection connection) |
synchronized int | rate (String callId, int rating, String description) |
synchronized int | complain (String callId, String description) |
synchronized int | setChannelProfile (int profile) |
synchronized int | setClientRole (int role) |
synchronized int | setRemoteVideoStreamType (int userId, int streamType) |
synchronized int | setRemoteVideoStreamType (String userId, int streamType) |
synchronized int | setRemoteDefaultVideoStreamType (int streamType) |
synchronized int | setRemoteUserPriority (int uid, int userPriority) |
synchronized int | setLocalPublishFallbackOption (int option) |
synchronized int | setRemoteSubscribeFallbackOption (int option) |
synchronized int | setEncryptionMode (String encryptionMode) |
synchronized int | setEncryptionSecret (String secret) |
synchronized int | enableEncryption (boolean enabled, EncryptionConfig config) |
synchronized int | createDataStream (boolean reliable, boolean ordered) |
synchronized int | createDataStreamEx (boolean reliable, boolean ordered, RtcConnection connection) |
synchronized int | createDataStream (DataStreamConfig config) |
synchronized int | createDataStreamEx (DataStreamConfig config, RtcConnection connection) |
synchronized int | sendStreamMessage (int streamId, byte[] message) |
synchronized int | sendStreamMessageEx (int streamId, byte[] message, RtcConnection connection) |
synchronized int | updateSharedContext (EGLContext sharedContext) |
synchronized int | updateSharedContext (android.opengl.EGLContext sharedContext) |
synchronized int | setTextureId (int id, EGLContext sharedContext, int width, int height, long ts) |
synchronized int | setTextureId (int id, android.opengl.EGLContext sharedContext, int width, int height, long ts) |
synchronized int | setTextureIdWithMatrix (int id, EGLContext sharedContext, int format, int width, int height, long ts, float[] matrix) |
synchronized int | setTextureIdWithMatrix (int id, android.opengl.EGLContext sharedContext, int format, int width, int height, long ts, float[] matrix) |
synchronized boolean | isTextureEncodeSupported () |
synchronized int | setExternalVideoSource (boolean enable, boolean useTexture, boolean encoded) |
synchronized boolean | pushExternalVideoFrame (AgoraVideoFrame frame) |
synchronized int | pushExternalVideoFrameEx (AgoraVideoFrame frame, RtcConnection connection) |
boolean | pushExternalVideoFrame (VideoFrame frame) |
int | pushExternalVideoFrameEx (VideoFrame frame, RtcConnection connection) |
synchronized int | pushExternalEncodedVideoFrame (ByteBuffer data, EncodedVideoFrameInfo frameInfo) |
synchronized int | pushExternalEncodedVideoFrameEx (ByteBuffer data, EncodedVideoFrameInfo frameInfo, RtcConnection connection) |
synchronized int | registerVideoEncodedImageReceiver (IVideoEncodedImageReceiver receiver) |
synchronized int | addPublishStreamUrl (String url, boolean transcodingEnabled) |
synchronized int | removePublishStreamUrl (String url) |
synchronized int | setLiveTranscoding (LiveTranscoding transcoding) |
synchronized int | addInjectStreamUrl (String url, LiveInjectStreamConfig config) |
synchronized int | removeInjectStreamUrl (String url) |
synchronized int | startChannelMediaRelay (ChannelMediaRelayConfiguration channelMediaRelayConfiguration) |
synchronized int | stopChannelMediaRelay () |
synchronized int | updateChannelMediaRelay (ChannelMediaRelayConfiguration channelMediaRelayConfiguration) |
synchronized long | getNativeHandle () |
synchronized int | configPublisher (PublisherConfiguration configuration) |
synchronized int | setVideoCompositingLayout (VideoCompositingLayout layout) |
synchronized int | clearVideoCompositingLayout () |
IAudioEffectManager | getAudioEffectManager () |
synchronized int | setVoiceBeautifierPreset (int preset) |
synchronized int | setAudioEffectPreset (int preset) |
synchronized int | setVoiceConversionPreset (int preset) |
synchronized int | setAudioEffectParameters (int preset, int param1, int param2) |
synchronized int | setVoiceBeautifierParameters (int preset, int param1, int param2) |
synchronized int | setVoiceConversionParameters (int preset, int param1, int param2) |
synchronized int | setLocalVoicePitch (double pitch) |
synchronized int | setLocalVoiceEqualization (int bandFrequency, int bandGain) |
synchronized int | setLocalVoiceReverb (int reverbKey, int value) |
synchronized int | setLocalVoiceChanger (int voiceChanger) |
synchronized int | setLocalVoiceReverbPreset (int reverbPreset) |
synchronized int | setInEarMonitoringVolume (int volume) |
synchronized double | getEffectsVolume () |
synchronized int | setEffectsVolume (double volume) |
synchronized int | preloadEffect (int soundId, String filePath) |
synchronized int | playEffect (int soundId, String filePath, int loopCount, double pitch, double pan, double gain) |
synchronized int | playEffect (int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish) |
synchronized int | playAllEffects (int loopCount, double pitch, double pan, double gain, boolean publish) |
synchronized int | getVolumeOfEffect (int soundId) |
synchronized int | setVolumeOfEffect (int soundId, double volume) |
synchronized int | pauseEffect (int soundId) |
synchronized int | pauseAllEffects () |
synchronized int | resumeEffect (int soundId) |
synchronized int | resumeAllEffects () |
synchronized int | stopEffect (int soundId) |
synchronized int | stopAllEffects () |
synchronized int | unloadEffect (int soundId) |
synchronized int | unloadAllEffects () |
synchronized int | setApiCallMode (int syncCallTimeout) |
synchronized int | setAudioOptionParams (String params) |
synchronized String | getAudioOptionParams () |
synchronized int | setAudioSessionParams (String params) |
synchronized String | getAudioSessionParams () |
synchronized int | startScreenCapture (Intent mediaProjectionPermissionResultData, ScreenCaptureParameters parameters) |
synchronized int | stopScreenCapture () |
synchronized int | registerVideoFrameObserver (IVideoFrameObserver observer) |
void | finalize () |
synchronized boolean | enableExtension (Constants.VideoSourceType sourceType, String vendor, boolean enable) |
synchronized boolean | setExtensionProperty (Constants.VideoSourceType sourceType, String vendor, String key, String value) |
synchronized int | registerMediaMetadataObserver (IMetadataObserver observer, int type) |
synchronized int | unregisterMediaMetadataObserver (IMetadataObserver observer, int type) |
synchronized int | setLogLevel (int level) |
synchronized int | enableExternalAudioSourceLocalPlayback (boolean enabled) |
synchronized int | enableSoundPositionIndication (boolean enabled) |
synchronized int | setRemoteVoicePosition (int uid, double pan, double gain) |
synchronized int | setRemoteVoicePositionEx (int uid, double pan, double gain, RtcConnection connection) |
synchronized int | registerLocalUserAccount (String appId, String userAccount) |
synchronized int | joinChannelWithUserAccount (String token, String channelId, String userAccount) |
synchronized int | joinChannelWithUserAccount (String token, String channelId, String userAccount, ChannelMediaOptions options) |
synchronized int | joinChannelWithUserAccountEx (String token, String channelId, String userAccount, ChannelMediaOptions options, IRtcEngineEventHandler eventHandler, RtcConnection connection) |
UserInfo | getUserInfoByUserAccount (String userAccount) |
synchronized UserInfo | getUserInfoByUserAccount (String userAccount, RtcConnection connection) |
synchronized UserInfo | getUserInfoByUid (int uid) |
synchronized UserInfo | getUserInfoByUid (int uid, RtcConnection connection) |
native int | nativePushExternalVideoFrame (long nativeRtcEngineAndroid, VideoFrame frame, int connId) |
![]() | |
abstract int | enableDualStreamMode (Constants.VideoSourceType sourceType, boolean enabled) |
abstract int | enableDualStreamMode (Constants.VideoSourceType sourceType, boolean enabled, SimulcastStreamConfig streamConfig) |
void | addHandler (IRtcEngineEventHandler handler) |
void | removeHandler (IRtcEngineEventHandler handler) |
abstract boolean | enableExtension (Constants.VideoSourceType sourceType, String vendor, boolean enable) |
abstract boolean | setExtensionProperty (Constants.VideoSourceType sourceType, String vendor, String key, String value) |
Static Public Member Functions | |
static synchronized boolean | initializeNativeLibs () |
static synchronized boolean | initializeNativeLibs (String libPath) |
static synchronized boolean | loadExtension (String name) |
static native String | nativeGetSdkVersion () |
static native String | nativeGetChatEngineVersion () |
static native String | nativeGetErrorDescription (int err) |
![]() | |
static synchronized RtcEngine | create (Context context, String appId, IRtcEngineEventHandler handler) throws Exception |
static synchronized RtcEngine | create (RtcEngineConfig config) throws Exception |
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) |
Protected Member Functions | |
void | onEvent (int eventId, byte[] evt) |
void | onEventEx (String channelId, int connectionId, int eventId, byte[] evt) |
void | handleEvent (int eventId, byte[] evt, IAgoraEventHandler handler) |
AudioManager | getAudioManager (Context context) |
Additional Inherited Members | |
![]() | |
static RtcEngineImpl | mInstance = null |
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setupRemoteVideo | ( | VideoCanvas | remote | ) |
Initializes the video view of a remote user.
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
.
remote | The remote video view settings: VideoCanvas. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setupRemoteVideoEx | ( | VideoCanvas | remote, |
RtcConnection | connection | ||
) |
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
.
remote | The remote video view settings: VideoCanvas. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setupLocalVideo | ( | VideoCanvas | local | ) |
Initializes the local video view.
This method initializes the video view of the local stream on the local device. It affects only the video view that the local user sees, not the published local video stream.
To unbind the local video from the view, set view
in VideoCanvas as null
.
local | The local video view setting: VideoCanvas. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalRenderMode | ( | int | renderMode | ) |
Updates the display mode of the local video view.
After initializing the local video view, you can call this method to update its rendering mode. It affects only the video view that the local user sees, not the published local video stream.
renderMode | Sets the local display mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalRenderMode | ( | int | renderMode, |
int | mirrorMode | ||
) |
Updates the display mode of the local video view.
After initializing the local video view, you can call this method to update its rendering mode. It affects only the video view that the local user sees, not the published local video stream.
renderMode | Sets the local display mode:
|
mirrorMode | Sets the local video mirror mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteRenderMode | ( | int | userId, |
int | renderMode | ||
) |
Updates the display mode of the video view of a remote user.
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.
uid | ID of the remote user. |
renderMode | Sets the remote display mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteRenderMode | ( | int | userId, |
int | renderMode, | ||
int | mirrorMode | ||
) |
Updates the display mode of the video view of a remote user.
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.
uid | ID of the remote user. |
renderMode | Sets the remote display mode:
|
mirrorMode | Sets the remote video mirror mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteRenderModeEx | ( | int | uid, |
int | renderMode, | ||
int | mirrorMode, | ||
RtcConnection | connection | ||
) |
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.
uid | ID of the remote user. |
renderMode | Sets the remote display mode:
|
mirrorMode | Sets the remote video mirror mode:
|
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalVideoMirrorMode | ( | int | mode | ) |
Sets the local video mirror mode.
Use this method before calling the startPreview method, or the mirror mode does not take effect until you call the startPreview
method again.
mirrorMode | Sets the local video mirror mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.addVideoWatermark | ( | AgoraImage | watermark | ) |
Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video stream for the sampling device, channel audience, or CDN live audience to see and capture. To add the PNG file to a CDN live publishing stream, see the setLiveTranscoding method.
watermark | Watermark image to be added to the local video stream. See {Agora Image}. The URL descriptions are different for the local video and CDN live streams:
orientationMode as Adaptive in the {setVideoEncoderConfiguration} method, the watermark image rotates with the video frame around the upper left corner of the watermark image. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.addVideoWatermark | ( | String | watermarkUrl, |
WatermarkOptions | options | ||
) |
Adds a watermark image to the local video.
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.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.addVideoWatermarkEx | ( | String | watermarkUrl, |
WatermarkOptions | options, | ||
RtcConnection | connection | ||
) |
Adds a watermark image to the local video.
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.
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.clearVideoWatermarkEx | ( | RtcConnection | connection | ) |
Removes the watermark image from the video stream added by {watermarkUrl, WatermarkOptions options, RtcConnection connection) addVideoWatermarkEx}. connection An output parameter which is used to control different connection instances. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.clearVideoWatermarks | ( | ) |
Removes the watermark image from the video stream added by {addVideoWatermark}. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableDualStreamMode | ( | boolean | enabled | ) |
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.
enabled |
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized void io.agora.rtc2.internal.RtcEngineImpl.monitorHeadsetEvent | ( | boolean | monitor | ) |
Monitors external headset device events.
monitor | Whether to enable monitoring external headset device events. True/False. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized void io.agora.rtc2.internal.RtcEngineImpl.monitorBluetoothHeadsetEvent | ( | boolean | monitor | ) |
Monitors Bluetooth headset device events.
monitor | Whether to enable monitoring Bluetooth headset device events. True/False. |
Reimplemented from io.agora.rtc2.RtcEngine.
boolean io.agora.rtc2.internal.RtcEngineImpl.enableHighPerfWifiMode | ( | boolean | enable | ) |
Enables the Wi-Fi mode.
enable | Whether to enable/disable the Wi-Fi mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.joinChannel | ( | String | token, |
String | channelName, | ||
String | optionalInfo, | ||
int | optionalUid | ||
) |
Joins a channel.
Users in the same channel can talk to each other; and multiple users in the same channel can start a group chat. Note that users using different App IDs cannot call each other.
Once in a call, the user must call the leaveChannel method to exit the current call before entering another channel.
uid
s, that is, two users with the same uid. If you set uid
as 0, the system automatically assigns a user ID.token | The token for authentication.
|
channelName | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
optionalInfo | (Optional) Additional information about the channel that you want to add. It can be set as a NULL string or channel related information. Other users in the channel will not receive this message. |
optionalUid | (Optional) User ID: A 32-bit unsigned integer ranging from 1 to (2^32-1). It must be unique. If not assigned (or set to 0), the SDK assigns one and reports it in the onJoinChannelSuccess callback. Your app must record and maintain the returned value as the SDK does not maintain it. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.joinChannel | ( | String | token, |
String | channelId, | ||
int | uid, | ||
ChannelMediaOptions | options | ||
) |
Joins a channel with media options.
Users in the same channel can talk to each other; and multiple users in the same channel can start a group chat. Note that users using different App IDs cannot call each other.
Once in a call, the user must call the leaveChannel method to exit the current call before entering another channel.
uid
s, that is, two users with the same uid. If you set uid
as 0, the system automatically assigns a user ID.token | The token for authentication.
|
channelId | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
uid | (Optional) User ID: A 32-bit unsigned integer ranging from 1 to (2^32-1). It must be unique. If not assigned (or set to 0), the SDK assigns one and reports it in the onJoinChannelSuccess callback. Your app must record and maintain the returned value as the SDK does not maintain it. |
options | The channel media options: ChannelMediaOptions. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.joinChannelEx | ( | String | token, |
String | channelId, | ||
int | uid, | ||
ChannelMediaOptions | options, | ||
IRtcEngineEventHandler | eventHandler, | ||
RtcConnection | connection | ||
) |
Joins a channel with the connection ID.
You can call this method multiple times to join more than one channels at a time.
token | The token for authentication:
|
channelId | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
uid | The user ID. A 32-bit unsigned integer with a value ranging from 1 to (2^32-1). |
options | The channel media options: ChannelMediaOptions. |
eventHandler | The pointer to the IRtcEngine event handler: IRtcEngineEventHandler. |
connection | An output parameter which is used to control different connection instances when you join the same channel multiple times. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.updateChannelMediaOptions | ( | ChannelMediaOptions | options | ) |
Updates the channel media options after joining the channel.
options | The channel media options: ChannelMediaOptions. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.updateChannelMediaOptionsEx | ( | ChannelMediaOptions | options, |
RtcConnection | connection | ||
) |
Updates the media options after joining the channel with specified connection.
options | The channel media options: ChannelMediaOptions. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.leaveChannel | ( | ) |
Leaves the channel.
This method allows a user to leave the channel, for example, by hanging up or exiting a call.
After joining a channel, the user must call this method to end the current call before joining another one. This method also releases all resources related to the call.
This method is an asynchronous call, which means that the result of this method returns even before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the onLeaveChannel callback.
onLeaveChannel
callback.Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.leaveChannel | ( | LeaveChannelOptions | options | ) |
Leaves the channel.
options | The leave channel options. |
This method allows a user to leave the channel, for example, by hanging up or exiting a call.
This method is an asynchronous call, which means that the result of this method returns even before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the onLeaveChannel callback.
onLeaveChannel
callback.Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.leaveChannelEx | ( | String | channelId, |
RtcConnection | connection | ||
) |
Leaves the channel with the specified connection ID.
channelId | The channel name. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startEchoTest | ( | int | intervalInSeconds | ) |
Starts an audio call test.
In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly.
LIVE_BROADCASTING
profile, only a host can call this method. intervalInSeconds The time interval (s) between when you speak and when the recording plays back. 0: Success.< 0: Failure. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startEchoTest | ( | ) |
Starts an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.
In the test, the user first speaks, and the recording is played back in 10 seconds. If the user can hear the recording in 10 seconds, it indicates that the audio devices and network connection work properly.
Note: After calling the startEchoTest method, call stopEchoTest to end the test; otherwise the application cannot run the next echo test, nor can it call the token, java.lang.String channelName, java.lang.String optionalInfo, int optionalUid) joinChannel method to start a new call.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopEchoTest | ( | ) |
Stops an audio call test.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startLastmileProbeTest | ( | LastmileProbeConfig | config | ) |
Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopLastmileProbeTest | ( | ) |
Stops the last-mile network probe test.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableVideo | ( | ) |
Enables the video.
You can call this method either before joining a channel or during a call. If you call this method before entering a channel, the service starts the video; if you call it during a call, the audio call switches to a video call.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.disableVideo | ( | ) |
Disables the video.
This method stops capturing the local video and receiving any remote video. To enable the local preview function, call enableLocalVideo (true).
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableLocalVideo | ( | boolean | enabled | ) |
Disables or re-enables the local video capture.
Once you enable the video using enableVideo, the local video is enabled by default. This method disables or re-enables the local video capture.
enableLocalVideo(false)
applies to scenarios when the user wants to watch the remote video without sending any video stream to the other user.
enableVideo
. Otherwise, this method may not work properly.enabled | Determines whether to disable or re-enable the local video, including the capturer, renderer, and sender:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startPreview | ( | ) |
Starts the local video preview before joining a channel.
Once you call this method to start the local video preview, if you leave the channel by calling leaveChannel, the local video preview remains until you call stopPreview to disable it.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopPreview | ( | ) |
Stops the local video preview and the video.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableAudio | ( | ) |
Enables the audio.
The audio is enabled by default.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.disableAudio | ( | ) |
Disables the audio.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableLocalAudio | ( | boolean | enabled | ) |
Enables or disables the local audio capture.
The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capture and processing.
This method does not affect receiving or playing the remote audio streams, and enableLocalAudio
(false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.
enabled | Determines whether to disable or re-enable the local audio function:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pauseAudio | ( | ) |
Disables the audio function in the channel.
Note: This method controls the underlying states of the Engine. It is still valid after one leaves channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.resumeAudio | ( | ) |
Enables the audio function in the channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteLocalAudioStream | ( | boolean | muted | ) |
Stops or resumes sending the local audio stream.
mute | Determines whether to send or stop sending the local audio stream:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteLocalVideoStream | ( | boolean | muted | ) |
Stops or resumes sending the local video stream.
mute | Determines whether to send or stop sending the local video stream:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteAllRemoteAudioStreams | ( | boolean | muted | ) |
Stops or resumes receiving all remote audio streams.
This method works for all remote users that join or will join a channel using the joinChannel
method. It is equivalent to the autoSubscribeAudio
member in the ChannelMediaOptions class. You can call this method before, during, or after a call.
muteAllRemoteAudioStreams(true)
before joining a channel, the local user does not receive any audio stream after joining the channel.muteAllRemoteAudioStreams(true)
after joining a channel, the local use stops receiving any audio stream from any user in the channel, including any user who joins the channel after you call this method.muteAllRemoteAudioStreams(true)
after leaving a channel, the local user does not receive any audio stream the next time the user joins a channel.After you successfully call muteAllRemoteAudioStreams(true)
, you can take the following actions:
muteAllRemoteAudioStreams(false)
.muteRemoteAudioStream(uid, false)
, where uid
is the ID of the user whose audio stream you want to resume receiving.enableAudio
and disableAudio
. Settings in muteAllRemoteAudioStreams
stop taking effect if either of the following occurs:enableAudio
after muteAllRemoteAudioStreams(true)
.disableAudio
after muteAllRemoteAudioStreams(false)
.joinChannel
. To set whether to receive remote audio streams for a specific channel, Agora recommends using autoSubscribeAudio
in the ChannelMediaOptions
class.muted | Whether to stop receiving remote audio streams:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setDefaultMuteAllRemoteAudioStreams | ( | boolean | muted | ) |
Determines whether to receive all remote audio streams by default.
joinChannel
.Use setDefaultMuteAllRemoteAudioStreams
to set whether to receive audio streams of subsequent peer users. Agora recommends calling it before joining a channel.
A successful call of setDefaultMuteAllRemoteAudioStreams(true)
results in that the local user not receiving any audio stream after joining a channel.
muted | Whether to receive remote audio streams by default:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteAllRemoteVideoStreams | ( | boolean | muted | ) |
Stops or resumes receiving all remote video streams.
This method works for all remote users that join or will join a channel using the joinChannel
method. It is equivalent to the autoSubscribeVideo
member in the ChannelMediaOptions class. You can call this method before, during, or after a call.
muteAllRemoteVideoStreams(true)
before joining a channel, the local user does not receive any video stream after joining the channel.muteAllRemoteVideoStreams(true)
after joining a channel, the local use stops receiving any video stream from any user in the channel, including any user who joins the channel after you call this method.muteAllRemoteVideoStreams(true)
after leaving a channel, the local user does not receive any video stream the next time the user joins a channel.After you successfully call muteAllRemoteVideoStreams(true)
, you can take the following actions:
muteAllRemoteVideoStreams(false)
.muteRemoteVideoStream(uid, false)
, where uid
is the ID of the user whose video stream you want to resume receiving.enableVideo
and disableVideo
. Settings in muteAllRemoteVideoStreams
stop taking effect if either of the following occurs:enableVideo
after muteAllRemoteVideoStreams(true)
.disableVideo
after muteAllRemoteVideoStreams(false)
.joinChannel
. To set whether to receive remote audio streams for a specific channel, Agora recommends using autoSubscribeVideo
in the ChannelMediaOptions class.muted | Whether to stop receiving remote video streams:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setDefaultMuteAllRemoteVideoStreams | ( | boolean | muted | ) |
Determines whether to receive all remote video streams by default.
joinChannel
.Use setDefaultMuteAllRemoteVideoStreams
to set whether to receive video streams of subsequent peer users. Agora recommends calling it before joining a channel.
A successful call of setDefaultMuteAllRemoteVideoStreams(true)
results in that the local user not receiving any video stream after joining a channel.
muted | Whether to receive remote video streams by default:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteRemoteAudioStream | ( | int | uid, |
boolean | muted | ||
) |
Stops or resumes receiving the audio stream of a specified user.
You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.
uid | The ID of the specified user. |
mute | Whether to stop receiving the audio stream of the specified user:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteRemoteAudioStreamEx | ( | int | uid, |
boolean | muted, | ||
RtcConnection | connection | ||
) |
Stops or resumes receiving the audio stream of a specified user with specified connection.
uid | ID of the specified remote user. |
mute | Determines whether to receive or stop receiving the specified audio stream:
|
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteRemoteVideoStream | ( | int | userId, |
boolean | muted | ||
) |
Stops or resumes receiving the video stream of a specified user.
You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.
userId | The ID of the specified user. |
mute | Whether to stop receiving the video stream of the specified user:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteRemoteVideoStreamEx | ( | int | uid, |
boolean | muted, | ||
RtcConnection | connection | ||
) |
Stops or resumes receiving the video stream of a specified user with specified connection.
uid | ID of the specified remote user. |
muted | Determines whether to receive or stop receiving a specified video stream:
|
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.renewToken | ( | String | token | ) |
Renews the token.
Once a token is enabled and used, it expires after a certain period of time.
Under the following circumstances, generate a new token on your server, and then call this method to renew it. Failure to do so results in the SDK disconnecting from the server.
ERR_TOKEN_EXPIRED(-109)
error is reported.token | The new token. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setDefaultAudioRoutetoSpeakerphone | ( | boolean | defaultToSpeaker | ) |
Sets the default audio route.
Most mobile phones have two audio routes: an earpiece at the top, and a speakerphone at the bottom. The earpiece plays at a lower volume, and the speakerphone at a higher volume.
When setting the default audio route, you determine whether audio playback comes through the earpiece or speakerphone when no external audio device is connected.
Depending on the scenario, Agora uses different default audio routes:
Call this method before, during, or after a call, to change the default audio route. When the audio route changes, the SDK triggers the onAudioRouteChanged callback.
defaultToSpeaker | Whether to set the speakerphone as the default audio route:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setEnableSpeakerphone | ( | boolean | enabled | ) |
Enables or disables the speakerphone temporarily.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isSpeakerphoneEnabled | ( | ) |
Checks whether the speakerphone is enabled.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startRecordingService | ( | String | recordingKey | ) |
Starts the recording service.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopRecordingService | ( | String | recordingKey | ) |
Stops the recording service.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.refreshRecordingServiceStatus | ( | ) |
Refreshes the server recording service status.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.muteRecordingSignal | ( | boolean | muted | ) |
Mute or resume recording signal volume.
muted | Determines whether to mute or resume the recording signal volume.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.adjustRecordingSignalVolume | ( | int | volume | ) |
Adjusts the recording volume.
volume | Recording volume, ranges from 0 to 400:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.adjustPlaybackSignalVolume | ( | int | volume | ) |
Adjusts the playback volume.
volume | Playback volume, ranges from 0 to 400:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.adjustUserPlaybackSignalVolume | ( | int | uid, |
int | volume | ||
) |
Adjust the playback volume of the user specified by uid.
You can call this method to adjust the playback volume of the user specified by uid in call. If you want to adjust playback volume of the multi user, you can call this this method multi times.
uid | Remote user ID。 |
volume | The playback volume, range is [0,100]: 0: mute, 100: The original volume |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRecordingAudioFrameParameters | ( | int | sampleRate, |
int | channel, | ||
int | mode, | ||
int | samplesPerCall | ||
) |
Sets the audio recording format for the onRecordAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onRecordAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of audio channels (channels) returned in the onRecordAudioFrame callback:
|
mode | Sets the use mode of the onRecordAudioFrame callback:
|
samplesPerCall | Sets the number of samples the onRecordAudioFrame callback returns. In RTMP streaming scenarios, set it as 1024. |
sampleRate
, channel
, and samplesPerCall
parameters you set in this method. Sample interval (s) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval ≥ 0.01. The SDK triggers the onRecordAudioFrame
callback according to the sample interval. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setPlaybackAudioFrameParameters | ( | int | sampleRate, |
int | channel, | ||
int | mode, | ||
int | samplesPerCall | ||
) |
Sets the audio recording format for the onPlaybackAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of audio channels (channels) returned in the onPlaybackAudioFrame callback:
|
mode | Sets the use mode of the onPlaybackAudioFrame callback:
|
samplesPerCall | Sets the number of samples the onPlaybackAudioFrame callback returns. In RTMP streaming scenarios, set it as 1024. |
sampleRate
, channel
, and samplesPerCall
parameters you set in this method. Sample interval (s) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval ≥ 0.01. The SDK triggers the onPlaybackAudioFrame
callback according to the sample interval. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setMixedAudioFrameParameters | ( | int | sampleRate, |
int | channel, | ||
int | samplesPerCall | ||
) |
Sets the mixed audio format for the onMixedAudioFrame callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onMixedAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Sets the number of audio channels (channels) returned in the onPlaybackAudioFrame callback:
|
samplesPerCall | Sets the number of samples the onMixedAudioFrame callback returns. In RTMP streaming scenarios, set it as 1024. |
sampleRate
and samplesPerCall
parameters you set in this method. Sample interval (s) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval ≥ 0.01. The SDK triggers the onMixedAudioFrame
callback according to the sample interval. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setPlaybackAudioFrameBeforeMixingParameters | ( | int | sampleRate, |
int | channel | ||
) |
Sets the audio playback format before mixing for the onPlaybackAudioFrameBeforeMixing callback.
sampleRate | Sets the sample rate (samplesPerSec ) returned in the onPlaybackAudioFrameBeforeMixing callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
channel | Number of channels of the audio data returned in onPlaybackAudioFrameBeforeMixing , which can be set as 1 or 2:
|
sampleRate
and channel
parameters you set in this method. Ensure that the value of sample interval ≥ 0.01. The SDK triggers the onPlaybackAudioFrameBeforeMixing
callback according to the sample interval. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerAudioFrameObserver | ( | IAudioFrameObserver | observer | ) |
Registers an audio frame observer object.
joinChannel
.observer | The IAudioFrameObserver interface, null means unregistering observer instead. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableAudioSpectrumMonitor | ( | int | intervalInMS | ) |
Enable the audio spectrum monitor.
intervalInMS | Sets the time interval(ms) between two consecutive audio spectrum callback. The default value is 100. This param should be larger than 10. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.disableAudioSpectrumMonitor | ( | ) |
Disalbe the audio spectrum monitor.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerAudioSpectrumObserver | ( | IAudioSpectrumObserver | observer | ) |
Registers an audio spectrum observer.
You need to implement the IAudioSpectrumObserver
class in this method, and register the following callbacks according to your scenario:
observer | A pointer to the audio spectrum observer: IAudioSpectrumObserver. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.unRegisterAudioSpectrumObserver | ( | IAudioSpectrumObserver | observer | ) |
Releases the audio spectrum observer.
observer | The pointer to the audio spectrum observer: IAudioSpectrumObserver. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerAudioEncodedFrameObserver | ( | AudioEncodedFrameObserverConfig | config, |
IAudioEncodedFrameObserver | observer | ||
) |
Registers an encoded audio frame observer object.
observer | The IAudioEncodedFrameObserver interface, null means unregistering observer instead. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setHighQualityAudioParameters | ( | boolean | fullband, |
boolean | stereo, | ||
boolean | fullBitrate | ||
) |
Sets high-quality audio preferences.
Call this method and set all the modes before joining a channel. Do NOT call this method again after joining a channel.
Note: Agora does not recommend using this method. If you want to set the audio profile, see setAudioProfile.
fullband | Full-band codec (48 kHz sampling rate), not compatible with versions before v1.7.4.
|
stereo | Stereo codec, not compatible with versions before v1.7.4.
|
fullBitrate | High bitrate. Recommended in voice-only mode.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableInEarMonitoring | ( | boolean | enabled, |
int | includeAudioFilters | ||
) |
Enables in-ear monitoring.
enabled | Determines whether to enable in-ear monitoring.
|
includeAudioFilters | The type of the ear monitoring |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableInEarMonitoring | ( | boolean | enabled | ) |
Enables in-ear monitoring.
enabled | Determines whether to enable in-ear monitoring.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableWebSdkInteroperability | ( | boolean | enabled | ) |
Enables interoperability with the Agora Web SDK (Live Broadcast only).
Use this method when the channel profile is Live Broadcast. Interoperability with the Agora Web SDK is enabled by default when the channel profile is Communication.
enabled | Determines whether to enable interoperability with the Agora Web SDK.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVideoQualityParameters | ( | boolean | preferFrameRateOverImageQuality | ) |
Sets the video quality preferences.
preferFrameRateOverImageQuality | The video preference to be set:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized void io.agora.rtc2.internal.RtcEngineImpl.setPreferHeadset | ( | boolean | enabled | ) |
Sets the default audio route to the headset.
enabled | Sets whether or not the default audio route is to the headset:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableAudioVolumeIndication | ( | int | interval, |
int | smooth | ||
) |
Enables the onAudioVolumeIndication
callback to report on which users are speaking and the speakers' volume.
Once the onAudioVolumeIndication callback is enabled, the SDK returns the volume indication in the at the time interval set in enableAudioVolumeIndication
, regardless of whether any user is speaking in the channel.
interval | Sets the time interval between two consecutive volume indications:
|
smooth | The smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges is [0, 10]. The greater the value, the more sensitive the indicator. The recommended value is 3. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableAudioQualityIndication | ( | boolean | enabled | ) |
Enables the audio quality notification callbacks.
The onAudioQuality callback triggers periodically after this callback is enabled.
enabled | Whether to enable the audio quality notification callbacks. True/False. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVideoProfile | ( | int | profile, |
boolean | swapWidthAndHeight | ||
) |
Sets the video encoding profile.
Each profile includes a set of parameters, such as the resolution, frame rate, and bitrate. When the camera does not support the specified resolution, the SDK chooses a suitable camera resolution, while the encoder resolution is the one specified by setVideoProfile.
Note:
profile | VideoProfile. |
swapWidthAndHeight | The width and height of the output video is consistent with that of the video profile you set. This parameter sets whether to swap the width and height of the stream:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVideoProfile | ( | int | width, |
int | height, | ||
int | frameRate, | ||
int | bitrate | ||
) |
Sets the width, height, frame rate, and bitrate of the video manually if setting the video resolution does not meet your needs.
Note: For example, the resolution is 320 x 240 and the frame rate is 15 fps, then the bitrate is 200:
width | Width of the video that you want to set. Maximum is 1280. |
height | Height of the video that you want to set. Maximum is 720. |
frameRate | Frame rate of the video that you want to set. The highest value is 30. You can set it to 5, 10, 15, 24, 30, and so on. |
bitrate | Bitrate of the video that you want to set. You need to manually work out the bitrate according to the width, height, and frame rate. With the same width and height, the bitrate varies with the change of the frame rate:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVideoEncoderConfiguration | ( | VideoEncoderConfiguration | config | ) |
Sets the video encoder configuration.
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.
config | The local video encoder configuration: VideoEncoderConfiguration. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVideoEncoderConfigurationEx | ( | VideoEncoderConfiguration | config, |
RtcConnection | connection | ||
) |
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.
config | The local video encoder configuration: VideoEncoderConfiguration. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setAudioProfile | ( | int | profile, |
int | scenario | ||
) |
Sets the audio parameters and application scenarios.
mAudioScenario
member.joinChannel
.profile
as MUSIC_HIGH_QUALITY
(4) and scenario
as AUDIO_SCENARIO_GAME_STREAMING
(3).profile | Sets the sample rate, bitrate, encoding mode, and the number of channels. See AudioProfile. |
scenario | Sets the audio application scenarios. See AudioScenario. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setAudioProfile | ( | int | profile | ) |
Sets the audio profile.
joinChannel
method.profile
as MUSIC_HIGH_QUALITY
(4).mAudioScenario
member.profile | Sets the sample rate, bitrate, encoding mode, and the number of channels. See AudioProfile. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.monitorAudioRouteChange | ( | boolean | isMonitoring | ) |
Enables the audio routing monitoring by the SDK.
Call before joining a channel.
isMonitoring | Default value is true |
Reimplemented from io.agora.rtc2.RtcEngineInternal.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.switchCamera | ( | ) |
Switches between front and rear cameras.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isCameraZoomSupported | ( | ) |
Checks whether the camera zoom function is supported.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isCameraTorchSupported | ( | ) |
Checks whether the camera flash function is supported.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isCameraFocusSupported | ( | ) |
Checks whether the camera manual focus function is supported.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isCameraAutoFocusFaceModeSupported | ( | ) |
Checks whether the camera auto focus function is supported.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isCameraExposurePositionSupported | ( | ) |
Checks whether the camera exposure function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setCameraZoomFactor | ( | float | factor | ) |
Sets the camera zoom ratio.
factor | The camera zoom factor. It ranges from 1.0 to the maximum zoom supported by the camera. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized float io.agora.rtc2.internal.RtcEngineImpl.getCameraMaxZoomFactor | ( | ) |
Gets the maximum zoom ratio supported by the camera.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setCameraFocusPositionInPreview | ( | float | positionX, |
float | positionY | ||
) |
Sets the manual focus position.
positionX | The horizontal coordinate of the touch point in the view. |
positionY | The vertical coordinate of the touch point in the view. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setCameraTorchOn | ( | boolean | isOn | ) |
Enables the camera flash.
isOn | Determines whether to enable the camera flash.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setCameraAutoFocusFaceModeEnabled | ( | boolean | enabled | ) |
Enables the camera auto focus face function.
enabled | Determines whether to enable the camera auto focus face mode.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setCameraCapturerConfiguration | ( | CameraCapturerConfiguration | config | ) |
Sets the camera capturer configuration.
Reimplemented from io.agora.rtc2.RtcEngine.
int io.agora.rtc2.internal.RtcEngineImpl.setCameraExposurePosition | ( | float | positionXinView, |
float | positionYinView | ||
) |
Sets the camera exposure position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
A successful setCameraExposurePosition method call triggers the onCameraExposureAreaChanged callback on the local client.
positionXinView | The horizontal coordinate of the touch point in the view. |
positionYinView | The vertical coordinate of the touch point in the view. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.sendCustomReportMessage | ( | String | id, |
String | category, | ||
String | event, | ||
String | label, | ||
int | value | ||
) |
Agora supports reporting and analyzing customized messages.
This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes.
To try out this function, contact support@agora.io and discuss the format of customized messages with us.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.sendCustomReportMessageEx | ( | String | id, |
String | category, | ||
String | event, | ||
String | label, | ||
int | value, | ||
RtcConnection | connection | ||
) |
Report custom event to argus.
id | Custom Event ID |
category | Custom Event category |
event | Custom Event to report |
label | Custom Event label |
value | Custom Event value |
connection | The connection ID. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized IMediaPlayer io.agora.rtc2.internal.RtcEngineImpl.createMediaPlayer | ( | ) |
Create a media player
You can use this function to create a ffmpeg or simple media player
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableRemoteVideo | ( | boolean | enabled, |
int | uid | ||
) |
enable/disable remote video
enabled | true, start receiving and rendering remote video; false, stop receiving and rendering remote video |
uid | remote user id to enable/disable |
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startAudioRecording | ( | String | filePath, |
int | quality | ||
) |
Starts an audio recording.
The SDK allows recording during a call, which supports either one of the following formats:
Ensure that the directory to save the recording file exists and is writable. This method is usually called after the token, java.lang.String channelName, java.lang.String optionalInfo, int optionalUid) joinChannel method. The recording automatically stops when the leaveChannel method is called.
filePath | Full file path of the recording file. The string of the file name is in UTF-8 code. |
quality | Audio recording quality: |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startAudioRecording | ( | AudioFileRecordingConfig | config | ) |
Starts an audio recording.
The SDK allows recording during a call, which supports either one of the following formats:
Ensure that the directory to save the recording file exists and is writable. This method is usually called after the token, java.lang.String channelName, java.lang.String optionalInfo, int optionalUid) joinChannel method. The recording automatically stops when the leaveChannel method is called.
config | audio file recording config |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopAudioRecording | ( | ) |
Stops the audio recording on the client.
Note: Call this method before calling leaveChannel, otherwise the recording automatically stops when the leaveChannel method is called.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startPlayingStream | ( | String | url | ) |
Starts playing the imported stream from the URL.
url | URL of the imported stream to play. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopPlayingStream | ( | ) |
Stops playing the imported stream.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startAudioMixing | ( | String | filePath, |
boolean | loopback, | ||
boolean | replace, | ||
int | cycle | ||
) |
Starts playing and mixing the music file.
This method mixes the specified local or online audio file with the audio stream from the microphone, or replaces the microphone’s audio stream with the specified local or remote audio file.
You can choose whether the other user can hear the local audio playback and specify the number of playback loops.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopAudioMixing | ( | ) |
Stops playing or mixing the music file.
Call this method when you are in a channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pauseAudioMixing | ( | ) |
Pauses playing and mixing the music file.
Call this method when you are in a channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.resumeAudioMixing | ( | ) |
Resumes playing and mixing the music file.
Call this method when you are in a channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.adjustAudioMixingVolume | ( | int | volume | ) |
Adjusts the volume of audio mixing.
Call this method when you are in a channel.
volume | Audio mixing volume. The value ranges between 0 and 100 (default). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.adjustAudioMixingPublishVolume | ( | int | volume | ) |
Adjusts the audio mixing volume for publishing (for remote users).
volume | Audio mixing volume for publishing. The value ranges between 0 and 100 (default). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.getAudioMixingPublishVolume | ( | ) |
Retrieves the audio mixing volume for publishing. This method helps troubleshoot audio volume related issues.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.adjustAudioMixingPlayoutVolume | ( | int | volume | ) |
Adjusts the audio mixing volume for local playback.
volume | Audio mixing volume for local playback. The value ranges between 0 and 100 (default). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.getAudioMixingPlayoutVolume | ( | ) |
Retrieves the audio mixing volume for local playback. This method helps troubleshoot audio volume related issues.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.getAudioMixingDuration | ( | ) |
Gets the duration (ms) of the music file.
Call this method when you are in a channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.getAudioMixingCurrentPosition | ( | ) |
Gets the playback position (ms) of the music file.
Call this method when you are in a channel.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setAudioMixingPosition | ( | int | pos | ) |
Sets the playback position (ms) of the music file to a different starting position (the default plays from the beginning).
pos | The playback starting position (ms) of the audio mixing file. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.useExternalAudioDevice | ( | ) |
Use the external audio device.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setExternalAudioSource | ( | boolean | enabled, |
int | sampleRate, | ||
int | channels | ||
) |
Sets the external audio source.
joinChannel
.enabled | Determines whether to enable the external audio source:
|
sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setExternalAudioSource | ( | boolean | enabled, |
int | sampleRate, | ||
int | channels, | ||
int | sourceNumber, | ||
boolean | localPlayback, | ||
boolean | publish | ||
) |
Sets the external audio source.
joinChannel
.enabled | Determines whether to enable the external audio source:
|
sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
sourceNumber | The number of audio source per channel.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pushExternalAudioFrame | ( | byte[] | data, |
long | timestamp | ||
) |
Pushes the external audio data to the app.
data | The audio buffer data. |
timestamp | The timestamp of the audio data. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pushExternalAudioFrame | ( | ByteBuffer | data, |
long | timestamp, | ||
int | sourceId | ||
) |
Pushes the external audio data to the app.
data | The audio buffer data. |
timestamp | The timestamp of the audio data. |
sourceId | The audio track ID. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pushExternalAudioFrameEx | ( | ByteBuffer | data, |
long | timestamp, | ||
int | sourceId, | ||
RtcConnection | connection | ||
) |
Pushes the external audio data to the app with specified connection.
data | The audio buffer data. |
timestamp | The timestamp of the audio data. |
sourceId | The audio track ID. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setExternalAudioSink | ( | int | sampleRate, |
int | channels | ||
) |
Sets the external audio sink.
This method applies to scenarios where you want to use external audio data for playback. After calling the RtcEngine#create(RtcEngineConfig) method and pass value of false in the enableAudioDevice
member in the RtcEngineConfig#mEnableAudioDevice, you can call the pullPlaybackAudioFrame method to pull the remote audio data, process it, and play it with the audio effects that you want.
Ensure that you call this method before joining a channel.
enableAudioDevice
member in the RtcEngineConfig#mEnableAudioDevice, the app will not retrieve any audio data from the {int, int, int, int, ByteBuffer, long, int)} onPlaybackFrame} callback. sampleRate The sample rate (Hz) of the external audio sink. You can set this parameter as 16000, 32000, 44100, or 48000. channels The number of audio channels of the external audio sink:1: Mono.2: Stereo. 0: Success.< 0: Failure. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pullPlaybackAudioFrame | ( | byte[] | data, |
int | lengthInByte | ||
) |
Pulls the remote audio frame.
Before calling this method, call the RtcEngine#create(RtcEngineConfig) method and pass value of false in the enableAudioDevice
member in the {}, and call the RtcEngine#setExternalAudioSink(int, int)} method to enable and set the external audio sink. Ensure that you call this method after joining a channel. After a successful method call, the app pulls the decoded and mixed audio data for playback. Once you call the pullPlaybackAudioFrame
method successfully, the app will not retrieve any audio data from the io.agora.rtc2.IAudioFrameObserver#onPlaybackAudioFrame(int, int, int, int, int, ByteBuffer, long, int)} onPlaybackFrame} callback.The difference between the onPlaybackFrame
callback and the pullPlaybackAudioFrame
method is as follows:onPlaybackFrame
: The SDK sends the audio data to the app through this callback. Any delay in processing the audio frames may result in audio jitter.pullPlaybackAudioFrame
: The app pulls the remote audio data. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback. data The audio data that you want to pull. The data format is in byte[]. lengthInByte The data length (byte) of the external audio data. The value of this parameter is related to the audio duration, and the values of the sampleRate
and channels
parameters that you set in RtcEngine#setExternalAudioSink setExternalAudioSink}. Agora recommends setting the audio duration no shorter than 10 ms. The formula for lengthInByte
is: lengthInByte = sampleRate/1000 × 2 × channels × audio duration (ms).
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pullPlaybackAudioFrame | ( | ByteBuffer | data, |
int | lengthInByte | ||
) |
Pulls the remote audio frame.
Before calling this method, call the setExternalAudioSink(enabled: true) method to enable and set the external audio sink.
Ensure that you call this method after joining a channel.
After a successful method call, the app pulls the decoded and mixed audio data for playback.
pullPlaybackAudioFrame
method successfully, the app will not retrieve any audio data from the int, int, int, int, ByteBuffer, long, int) onPlaybackFrame} callback.onPlaybackFrame
callback and the pullPlaybackAudioFrame
method is as follows:onPlaybackFrame
: The SDK sends the audio data to the app through this callback. Any delay in processing the audio frames may result in audio jitter.pullPlaybackAudioFrame
: The app pulls the remote audio data. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.data | The audio data that you want to pull. The data format is in ByteBuffer. |
lengthInByte | The data length (byte) of the external audio data. The value of this parameter is related to the audio duration, and the values of the sampleRate and channels parameters that you set in setExternalAudioSink. Agora recommends setting the audio duration no shorter than 10 ms. The formula for lengthInByte is: lengthInByte = sampleRate/1000 × 2 × channels × audio duration (ms). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLogFile | ( | String | filePath | ) |
Specifies an SDK output log file.
The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable.
filePath | File path of the log file. The string of the log file is in UTF-8. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLogFilter | ( | int | filter | ) |
Sets the output log filter level of the SDK.
You can use one or a combination of the filters. The log level follows the sequence of OFF
, CRITICAL
, ERROR
, WARNING
, INFO
, and DEBUG
. Choose a level and you will see logs preceding that level. For example, if you set the log level to WARNING
, you see the logs within levels CRITICAL
, ERROR
, and WARNING
.
filter | Sets the log filter level:
|
Reimplemented from io.agora.rtc2.RtcEngine.
int io.agora.rtc2.internal.RtcEngineImpl.setLogFileSize | ( | long | fileSizeInKBytes | ) |
Sets the log file size (KB).
The SDK has two log files, each with a default size of 512 KB. If you set fileSizeInBytes
as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.
fileSizeInKBytes | The SDK log file size (KB). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setParameters | ( | String | parameters | ) |
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way.
parameters | Parameter to be set as a JSON string in the specified format. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized String io.agora.rtc2.internal.RtcEngineImpl.getParameters | ( | String | parameters | ) |
Queries internal states
parameters | JSON string, array type |
Reimplemented from io.agora.rtc2.RtcEngineInternal.
synchronized String io.agora.rtc2.internal.RtcEngineImpl.getParameter | ( | String | parameter, |
String | args | ||
) |
Gets the Agora SDK’s parameters for customization purposes. This method is not disclosed yet. Contact support@agora.io for more information.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized String io.agora.rtc2.internal.RtcEngineImpl.getCallId | ( | ) |
Gets the current call ID.
When a user joins a channel on a client, a callId
is generated to identify the call.
After a call ends, you can call rate
or complain
to gather feedback from the customer. These methods require a callId
parameter. To use these feedback methods, call the this method first to retrieve the callId
during the call, and then pass the value as an argument in the rate
or complain
method after the call ends.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized RtcConnection.CONNECTION_STATE_TYPE io.agora.rtc2.internal.RtcEngineImpl.getConnectionState | ( | ) |
Gets the connection state of the SDK.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized RtcConnection.CONNECTION_STATE_TYPE io.agora.rtc2.internal.RtcEngineImpl.getConnectionStateEx | ( | RtcConnection | connection | ) |
Gets the connection state of the SDK.
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.rate | ( | String | callId, |
int | rating, | ||
String | description | ||
) |
Allows a user to rate the call.
It is usually called after the call ends.
callId | The call ID retrieved from the getCallId method. |
rating | The rating of the call between 1 (the lowest score) to 5 (the highest score). |
description | (Optional) The description of the rating. The string length must be less than 800 bytes. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.complain | ( | String | callId, |
String | description | ||
) |
Allows a user to complain about the call quality.
This method is usually called after the call ends.
callId | The call ID retrieved from the getCallId method. |
description | (Optional) The description of the complaint. The string length must be less than 800 bytes. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setChannelProfile | ( | int | profile | ) |
Sets the channel profile.
The RtcEngine differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast.
joinChannel
. You cannot set the channel profile once you have joined the channel.profile | The channel profile:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setClientRole | ( | int | role | ) |
Sets the role of a user.
This method sets the user role as either BROADCASTER or AUDIENCE (default).
By default, all users are audience regardless of the channel profile. Call this method to change the user role to BROADCASTER so that the user can send a stream.
role | The role of the client:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteVideoStreamType | ( | int | uid, |
int | streamType | ||
) |
Sets the remote video stream type.
If the remote user has enabled the dual-stream mode, by default the SDK receives the high-stream video by Call this method to switch to the low-stream video.
uid | ID of the remote user sending the video stream. |
streamType | Sets the video stream type:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteDefaultVideoStreamType | ( | int | streamType | ) |
Sets the default stream type of the remote video if the remote user has enabled dual-stream.
streamType | Sets the default video stream type:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteUserPriority | ( | int | uid, |
int | userPriority | ||
) |
Sets the priority of a remote user's media stream.
Use this method with the setRemoteSubscribeFallbackOption method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality.
uid | The ID of the remote user. |
userPriority | The priority of the remote user:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalPublishFallbackOption | ( | int | option | ) |
Sets the fallback option for the locally published video stream based on the network conditions.
If option
is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY(2), the SDK will:
When the locally published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the {onLocalPublishFallbackToAudioOnly}. Ensure that you call this method before joining a channel. option The fallback option for the locally published video stream: io.agora.rtc.Constants#STREAM_FALLBACK_OPTION_DISABLED STREAM_FALLBACK_OPTION_DISABLED(0)}: (Default) No fallback behavior for the locally published video stream when the uplink network condition is poor. The stream quality is not guaranteed. io.agora.rtc.Constants#STREAM_FALLBACK_OPTION_AUDIO_ONLY STREAM_FALLBACK_OPTION_AUDIO_ONLY(2)}: The locally published video stream falls back to audio only when the uplink network condition is poor. Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteSubscribeFallbackOption | ( | int | option | ) |
Sets the fallback option for the remotely subscribed video stream based on the network conditions.
If option
is set as STREAM_FALLBACK_OPTION_AUDIO_ONLY(2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network condition cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve. When the remotely subscribed video stream falls back to audio only, or the audio-only stream switches back to the video, the SDK triggers the {onRemoteSubscribeFallbackToAudioOnly} callback. Ensure that you call this method before joining a channel. option The fallback option for the remotely subscribed video stream: io.agora.rtc.Constants#STREAM_FALLBACK_OPTION_DISABLED STREAM_FALLBACK_OPTION_DISABLED(0)}: No fallback behavior for the remotely subscribed video stream when the downlink network condition is poor. The quality of the video stream is not guaranteed. io.agora.rtc.Constants#STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW(1)}: (Default) The remotely subscribed video stream falls back to the low-stream video when the downlink network condition worsens. This option works only for this method and not for the { io.agora.rtc.RtcEngine#setLocalPublishFallbackOption(int) setLocalPublishFallbackOption} method. io.agora.rtc.Constants#STREAM_FALLBACK_OPTION_AUDIO_ONLY STREAM_FALLBACK_OPTION_AUDIO_ONLY(2)}: Under poor downlink network conditions, the remotely subscribed video stream first falls back to the low-stream video; and then to an audio-only stream if the network condition worsens. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setEncryptionMode | ( | String | encryptionMode | ) |
Sets the built-in encryption mode.
The Agora Native SDK supports built-in encryption, which is in AES-128-XTS mode by default. If you want to use other modes, call this API to set the encryption mode.
All users in the same channel must use the same encryption mode and password. Refer to information related to the AES encryption algorithm on the differences between encryption modes.
Call setEncryptionSecret to enable the built-in encryption function before calling this API.
Note: Do not use this function together with CDN.
encryptionMode | Encryption mode:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setEncryptionSecret | ( | String | secret | ) |
Specifies an encryption password to enable built-in encryption before joining a channel.
All users in a channel must set the same encryption password. The encryption password is automatically cleared once a user has left the channel. If the encryption password is not specified or set to empty, the encryption function will be disabled.
Note: Do not use this function together with CDN.
secret | Encryption Password |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableEncryption | ( | boolean | enabled, |
EncryptionConfig | config | ||
) |
Enables/Disables the built-in encryption.
In scenarios requiring high security, Agora recommends calling enableEncryption
to enable the built-in encryption before joining a channel.
All users in the same channel must use the same encryption mode and encryption key. Once all users leave the channel, the encryption key of this channel is automatically cleared.
SM4_128_ECB
encryption mode for now. enabled | Whether to enable the built-in encryption.
|
config | Configurations of built-in encryption schemas. See {EncryptionConfig}. 0: Success.< 0: Failure.-2(ERR_INVALID_ARGUMENT): An invalid parameter is used. Set the parameter with a valid value.-7(ERR_NOT_INITIALIZED: The SDK is not initialized. Initialize the IRtcEngine instance before calling this method.-4(ERR_NOT_SUPPORTED): The encryption mode is incorrect or the SDK fails to load the external encryption library. Check the enumeration or reload the external encryption library. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.createDataStream | ( | boolean | reliable, |
boolean | ordered | ||
) |
Creates a data stream.
You can call this method to create a data stream and improve the reliability and ordering of data transmission.
reliable
and ordered
.reliable | Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds:
|
ordered | Sets whether the recipients receive the data stream in the sent order:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.createDataStreamEx | ( | boolean | reliable, |
boolean | ordered, | ||
RtcConnection | connection | ||
) |
Creates a data stream.
Each user can only have up to five data channels at the same time.
reliable |
|
ordered |
|
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.createDataStream | ( | DataStreamConfig | config | ) |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the RtcEngine.
config | The config of data stream. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.createDataStreamEx | ( | DataStreamConfig | config, |
RtcConnection | connection | ||
) |
Creates a data stream.
Each user can create up to five data streams during the lifecycle of the RtcEngine.
config | The config of data stream. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.sendStreamMessage | ( | int | streamId, |
byte[] | message | ||
) |
Sends a data stream.
After calling createDataStream, you can call this method to send a data stream to all users in the channel.
The SDK has the following restrictions on this method:
After the remote user receives the data stream within 5 seconds, the SDK triggers the {onStreamMessage} callback on the remote client. After the remote user does not receive the data stream within 5 seconds, the SDK triggers the { IRtcEngineEventHandler#onStreamMessageError() onStreamMessageError} callback. Call this method after calling RtcEngine#createDataStream() createDataStream}.This method applies only to the COMMUNICATION
profile or to the hosts in the LIVE_BROADCASTING
profile. If an audience in the LIVE_BROADCASTING
profile calls this method, the audience may be switched to a host. streamId ID of the sent data stream returned by the { RtcEngine#createDataStream(boolean reliable, boolean ordered) createDataStream} method. message Sent data. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.sendStreamMessageEx | ( | int | streamId, |
byte[] | message, | ||
RtcConnection | connection | ||
) |
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.
streamId | Stream ID |
message | Data to be sent. |
connection | Connection ID. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.updateSharedContext | ( | EGLContext | sharedContext | ) |
Shared context of MediaCodec. Only takes effect when using the hardware encoder and texture as the input source.
sharedContext | Shared context |
Reimplemented from io.agora.rtc2.RtcEngineInternal.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setTextureId | ( | int | id, |
EGLContext | eglContext, | ||
int | width, | ||
int | height, | ||
long | ts | ||
) |
Sets the texture ID to MediaCodec.
id | Texture ID |
eglContext | eglContext which the texture belongs to |
width | Texture's original width |
height | Texture's original height |
ts | Timestamp of the captured frame (ms) |
Reimplemented from io.agora.rtc2.RtcEngineInternal.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.isTextureEncodeSupported | ( | ) |
Checks whether texture encoding is supported.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setExternalVideoSource | ( | boolean | enable, |
boolean | useTexture, | ||
boolean | encodedFrame | ||
) |
Sets the external video source.
Once the external video source is enabled, the SDK prepares to accept the external video frame.
enable | Determines whether to enable the external video source.
|
useTexture | Determines whether to use textured video data.
|
encodedFrame | Determines whether the external video source is encoded.
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized boolean io.agora.rtc2.internal.RtcEngineImpl.pushExternalVideoFrame | ( | AgoraVideoFrame | frame | ) |
Pushes the video frame using the AgoraVideoFrame class and passes the video frame to the Agora SDK.
Call the setExternalVideoSource method and set pushMode
as true
before calling this method. Otherwise, a failure returns after calling this method.
COMMUNICATION
profile, the SDK does not support textured video frames. true
: The frame is pushed successfully.false
: Failed to push the frame. Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pushExternalVideoFrameEx | ( | AgoraVideoFrame | frame, |
RtcConnection | connection | ||
) |
Pushes the external video frame to the app with specified connection.
frame | The external video frame: ExternalVideoFrame. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
boolean io.agora.rtc2.internal.RtcEngineImpl.pushExternalVideoFrame | ( | VideoFrame | frame | ) |
Pushes the video frame using the VideoFrame
class and passes the video frame to the Agora SDK.
Call the setExternalVideoSource method and set pushMode
as true
before calling this method. Otherwise, a failure returns after calling this method.
buffer
: Buffer The buffer of the video frame.rotation
: int Rotation of the video frame in degrees.timestampNs
: long Timestamp of the video frame in nanoseconds. In the COMMUNICATION
profile, the SDK does not support textured video frames. true
: The frame is pushed successfully.false
: Failed to push the frame. Reimplemented from io.agora.rtc2.RtcEngine.
int io.agora.rtc2.internal.RtcEngineImpl.pushExternalVideoFrameEx | ( | VideoFrame | frame, |
RtcConnection | connection | ||
) |
Pushes the external video frame to the app.
frame | The external video frame: VideoFrame. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pushExternalEncodedVideoFrame | ( | ByteBuffer | data, |
EncodedVideoFrameInfo | frameInfo | ||
) |
Pushes the encoded external video frame to Agora SDK.
data | The encoded external video data, which must be the direct buffer. |
frameInfo | The encoded external video frame info: {EncodedVideoFrameInfo}. 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. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pushExternalEncodedVideoFrameEx | ( | ByteBuffer | data, |
EncodedVideoFrameInfo | frameInfo, | ||
RtcConnection | connection | ||
) |
Pushes the encoded external video frame to the app with specified connection.
data | The encoded external video data, which must be the direct buffer. |
frameInfo | The 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. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerVideoEncodedImageReceiver | ( | IVideoEncodedImageReceiver | receiver | ) |
Registers a receiver object for the encoded video image.
receiver | The IVideoEncodedImageReceiver object: {IVideoEncodedImageReceiver}. 0: Success.< 0: Failure. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.addPublishStreamUrl | ( | String | url, |
boolean | transcodingEnabled | ||
) |
Adds the URL to which the host publishes the stream.
Used in CDN live only.
url | URL to which the host publishes the stream. |
transcodingEnabled | Whether transcoding is enabled. True/False. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.removePublishStreamUrl | ( | String | url | ) |
Removes the URL to which the host publishes the stream.
Used in CDN live only.
Note:
url | URL to which the host publishes the stream. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLiveTranscoding | ( | LiveTranscoding | transcoding | ) |
Sets the video layout and audio for CDN Live.
Used in CDN live only.
transcoding | LiveTranscoding |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.addInjectStreamUrl | ( | String | url, |
LiveInjectStreamConfig | config | ||
) |
Adds a URL address of the added stream into the live broadcast channel.
If successful, you can find the stream in the channels of argus and the uid of the stream is 666.
url | URL address to be added into the ongoing live broadcast. You can use the RTMP, HLS, and FLV live streaming protocols. |
config | LiveInjectStreamConfig |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.removeInjectStreamUrl | ( | String | url | ) |
Removes the URL from the live broadcast.
url | URL address of the added stream to be removed. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startChannelMediaRelay | ( | ChannelMediaRelayConfiguration | channelMediaRelayConfiguration | ) |
Starts to relay media streams across channels.
After a successful method call, the SDK triggers the {onChannelMediaRelayStateChanged} and IRtcEngineEventHandler#onChannelMediaRelayEvent onChannelMediaRelayEvent} callbacks, and these callbacks return the state and events of the media stream relay.If the onChannelMediaRelayStateChanged
callback returns RELAY_STATE_RUNNING(2)
and RELAY_OK(0)
, and the onChannelMediaRelayEvent
callback returns RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL(4)
, the SDK starts relaying media streams between the original and the destination channel.If the onChannelMediaRelayStateChanged
callback returns RELAY_STATE_FAILURE(3)
, an exception occurs during the media stream relay. Contact sales before implementing this function.We do not support string user accounts in this API.Call this method after the -us@ agora .iojoinChannel
method.This method takes effect only when you are a broadcaster in a Live-broadcast channel.After a successful method call, if you want to call this method again, ensure that you call the stopChannelMediaRelay stopChannelMediaRelay} method to quit the current relay. channelMediaRelayConfiguration The configuration of the media stream relay. See { io.agora.rtc2.video.ChannelMediaRelayConfiguration ChannelMediaRelayConfiguration}. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopChannelMediaRelay | ( | ) |
Stops the media stream relay.
Once the relay stops, the broadcaster quits all the destination channels. After a successful method call, the SDK triggers the {onChannelMediaRelayStateChanged} callback. If the callback returns RELAY_STATE_IDLE(0)
and RELAY_OK(0)
, the broadcaster successfully stops the relay. If the method call fails, the SDK triggers the onChannelMediaRelayStateChanged
callback with the RELAY_ERROR_SERVER_NO_RESPONSE(2)
or RELAY_ERROR_SERVER_CONNECTION_LOST(8)
state code. You can leave the channel by calling the leaveChannel() leaveChannel} method, and the media stream relay automatically stops. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.updateChannelMediaRelay | ( | ChannelMediaRelayConfiguration | channelMediaRelayConfiguration | ) |
Updates the channels for media relay.
After the channel media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay
method.
After a successful method call, the SDK triggers the {onChannelMediaRelayEvent} callback with the RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL(7) state code. channelMediaRelayConfiguration The media stream relay configuration: { io.agora.rtc.video.ChannelMediaRelayConfiguration ChannelMediaRelayConfiguration}. 0: Success.< 0: Failure.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized long io.agora.rtc2.internal.RtcEngineImpl.getNativeHandle | ( | ) |
Returns the native handler of the SDK Engine.
This interface is used to get native the C++ handler of the SDK engine that can be used in special scenarios, such as register the audio and video frame observer.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.configPublisher | ( | PublisherConfiguration | config | ) |
Configures the push-stream settings for the engine before joining a channel for CDN Live.
Agora provides a Builder class to configure the push-stream for CDN Live.
Note:
config | PublisherConfiguration |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVideoCompositingLayout | ( | VideoCompositingLayout | layout | ) |
Sets the picture-in-picture layouts for live broadcast.
This method is only applicable when you want to push streams at the Agora server. When you push stream at the server:
The push stream application will format the information of the customized layouts as JSON and package it to the Supplemental Enhancement Information (SEI) of each keyframe when generating the H.264 video stream and pushing it to the CDN vendors through the RTMP protocol.
Note:
layout | VideoCompositingLayout |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.clearVideoCompositingLayout | ( | ) |
Removes the settings made after calling setVideoCompositingLayout.
Reimplemented from io.agora.rtc2.RtcEngine.
IAudioEffectManager io.agora.rtc2.internal.RtcEngineImpl.getAudioEffectManager | ( | ) |
Begin of implementations of IAudioEffectManager
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVoiceBeautifierPreset | ( | int | preset | ) |
Sets an SDK preset voice beautifier effect.
Call this method to set an SDK preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect.
You can set different voice beautifier effects for different scenarios. See Set the Voice Effect.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setAudioEffectPreset | ( | int | preset | ) |
Sets an SDK preset audio effect.
Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect.
You can set different audio effects for different scenarios. See Set the Voice Effect.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVoiceConversionPreset | ( | int | preset | ) |
Sets an SDK preset voice conversion effect.
Call this method to set an SDK preset voice conversion effect for the local user who sends an audio stream. After setting a voice conversion effect, all users in the channel can hear the effect.
You can set different voice conversion effects for different scenarios. See Set the Voice Effect.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setAudioEffectParameters | ( | int | preset, |
int | param1, | ||
int | param2 | ||
) |
Sets parameters for SDK preset audio effects.
Call this method to set the following parameters for the local user who sends an audio stream:
After setting parameters, all users in the channel can hear the relevant effect.
setAudioProfile
and setting the scenario parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
before calling this method.AUDIO_PROFILE_SPEECH_STANDARD(1)
; otherwise, this method call does not take effect.setAudioEffectParameters
:
preset | The options for SDK preset audio effects:
|
param1 |
|
param2 |
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVoiceBeautifierParameters | ( | int | preset, |
int | param1, | ||
int | param2 | ||
) |
Sets parameters for SDK preset voice beautifier effects.
Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream.
After you call this method successfully, all users in the channel can hear the relevant effect.
To achieve better audio effect quality, before you call this method, Agora recommends calling setAudioProfile, and setting the scenario parameter to AUDIO_SCENARIO_GAME_STREAMING(3)
and the profile parameter to AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)
.
profile
parameter of setAudioProfile
to AUDIO_PROFILE_SPEECH_STANDARD(1)
; otherwise, this method call does not take effect.setVoiceBeautifierParameters
:
preset | The options for SDK preset voice beautifier effects:
|
param1 | The gender characteristics options for the singing voice:
|
param2 | The reverberation effects options:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVoiceConversionParameters | ( | int | preset, |
int | param1, | ||
int | param2 | ||
) |
Set parameters for SDK preset voice conversion.
preset | The options for SDK preset audio effects. See #VOICE_CONVERSION_PRESET. |
param1 | reserved. |
param2 | reserved. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalVoicePitch | ( | double | pitch | ) |
Sets the voice pitch of the local speaker.
pitch | Voice frequency, in the range of 0.5 to 2.0. The default value is 1.0. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalVoiceEqualization | ( | int | bandFrequency, |
int | bandGain | ||
) |
Sets the local voice equalization effect.
bandFrequency | The band frequency ranging from 0 to 9; representing the respective 10-band center frequencies of voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. |
bandGain | Gain of each band in dB; ranging from -15 to 15. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalVoiceReverb | ( | int | reverbKey, |
int | value | ||
) |
Sets the local voice reverberation.
reverbKey | The reverberation key. This method contains five reverberation keys. For details, see the description of each value. |
value | Local voice reverberation value: |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalVoiceChanger | ( | int | voiceChanger | ) |
Sets the local voice changer option.
This method can be used to set the local voice effect for users in a communication channel or broadcasters in a live broadcast channel. Voice changer options include the following voice effects:
VOICE_CHANGER_XXX
: Changes the local voice to an old man, a little boy, or the Hulk. Applies to the voice talk scenario.VOICE_BEAUTY_XXX
: Beautifies the local voice by making it sound more vigorous, resounding, or adding spacial resonance. Applies to the voice talk and singing scenario.GENERAL_VOICE_BEAUTY_XXX
: Adds gender-based beautification effect to the local voice. Applies to the voice talk scenario.AUDIO_PROFILE_MUSIC_HIGH_QUALITY
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO
.voiceChanger | The local voice changer option:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLocalVoiceReverbPreset | ( | int | reverbPreset | ) |
Sets the local voice reverberation option.
This method sets the local voice reverberation for users in a communication channel or broadcasters in a live-broadcast channel. After successfully calling this method, all users in the channel can hear the voice with reverberation.
AUDIO_REVERB_FX
, ensure that you set profile in setAudioProfile as AUDIO_PROFILE_MUSIC_HIGH_QUALITY
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO
. Otherwise, this method call does not take effect.reverbPreset | The local voice reverberation option. To achieve better voice effects, Agora recommends the enumeration whose name begins with AUDIO_REVERB_FX .
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setInEarMonitoringVolume | ( | int | volume | ) |
Sets the volume of the in-ear monitoring.
volume | The volume of the in-ear monitor, ranging from 0 to 100. The default value is 100. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized double io.agora.rtc2.internal.RtcEngineImpl.getEffectsVolume | ( | ) |
Gets the volume of the audio effects.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setEffectsVolume | ( | double | volume | ) |
Sets the volume of audio effects.
volume | The volume of audio effects. The value ranges between 0.0 and 100.0 (default). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.preloadEffect | ( | int | soundId, |
String | filePath | ||
) |
Preloads a specified audio effect.
This method preloads only one specified audio effect into the memory each time it is called. To preload multiple audio effects, call this method multiple times.
After preloading, you can call playEffect to play the preloaded audio effect or call playAllEffects to play all the preloaded audio effects.
soundId | The ID of the audio effect. |
filePath | The absolute path of the local audio effect file or the URL of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.playEffect | ( | int | soundId, |
String | filePath, | ||
int | loopCount, | ||
double | pitch, | ||
double | pan, | ||
double | gain, | ||
boolean | publish | ||
) |
Plays a specified audio effect.
After calling preloadEffect, you can call this method to play the specified audio effect for all users in the channel.
This method plays only one specified audio effect each time it is called. To play multiple audio effects, call this method multiple times.
soundId | The ID of the audio effect. |
filePath | The absolute path of the local audio effect file or the URL of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav. |
loopCount | The number of times the audio effect loops: |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.playAllEffects | ( | int | loopCount, |
double | pitch, | ||
double | pan, | ||
double | gain, | ||
boolean | publish | ||
) |
Plays all audio effects.
After calling preloadEffect multiple times to preload multiple audio effects into the memory, you can call this method to play all the specified audio effects for all users in the channel.
loopCount | The number of times the audio effect loops: |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.getVolumeOfEffect | ( | int | soundId | ) |
Get the volume of a specified sound effect.
soundId | The ID of the audio effect. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setVolumeOfEffect | ( | int | soundId, |
double | volume | ||
) |
Sets the volume of the specified audio effect.
soundId | The ID of the audio effect. |
volume | The volume of the specified audio effect. The value ranges between 0.0 and 100.0 (default). |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pauseEffect | ( | int | soundId | ) |
Pauses playing the specified audio effect.
soundId | The ID of the audio effect. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.pauseAllEffects | ( | ) |
Pauses playing all audio effects.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.resumeEffect | ( | int | soundId | ) |
Resumes playing the specified audio effect.
soundId | The ID of the audio effect. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.resumeAllEffects | ( | ) |
Resumes playing all audio effects.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopEffect | ( | int | soundId | ) |
Stops playing the specified audio effect.
soundId | The ID of the audio effect. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopAllEffects | ( | ) |
Stops playing all audio effects.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.unloadEffect | ( | int | soundId | ) |
Releases the specific preloaded audio effect from the memory.
soundId | The ID of the audio effect. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.unloadAllEffects | ( | ) |
Releases all preloaded audio effects from the memory.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setApiCallMode | ( | int | syncCallTimeout | ) |
End of implementations of IAudioEffectManager
Reimplemented from io.agora.rtc2.RtcEngineInternal.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.startScreenCapture | ( | Intent | mediaProjectionPermissionResultData, |
ScreenCaptureParameters | parameters | ||
) |
Screen sharing by specifying a result data which obtained from a successful screen capture request.
mediaProjectionPermissionResultData | The resulting data from android.app.Activity#onActivityResult . |
parameters | Sets the screen sharing encoding parameters. See ScreenCaptureParameters. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.stopScreenCapture | ( | ) |
Stops the screen sharing.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerVideoFrameObserver | ( | IVideoFrameObserver | observer | ) |
Registers a video frame observer object.
You need to implement the IVideoFrameObserver class in this method, and register callbacks according to your scenarios.
After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received.
width
and height
parameters, which may be adapted under the following circumstances:observer | Video frame observer object instance. See {IVideoFrameObserver}. 0: Success.< 0: Failure. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerMediaMetadataObserver | ( | IMetadataObserver | observer, |
int | type | ||
) |
Registers the metadata observer.
You need to implement the IMetadataObserver class and specify the metadata type in this method. This method enables you to add synchronized metadata in the video stream for more diversified live interactive streaming, such as sending shopping links, digital coupons, and online quizzes.
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.unregisterMediaMetadataObserver | ( | IMetadataObserver | observer, |
int | type | ||
) |
Unregisters the metadata observer.
observer | The IMetadataObserver class. |
type | The metadata type. Currently, the SDK supports {VIDEO_METADATA(0)} only. 0: Success.< 0: Failure. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setLogLevel | ( | int | level | ) |
Sets the output log level of the SDK.
You can use one of the level defined in LogLevel.
level | Sets the log level: LogLevel. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableExternalAudioSourceLocalPlayback | ( | boolean | enabled | ) |
Enable or disable the external audio source local playback.
enabled | Determines whether to enable the external audio source local playback: |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.enableSoundPositionIndication | ( | boolean | enabled | ) |
Enables/Disables stereo panning for remote users. Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition.
enabled | Sets whether or not to enable stereo panning for remote users:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteVoicePosition | ( | int | uid, |
double | pan, | ||
double | gain | ||
) |
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.
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0:
|
gain | Gain 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. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.setRemoteVoicePositionEx | ( | int | uid, |
double | pan, | ||
double | gain, | ||
RtcConnection | connection | ||
) |
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.
uid | The ID of the remote user. |
pan | The sound position of the remote user. The value ranges from -1.0 to 1.0:
|
gain | Gain 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. |
connection | An output parameter which is used to control different connection instances. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.registerLocalUserAccount | ( | String | appId, |
String | userAccount | ||
) |
Registers a user account.
Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and user account of the local user.
To join a channel with a user account, you can choose either of the following:
The difference between the two is that for the former, the time elapsed between calling the joinChannelWithUserAccount method and joining the channel is shorter than the latter.
userAccount
parameter. Otherwise, this method does not take effect.userAccount
parameter is unique in the channel.appId | The App ID of your project. |
userAccount | The 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:
|
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.joinChannelWithUserAccount | ( | String | token, |
String | channelName, | ||
String | userAccount | ||
) |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelName | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The 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:
|
options | The channel media options: ChannelMediaOptions |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.joinChannelWithUserAccount | ( | String | token, |
String | channelName, | ||
String | userAccount, | ||
ChannelMediaOptions | options | ||
) |
Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile. Compared with RtcEngine#joinChannelWithUserAccount(String token, String channelName, String userAccount) joinChannelWithUserAccount}[1/2], this method has the options
parameter to configure whether the end user automatically subscribes to all remote audio and video streams in a channel when joining the channel. By default, the user subscribes to the audio and video streams of all the other users in the channel, thus incurring all associated usage costs. To unsubscribe, set the options
parameter or call the mute
methods accordingly.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. token The token generated at your server. For details, see Generate a token. channelName | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: |
userAccount | The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. |
options | The channel media options: ChannelMediaOptions. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized int io.agora.rtc2.internal.RtcEngineImpl.joinChannelWithUserAccountEx | ( | String | token, |
String | channelId, | ||
String | userAccount, | ||
ChannelMediaOptions | options, | ||
IRtcEngineEventHandler | eventHandler, | ||
RtcConnection | connection | ||
) |
Joins the channel with a user account.
After the user successfully joins the channel, the SDK triggers the following callbacks:
COMMUNICATION
profile, or is a host in the LIVE_BROADCASTING
profile.token | The token generated at your server:
|
channelId | The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
|
userAccount | The 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:
|
options | The channel media options: ChannelMediaOptions |
Reimplemented from io.agora.rtc2.RtcEngineEx.
UserInfo io.agora.rtc2.internal.RtcEngineImpl.getUserInfoByUserAccount | ( | String | userAccount | ) |
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.
userAccount | The user account of the user. Ensure that you set this parameter. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized UserInfo io.agora.rtc2.internal.RtcEngineImpl.getUserInfoByUserAccount | ( | String | userAccount, |
RtcConnection | connection | ||
) |
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.
userAccount | The user account of the user. Ensure that you set this parameter. |
Reimplemented from io.agora.rtc2.RtcEngineEx.
synchronized UserInfo io.agora.rtc2.internal.RtcEngineImpl.getUserInfoByUid | ( | int | uid | ) |
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.
uid | The user ID of the remote user. Ensure that you set this parameter. |
Reimplemented from io.agora.rtc2.RtcEngine.
synchronized UserInfo io.agora.rtc2.internal.RtcEngineImpl.getUserInfoByUid | ( | int | uid, |
RtcConnection | connection | ||
) |
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.
uid | The user ID of the remote user. Ensure that you set this parameter. |
Reimplemented from io.agora.rtc2.RtcEngineEx.