API Overview
Agora provides a flexible combination of APIs deployed globally to deliver reliable real-time audio and video communication.
Initialization
| API | Description |
|---|---|
| createAgoraRtcEngine | Creates an IRtcEngine object. |
| initialize | Creates and initializes IRtcEngine. |
| registerEventHandler | Adds a primary callback event. |
| addListener | Adds an IRtcEngineEvent listener. |
| getMediaEngine | Gets the IMediaEngine object. |
| release | Destroys the IRtcEngine object. |
| removeAllListeners | Removes all listeners for the specified event type. |
| unregisterEventHandler | Removes the specified callback event. |
| removeListener | Removes the specified IRtcEngineEvent listener. |
Channel Management
| API | Description |
|---|---|
| setChannelProfile | Sets the channel profile. |
| joinChannel | Sets media options and joins a channel. |
| joinChannelEx | Joins a channel. |
| updateChannelMediaOptions | Updates the channel media options after joining a channel. |
| updateChannelMediaOptionsEx | Updates the channel media options after joining a channel. |
| leaveChannel | Sets channel options and leaves the channel. |
| leaveChannelEx | Sets channel options and leaves the channel. |
| preloadChannel | Preloads a channel using token, channelId, and uid. |
| updatePreloadChannelToken | Updates the wildcard token for the preloaded channel. |
| renewToken | Renews the token. |
| setClientRole | Sets the user role and audience latency level in a live streaming scenario. |
| onClientRoleChanged | Occurs when the user role or audience latency level is switched. |
| onClientRoleChangeFailed | Occurs when the user role switch fails. |
| onError | Occurs when an error is reported. |
| onJoinChannelSuccess | Occurs when a user joins a channel successfully. |
| onLeaveChannel | Occurs when a user leaves the channel. |
| onRejoinChannelSuccess | Occurs when the user successfully rejoins the channel. |
| onRenewTokenResult | Callback for the result of calling the renewToken method. |
| onRequestToken | Occurs when the token has expired. |
| onRtcStats | Reports the statistics of the current call. |
| onTokenPrivilegeWillExpire | Occurs when the token is about to expire in 30 seconds. |
| onUserJoined | Occurs when a remote user (in Communication) or host (in Live Broadcast) joins the current channel. |
| onUserOffline | Callback when a remote user (in communication) or host (in live streaming) leaves the current channel. |
Publish and Subscribe
| API | Description |
|---|---|
| muteAllRemoteAudioStreams | Stops or resumes subscribing to all remote users' audio streams. |
| muteAllRemoteAudioStreamsEx | Stops or resumes subscribing to all remote users' audio streams. |
| muteAllRemoteVideoStreams | Stops or resumes subscribing to all remote users' video streams. |
| muteAllRemoteVideoStreamsEx | Stops or resumes subscribing to all remote users' video streams. |
| muteLocalAudioStream | Stops or resumes publishing the local audio stream. |
| muteLocalAudioStreamEx | Stops or resumes publishing the local audio stream. |
| muteLocalVideoStream | Stops or resumes publishing the local video stream. |
| muteLocalVideoStreamEx | Stops or resumes publishing the local video stream. |
| muteRemoteAudioStream | Stops or resumes subscribing to the specified remote user's audio stream. |
| muteRemoteAudioStreamEx | Stops or resumes receiving the specified audio stream. |
| muteRemoteVideoStream | Stops or resumes subscribing to the video stream of a specified remote user. |
| muteRemoteVideoStreamEx | Stops or resumes receiving a specified video stream. |
| setDualStreamMode | Sets the dual-stream mode and configures the low-quality video stream on the sender side. |
| setDualStreamModeEx | Sets the dual-stream mode on the sender side. |
| setRemoteDefaultVideoStreamType | Sets the default video stream type to subscribe to. |
| setRemoteVideoStreamType | Sets the video stream type to subscribe to. |
| setRemoteVideoStreamTypeEx | Sets the type of video stream to subscribe to. |
| setRemoteVideoSubscriptionOptions | Sets the subscription options for remote video streams. |
| setRemoteVideoSubscriptionOptionsEx | Sets the subscription options for remote video streams. |
| setSubscribeAudioAllowlist | Sets the audio subscription allowlist. |
| setSubscribeAudioAllowlistEx | Sets the audio subscription allowlist. |
| setSubscribeAudioBlocklist | Sets the audio subscription blocklist. |
| setSubscribeAudioBlocklistEx | Sets the audio subscription blocklist. |
| setSubscribeVideoAllowlist | Sets the video subscription allowlist. |
| setSubscribeVideoAllowlistEx | Sets the video subscription allowlist. |
| setSubscribeVideoBlocklist | Sets the video subscription blocklist. |
| setSubscribeVideoBlocklistEx | Sets the video subscription blocklist. |
| onAudioPublishStateChanged | Callback for audio publish state changes. |
| onAudioSubscribeStateChanged | Callback when the audio subscription state changes. |
| onVideoSubscribeStateChanged | Callback when the video subscription state changes. |
Audio Basic Features
| API | Description |
|---|---|
| adjustPlaybackSignalVolume | Adjusts the signal volume of all remote users for local playback. |
| adjustUserPlaybackSignalVolume | Adjusts the playback volume of a specified remote user locally. |
| adjustUserPlaybackSignalVolumeEx | Adjusts the playback volume of a specified remote user locally. |
| disableAudio | Disables the audio module. |
| enableAudio | Enables the audio module. |
| enableAudioVolumeIndication | Enables audio volume indication. |
| enableAudioVolumeIndicationEx | Enables audio volume indication. |
| setAudioProfile | Sets the audio encoding profile and scenario. |
| setAudioScenario | Sets the audio scenario. |
| setAudioSessionOperationRestriction | Sets the SDK’s operation permissions on the Audio Session. |
| onActiveSpeaker | Occurs when the most active remote speaker is detected. |
| onAudioVolumeIndication | Occurs when the SDK reports the volume of users. |
| onFirstLocalAudioFramePublished | Occurs when the first local audio frame is published. |
| onLocalAudioStateChanged | Occurs when the local audio state changes. |
| onLocalAudioStats | Reports the statistics of the local audio stream during a call. |
| onRemoteAudioStateChanged | Occurs when the state of the remote audio stream changes. |
| onRemoteAudioStats | Reports the statistics of the audio stream sent by each remote user during a call. |
| onRemoteAudioTransportStats | Reports the transport statistics of the audio stream sent by each remote user during a call. |
| onUserMuteAudio | Occurs when a remote user (in the Communication profile) or host (in the Live Broadcast profile) stops or resumes sending audio streams. |
Audio Capture
| API | Description |
|---|---|
| adjustRecordingSignalVolume | Adjusts the recording signal volume. |
| enableInEarMonitoring | Enables in-ear monitoring. |
| enableLocalAudio | Enables or disables the local audio capture. |
| muteRecordingSignal | Whether to mute the recording signal. |
| setInEarMonitoringVolume | Sets the in-ear monitoring volume. |
Audio Effects
| API | Description |
|---|---|
| enableVoiceAITuner | Enables or disables the AI tuner feature. |
| setAdvancedAudioOptions | Sets advanced audio options. |
| setAINSMode | Enables or disables AI noise reduction and sets the noise reduction mode. |
| setAudioEffectParameters | Sets parameters for SDK preset voice effects. |
| setAudioEffectPreset | Sets the SDK's preset voice effects. |
| setLocalVoiceEqualization | Sets the local voice equalization effect. |
| setLocalVoiceFormant | Sets the formant ratio to change the voice timbre. |
| setLocalVoicePitch | Sets the local voice pitch. |
| setLocalVoiceReverb | Sets local voice reverb effects. |
| setVoiceBeautifierParameters | Sets parameters for preset voice beautifier effects. |
| setVoiceBeautifierPreset | Sets a predefined voice beautifier effect. |
| setVoiceConversionPreset | Sets a predefined voice conversion effect. |
Stereo
| API | Description |
|---|---|
| enableSoundPositionIndication | Enables/disables stereo sound for remote users. |
| setRemoteVoicePosition | Sets the 2D position of a remote user's voice, i.e., horizontal position. |
| setRemoteVoicePositionEx | Sets the 2D position of a remote user's voice, i.e., horizontal position. |
Spatial Audio
| API | Description |
|---|---|
| initialize | Initializes ILocalSpatialAudioEngine. |
| clearRemotePositions | Deletes the spatial position information of all remote users. |
| enableSpatialAudio | Enables or disables spatial audio. |
| getLocalSpatialAudioEngine | Gets the ILocalSpatialAudioEngine object. |
| muteAllRemoteAudioStreams | Unsubscribes from or resumes the audio streams of all remote users. |
| muteLocalAudioStream | Stops or resumes publishing the local audio stream. |
| muteRemoteAudioStream | Unsubscribes from or resumes the audio stream of a specified remote user. |
| release | Destroys IBaseSpatialAudioEngine. |
| removeRemotePosition | Deletes the spatial position information of the specified remote user. |
| setAudioRecvRange | Sets the audio reception range for the local user. |
| setDistanceUnit | Sets the length (in meters) of one unit of distance in the game engine. |
| setHeadphoneEQParameters | Sets the low and high frequency parameters of the headphone equalizer. |
| setHeadphoneEQPreset | Sets a preset headphone equalizer effect. |
| setMaxAudioRecvCount | Sets the maximum number of audio streams that can be received within the audio reception range. |
| setPlayerAttenuation | Sets the sound attenuation property of the media player. |
| setRemoteAudioAttenuation | Sets the audio attenuation effect for the specified user. |
| setRemoteUserSpatialAudioParams | Sets the spatial audio parameters for a remote user. |
| setSpatialAudioParams | Enables or disables spatial audio for the media player. |
| setZones | Sets sound insulation zones. |
| updatePlayerPositionInfo | Updates the spatial position of the media player. |
| updateRemotePosition | Updates the spatial position information of a remote user. |
| updateSelfPosition | Updates the spatial position of the local user. |
Audio Mixer
| API | Description |
|---|---|
| startLocalAudioMixer | Starts local audio mixing. |
| stopLocalAudioMixer | Stops local audio mixing. |
| updateLocalAudioMixerConfiguration | Updates the configuration for local audio mixing. |
Raw Audio Data
| API | Description |
|---|---|
| registerAudioFrameObserver | Registers an audio frame observer. |
| setEarMonitoringAudioFrameParameters | Sets the audio data format for in-ear monitoring. |
| setMixedAudioFrameParameters | Sets the raw audio data format after audio capture and playback mixing. |
| setPlaybackAudioFrameBeforeMixingParameters | Sets the raw audio playback data format before mixing. |
| setPlaybackAudioFrameParameters | Sets the data format of the playback raw audio. |
| setRecordingAudioFrameParameters | Sets the data format of the recorded raw audio. |
| unregisterAudioFrameObserver | Unregisters the audio frame observer. |
| onEarMonitoringAudioFrame | Receives the raw audio data of the ear monitoring. |
| onMixedAudioFrame | Retrieves the data after audio mixing of capture and playback. |
| onPlaybackAudioFrame | Receives the raw audio data of the playback. |
| onPlaybackAudioFrameBeforeMixing | Receives the audio of the subscribed remote user before mixing. |
| onRecordAudioFrame | Receives the raw audio data of the recording. |
Encoded Audio Data
| API | Description |
|---|---|
| registerAudioEncodedFrameObserver | Registers an audio encoded frame observer. |
| unregisterAudioEncodedFrameObserver | Unregisters an audio encoded frame observer. |
| onMixedAudioEncodedFrame | Retrieves the encoded audio data after mixing local and all remote users' audio. |
| onPlaybackAudioEncodedFrame | Retrieves the encoded audio data of all remote users. |
| onRecordAudioEncodedFrame | Retrieves the encoded audio data of the local user. |
Custom Audio Capture and Rendering
| API | Description |
|---|---|
| adjustCustomAudioPlayoutVolume | Adjusts the playback volume of a custom audio capture track locally. |
| adjustCustomAudioPublishVolume | Adjusts the playback volume of a custom audio capture track on the remote end. |
| createCustomAudioTrack | Creates a custom audio capture track. |
| destroyCustomAudioTrack | Destroys the specified audio track. |
| enableCustomAudioLocalPlayback | Sets whether to play external audio sources locally. |
| pullAudioFrame | Pulls remote audio data. |
| pushAudioFrame | Pushes external audio frames. |
| setExternalAudioSink | Sets the external audio rendering. |
Audio Spectrum
| API | Description |
|---|---|
| disableAudioSpectrumMonitor | Disables audio spectrum monitoring. |
| enableAudioSpectrumMonitor | Enables audio spectrum monitoring. |
| registerAudioSpectrumObserver | Registers an audio spectrum observer. |
| unregisterAudioSpectrumObserver | Unregisters the audio spectrum observer. |
| onLocalAudioSpectrum | Receives the local audio spectrum. |
| onRemoteAudioSpectrum | Receives the remote audio spectrum. |
Video Basic Features
| API | Description |
|---|---|
| disableVideo | Disables the video module. |
| enableLocalVideo | Enables or disables local video capture. |
| enableVideo | Enables the video module. |
| setVideoEncoderConfiguration | Sets video encoding properties. |
| setVideoEncoderConfigurationEx | Sets video encoding properties. |
| setVideoScenario | Sets the video application scenario. |
| startPreviewWithoutSourceType | Starts video preview. |
| startPreview | Starts video preview and specifies the video source for preview. |
| stopPreview | Stops video preview. |
| onFirstLocalVideoFrame | Callback when the first local video frame is rendered. |
| onFirstLocalVideoFramePublished | Callback when the first local video frame is published. |
| onFirstRemoteVideoDecoded | Callback when the first remote video frame is received and decoded. |
| onFirstRemoteVideoFrame | Callback when the renderer receives the first remote video frame. |
| onLocalVideoEvent | Callback triggered when a local video event occurs. |
| onLocalVideoStateChanged | Callback when the local video state changes. |
| onLocalVideoStats | Callback for local video stream statistics. |
| onRemoteVideoStateChanged | Callback when the remote video state changes. |
| onRemoteVideoStats | Callback for remote video stream statistics during a call. |
| onUserEnableVideo | Occurs when a remote user enables or disables the video module. |
| onUserMuteVideo | Occurs when a remote user stops or resumes publishing the video stream. |
| onVideoPublishStateChanged | Occurs when the video publishing state changes. |
| onVideoSizeChanged | Occurs when the size or rotation of the local or remote video changes. |
Camera Capture
| API | Description |
|---|---|
| setCameraStabilizationMode | Sets the camera stabilization mode. |
| startCameraCapture | Starts video capture using the camera. |
| stopCameraCapture | Stops capturing video from the camera. |
Screen Capture
| API | Description |
|---|---|
| queryScreenCaptureCapability | Queries the maximum frame rate supported by the device for screen sharing. |
| setExternalMediaProjection | Sets an external MediaProjection to capture screen video streams. |
| setScreenCaptureContentHint | Sets the content type of screen sharing. |
| setScreenCaptureScenario | Sets the screen sharing scenario. |
| startScreenCapture | Starts screen capture. |
| stopScreenCapture | Stops screen capture. |
| updateScreenCapture | Updates the parameter configuration for screen capture. |
| updateScreenCaptureParameters | Updates the parameter configuration for screen capture. |
| updateScreenCaptureRegion | Updates the screen capture region. |
Snapshot
| API | Description |
|---|---|
| enableContentInspect | Enables/disables local snapshot upload. |
| enableContentInspectEx | Enables/disables local snapshot upload. |
| takeSnapshot | Takes a snapshot of the video. |
| takeSnapshotWithConfig | Takes a video snapshot at a specified observation point. |
| takeSnapshotEx | Takes a snapshot of the video using the connection ID. |
| takeSnapshotWithConfigEx | Takes a snapshot of the video at a specified observation point using the connection ID. |
| onSnapshotTaken | Callback for snapshot result. |
Virtual Background
| API | Description |
|---|---|
| enableVirtualBackground | Enables/disables the virtual background. |
Local Video Transcoding
| API | Description |
|---|---|
| startLocalVideoTranscoder | Starts local video compositing. |
| stopLocalVideoTranscoder | Stops local video compositing. |
| updateLocalTranscoderConfiguration | Updates the local video compositing configuration. |
| onLocalVideoTranscoderError | Callback when a local video compositing error occurs. |
Video Enhancement
| API | Description |
|---|---|
| addOrUpdateVideoEffect | Adds or updates the effect of the specified video effect node and template. |
| createVideoEffectObject | Creates an IVideoEffectObject video effect object. |
| destroyVideoEffectObject | Destroys the video effect object. |
| getFaceShapeAreaOptions | Gets face shaping area options. |
| getFaceShapeBeautyOptions | Gets face beauty effect options. |
| getVideoEffectBoolParam | Gets the boolean parameter in the video effect. |
| getVideoEffectFloatParam | Gets the value of the specified float parameter in the video effect. |
| getVideoEffectIntParam | Gets the integer parameter in the video effect. |
| performVideoEffectAction | Performs an action on the specified video effect node. |
| removeVideoEffect | Removes the video effect with the specified node ID. |
| setBeautyEffectOptions | Sets beauty effect options. |
| setColorEnhanceOptions | Sets color enhancement options. |
| setFaceShapeAreaOptions | Sets face shape area options and specifies the media source. |
| setFaceShapeBeautyOptions | Sets face shaping effect options and specifies the media source. |
| setFilterEffectOptions | Sets filter effect options and specifies the media source. |
| setLowlightEnhanceOptions | Enables low-light enhancement. |
| setVideoDenoiserOptions | Enables video denoising. |
| setVideoEffectBoolParam | Sets a boolean parameter for the video effect. |
| setVideoEffectFloatParam | Sets a float parameter for the video effect. |
| setVideoEffectIntParam | setVideoEffectIntParam: Sets an integer parameter for the video effect. |
Face Detection
| API | Description |
|---|---|
| enableFaceDetection | Enables/disables local face detection. |
| onFacePositionChanged | Reports local face detection results. |
Speech Driven
| API | Description |
|---|---|
| registerFaceInfoObserver | Registers a face information observer. |
| unregisterFaceInfoObserver | Unregisters the face information observer. |
| onFaceInfo | Reports face information processed by the voice driver extension. |
Center Stage
| API | Description |
|---|---|
| enableCameraCenterStage | Enables or disables the Center Stage feature. |
| isCameraCenterStageSupported | Checks whether the camera supports Center Stage. |
Watermark
| API | Description |
|---|---|
| addVideoWatermarkWithConfig | Adds a watermark image to the local video stream. |
| addVideoWatermarkWithConfigEx | Adds a watermark image to the local video. |
| clearVideoWatermarkEx | Removes added video watermarks. |
| clearVideoWatermarks | Removes added video watermarks. |
| removeVideoWatermark | Removes the watermark image from the local video. |
| removeVideoWatermarkEx | Removes the specified watermark image from the local or remote video stream. |
Image Source
| API | Description |
|---|---|
| enableVideoImageSource | Enables or disables image placeholder streaming. |
Video Rendering
| API | Description |
|---|---|
| enableInstantMediaRendering | Enables accelerated rendering of audio and video frames. |
| setLocalRenderMode | Updates the local view display mode. |
| setLocalRenderTargetFps | Sets the maximum frame rate for local video rendering. |
| setRemoteRenderMode | Updates the remote view display mode. |
| setRemoteRenderModeEx | Sets the remote view display mode. |
| setRemoteRenderTargetFps | Sets the maximum frame rate for remote video rendering. |
| setRenderMode | Sets the rendering mode of the player view. |
| startMediaRenderingTracing | Starts video frame rendering tracing. |
| startMediaRenderingTracingEx | Starts video frame rendering tracing. |
| onTranscodedStreamLayoutInfo | Callback for received mixed video stream with layout information. |
| onVideoRenderingTracingResult | Callback for video frame rendering events. |
Raw Video Data
| API | Description |
|---|---|
| registerVideoFrameObserver | Registers a raw video frame observer. |
| unregisterVideoFrameObserver | Unregisters the video frame observer. |
| onCaptureVideoFrame | Gets video data captured by the local device. |
| onFrame | Callback when a video frame is received. |
| onPreEncodeVideoFrame | Retrieves local video data before encoding. |
| onRenderVideoFrame | Retrieves video data sent by the remote user. |
Encoded Video Data
| API | Description |
|---|---|
| addListener | Adds an IMediaEngineEvent listener. |
| registerVideoEncodedFrameObserver | Registers a video frame observer for encoded video images. |
| removeAllListeners | Removes all listeners for the specified event. |
| removeListener | Removes a specified IMediaEngineEvent listener. |
| unregisterVideoEncodedFrameObserver | Unregisters the video frame observer for encoded video images. |
| onEncodedVideoFrameReceived | Reports that the receiver has received a remote encoded video frame. |
Custom Video Capture and Rendering
| API | Description |
|---|---|
| createCustomVideoTrack | Creates a custom video track. |
| destroyCustomVideoTrack | Destroys the specified video track. |
| isPipActivated | Checks whether picture-in-picture mode is activated. |
| pipDispose | Releases resources related to picture-in-picture. |
| pipIsAutoEnterSupported | Checks whether auto-entering picture-in-picture mode is supported. |
| pipIsSupported | Checks whether the current device supports picture-in-picture mode. |
| pipSetup | Configures picture-in-picture mode. |
| pipStart | Starts picture-in-picture mode. |
| pipStop | Stops picture-in-picture mode. |
| pushVideoFrame | Publishes an external raw video frame to the channel through a custom video track. |
| registerPipStateChangedObserver | Registers a picture-in-picture state change observer. |
| release | Releases resources related to picture-in-picture. |
| setExternalRemoteEglContext | Sets the EGL context for rendering remote video streams. |
| setExternalVideoSource | Sets the external video source. |
| unregisterPipStateChangedObserver | Unregisters the picture-in-picture state change observer. |
| onPipStateChanged | Callback for picture-in-picture state changes. |
Audio Mixing
| API | Description |
|---|---|
| adjustAudioMixingPlayoutVolume | Adjusts the local playback volume of the music file. |
| adjustAudioMixingPublishVolume | Adjusts the remote playback volume of the music file. |
| adjustAudioMixingVolume | Adjusts the playback volume of the music file. |
| getAudioMixingCurrentPosition | Gets the playback progress of the music file. |
| getAudioMixingDuration | Gets the total duration of the music file. |
| getAudioMixingPlayoutVolume | Gets the local playback volume of the music file. |
| getAudioMixingPublishVolume | Gets the remote playback volume of the music file. |
| getAudioTrackCount | Gets the audio track index of the current music file. |
| pauseAudioMixing | Pauses the playback of a music file. |
| resumeAudioMixing | Resumes the playback of a music file. |
| selectAudioTrack | Specifies the audio track to play in the current music file. |
| selectMultiAudioTrack | Selects the audio tracks for local playback and remote transmission. |
| setAudioMixingDualMonoMode | Sets the channel mode of the current audio file. |
| setAudioMixingPitch | Adjusts the pitch of the music file played locally. |
| setAudioMixingPlaybackSpeed | Sets the playback speed of the current music file. |
| setAudioMixingPosition | Sets the playback position of the music file. |
| startAudioMixing | Starts playing a music file. |
| stopAudioMixing | Stops playing the music file. |
| onAudioMixingPositionChanged | Reports the playback progress of the music file. |
| onAudioMixingStateChanged | Occurs when the playback state of the music file changes. |
Audio Effect Files
| API | Description |
|---|---|
| getEffectCurrentPosition | Gets the playback progress of the specified sound effect file. |
| getEffectDuration | Gets the total duration of the specified sound effect file. |
| getEffectsVolume | Gets the playback volume of the sound effect file. |
| getVolumeOfEffect | Gets the playback volume of the specified audio effect file. |
| pauseAllEffects | Pauses playback of all audio effect files. |
| pauseEffect | Pauses playback of the specified audio effect file. |
| playAllEffects | Plays all audio effect files. |
| playEffect | Plays the specified local or online audio effect file. |
| playEffectEx | Plays the specified sound effect in the channel. |
| preloadEffect | Loads the audio effect file into memory. |
| preloadEffectEx | Preloads the specified sound effect into the channel. |
| resumeAllEffects | Resumes playback of all audio effect files. |
| resumeEffect | Resumes playing the specified audio effect file. |
| setEffectPosition | Sets the playback position of the specified audio effect file. |
| setEffectsVolume | Sets the playback volume of audio effect files. |
| setVolumeOfEffect | Sets the playback volume of the specified audio effect file. |
| stopAllEffects | Stops playing all audio effect files. |
| stopEffect | Stops playing the specified audio effect file. |
| unloadAllEffects | Releases all preloaded audio effect files from memory. |
| unloadEffect | Releases a preloaded audio effect file from memory. |
| onAudioEffectFinished | Callback when the local audio effect file finishes playing. |
Rhythm Player
| API | Description |
|---|---|
| stopRhythmPlayer | Stops the virtual metronome. |
Media Player Initialization
| API | Description |
|---|---|
| addListener | Adds an IMediaPlayerEvent listener. |
| createMediaPlayer | Creates a media player instance. |
| destroyMediaPlayer | Destroys the media player. |
| getMediaPlayerCacheManager | Gets the IMediaPlayerCacheManager instance. |
| removeAllListeners | Removes all listeners for the specified event. |
| removeListener | Removes the specified IMediaPlayerEvent listener. |
Media Resource Open
| API | Description |
|---|---|
| open | Opens a media resource. |
| openWithMediaSource | Opens a media resource and configures playback settings. |
| preloadSrc | Preloads a media resource. |
| switchSrc | Switches the media resource. |
| unloadSrc | Releases preloaded media resources. |
Media Resource Playback and Rendering
| API | Description |
|---|---|
| selectAudioTrack | Specifies the audio track to play for the current audio file. |
| setAudioDualMonoMode | Sets the channel mode for the current audio file. |
| setAudioPitch | Adjusts the pitch of the currently playing media resource. |
| setLoopCount | Sets loop playback. |
| setPlaybackSpeed | Sets the playback speed of the current audio file. |
| setPlayerOptionInInt | Sets media player options. |
| setPlayerOptionInString | Sets media player options. |
| setView | Sets the rendering view for the player. |
Media Player Control
| API | Description |
|---|---|
| adjustPlayoutVolume | Adjusts the local playback volume. |
| adjustPublishSignalVolume | Adjusts the volume heard by remote users. |
| mute | Sets whether to mute. |
| pause | Pauses playback. |
| play | Plays the media file. |
| playPreloadedSrc | Plays a preloaded media resource. |
| resume | Resumes playback after pause. |
| seek | Seeks to the specified playback position in the media file. |
| stop | Stops playback. |
Media Player Information
| API | Description |
|---|---|
| getAudioBufferDelay | Gets the audio buffer delay when playing media files. |
| getDuration | Gets the total duration of the media file. |
| getMediaPlayerId | Gets the media player ID. |
| getMute | Checks whether the currently playing media file is muted. |
| getPlayoutVolume | Gets the current local playback volume. |
| getPlayPosition | Gets the current playback position. |
| getPlaySrc | Gets the path of the media resource being played. |
| getPublishSignalVolume | Gets the volume heard by remote users. |
| getState | Gets the current state of the media player. |
| getStreamCount | Gets the number of media streams in the current media file. |
| getStreamInfo | Retrieves media stream information by stream index. |
| onPlayerPlaybackStats | Reports information about the currently playing media resource. |
Media Player Observer
| API | Description |
|---|---|
| registerAudioFrameObserver | Registers an audio frame observer. |
| registerPlayerSourceObserver | Registers a player source observer. |
| registerVideoFrameObserver | Registers a video frame observer. |
| unregisterAudioFrameObserver | Unregisters the audio frame observer. |
| unregisterPlayerSourceObserver | Unregisters the player source observer. |
| unregisterVideoFrameObserver | Unregisters the video frame observer. |
| onAudioVolumeIndication | Audio volume indication callback for the media player. |
| onFrame | Callback when an audio frame is received. |
| onMetaData | Reports received media metadata. |
| onPlayBufferUpdated | Reports the playable duration of the current buffered data. |
| onPlayerEvent | Reports player events. |
| onPlayerInfoUpdated | Callback when media player information changes. |
| onPlayerSourceStateChanged | Reports player state changes. |
| onPlayerSrcInfoChanged | Callback when video bitrate of media resource changes. |
| onPositionChanged | Reports the playback progress of the current media resource. |
| onPreloadEvent | Reports events during media resource preloading. |
Media Player Cache
| API | Description |
|---|---|
| enableAutoRemoveCache | Sets whether to enable automatic removal of cache files. |
| getCacheDir | Gets the storage path of the cache file. |
| getCacheFileCount | Gets the total number of currently cached media files. |
| getMaxCacheFileCount | Gets the upper limit of the number of cache files set. |
| getMaxCacheFileSize | Gets the upper limit of the total cache size of cache files set. |
| removeAllCaches | Deletes all cached media files in the media player. |
| removeCacheByUri | Deletes the specified cached media file. |
| removeOldCache | Deletes the least recently used cached media file in the media player. |
| setCacheDir | Sets the storage path for media files to be cached. |
| setMaxCacheFileCount | Sets the upper limit on the number of cached media files. |
| setMaxCacheFileSize | Sets the upper limit of the total cache size for cached media files. |
| onPlayerCacheStats | Reports information about the currently cached media resources. |
Cross-Channel Media Relay
| API | Description |
|---|---|
| pauseAllChannelMediaRelay | Pauses media stream forwarding to all destination channels. |
| pauseAllChannelMediaRelayEx | Pauses media stream forwarding to all destination channels. |
| resumeAllChannelMediaRelay | Resumes media stream forwarding to all destination channels. |
| resumeAllChannelMediaRelayEx | Resumes media stream forwarding to all destination channels. |
| startOrUpdateChannelMediaRelay | Starts or updates cross-channel media stream forwarding. |
| startOrUpdateChannelMediaRelayEx | Starts or updates the media stream relay across channels. |
| stopChannelMediaRelay | Stops the media stream relay across channels. Once stopped, the host leaves all destination channels. |
| stopChannelMediaRelayEx | Stops the media stream relay across channels. Once stopped, the host leaves all destination channels. |
| onChannelMediaRelayStateChanged | Occurs when the state of media stream relay across channels changes. |
Media Push
| API | Description |
|---|---|
| startRtmpStreamWithoutTranscoding | Starts RTMP streaming without transcoding. |
| startRtmpStreamWithoutTranscodingEx | Starts RTMP streaming without transcoding. |
| startRtmpStreamWithTranscoding | Starts pushing media streams to a CDN and sets the transcoding configuration. |
| startRtmpStreamWithTranscodingEx | Starts pushing media streams to a CDN and sets the transcoding configuration. |
| stopRtmpStream | Stops CDN streaming. |
| stopRtmpStreamEx | Stops CDN streaming. |
| updateRtmpTranscoding | Updates the transcoding configuration for CDN streaming. |
| updateRtmpTranscodingEx | Updates the transcoding configuration for CDN streaming. |
| onRtmpStreamingEvent | Callback for CDN streaming events. |
| onRtmpStreamingStateChanged | Callback when the RTMP streaming state changes. |
| onTranscodingUpdated | Callback when the RTMP transcoding settings are updated. |
CDN Streaming
| API | Description |
|---|---|
| onDirectCdnStreamingStateChanged | Callback when the CDN streaming state changes. |
| onDirectCdnStreamingStats | Callback for CDN streaming statistics. |
Data Stream
| API | Description |
|---|---|
| createDataStream | Creates a data stream. |
| createDataStreamEx | Creates a data stream. |
| sendStreamMessage | Sends a data stream. |
| sendStreamMessageEx | Sends a data stream. |
| onStreamMessage | Callback when receiving a data stream message from a remote user. |
| onStreamMessageError | Callback when an error occurs while receiving a data stream message from a remote user. |
Metadata (SEI)
| API | Description |
|---|---|
| registerMediaMetadataObserver | Registers a media metadata observer to receive or send metadata. |
| sendMetaData | Sends media metadata. |
| setMaxMetadataSize | Sets the maximum size of media metadata. |
| unregisterMediaMetadataObserver | Unregisters the media metadata observer. |
| onMetadataReceived | The receiver has received metadata. |
Audio Route
| API | Description |
|---|---|
| isSpeakerphoneEnabled | Checks whether the speakerphone is enabled. |
| setDefaultAudioRouteToSpeakerphone | Sets the default audio route. |
| setEnableSpeakerphone | Enables or disables speakerphone playback. |
| setRouteInCommunicationMode | Selects the audio route in communication volume mode. |
| onAudioRoutingChanged | Callback when the audio route changes. |
Video Device Management
| API | Description |
|---|---|
| enableMultiCamera | Enables or disables multi-camera capture. |
| getCameraMaxZoomFactor | Gets the maximum zoom factor supported by the camera. |
| getVideoDeviceManager | Gets the IVideoDeviceManager object to manage video devices. |
| isCameraAutoExposureFaceModeSupported | Checks whether the device supports auto exposure. |
| isCameraAutoFocusFaceModeSupported | Checks whether the device supports face auto-focus. |
| isCameraExposurePositionSupported | Checks whether the device supports manual exposure. |
| isCameraExposureSupported | Checks whether the current camera supports exposure adjustment. |
| isCameraFaceDetectSupported | Checks whether the device camera supports face detection. |
| isCameraFocusSupported | Checks whether the device supports manual focus. |
| isCameraTorchSupported | Checks whether the device supports keeping the flashlight on. |
| isCameraZoomSupported | Checks whether the device supports camera zoom. |
| queryCameraFocalLengthCapability | Queries the focal length capabilities supported by the camera. |
| queryCodecCapability | Queries the video codec capabilities supported by the SDK. |
| setCameraAutoExposureFaceModeEnabled | Enables or disables auto exposure. |
| setCameraAutoFocusFaceModeEnabled | Enables or disables face auto focus. |
| setCameraCapturerConfiguration | Sets the camera capture configuration. |
| setCameraDeviceOrientation | Sets the rotation angle of the captured video. |
| setCameraExposureFactor | Sets the exposure factor of the current camera. |
| setCameraExposurePosition | Sets the manual exposure position. |
| setCameraFocusPositionInPreview | Sets the manual focus position and triggers focusing. |
| setCameraTorchOn | Sets whether to turn on the flashlight. |
| setCameraZoomFactor | Sets the zoom factor of the camera. |
| switchCamera | Switches between front and rear cameras. |
| onCameraExposureAreaChanged | Callback when the camera exposure area changes. |
| onCameraFocusAreaChanged | Callback when the camera focus area changes. |
Audio Device Management
| API | Description |
|---|---|
| getAudioDeviceInfo | Gets the audio device information. |
| getAudioDeviceManager | Gets the IAudioDeviceManager object to manage audio devices. |
| startPlaybackDeviceTest | Starts the audio playback device test. |
| stopPlaybackDeviceTest | Stops the audio playback device test. |
Extensions
| API | Description |
|---|---|
| enableExtension | Enables/disables an extension. |
| getExtensionProperty | Gets detailed information about the plugin. |
| loadExtensionProvider | Loads a plugin. |
| registerExtension | Registers an extension. |
| setExtensionProperty | Sets a plugin property. |
| setExtensionProviderProperty | Sets a property for the plugin provider. |
| onExtensionErrorWithContext | Plugin error callback. |
| onExtensionEventWithContext | Plugin event callback. |
| onExtensionStartedWithContext | Callback when the extension is successfully enabled. |
| onExtensionStoppedWithContext | Callback when the extension is disabled. |
Network and Others
| API | Description |
|---|---|
| complain | Report call quality issues. |
| enableEncryption | Enable or disable built-in encryption. |
| enableEncryptionEx | Enable or disable built-in encryption. |
| getCallId | Get the call ID. |
| getCallIdEx | Get the call ID using the connection ID. |
| getConnectionState | Gets the current network connection state. |
| getConnectionStateEx | Gets the current network connection state. |
| getCurrentMonotonicTimeInMs | Gets the current Monotonic Time from the SDK. |
| getErrorDescription | Gets the warning or error description. |
| getNativeHandle | Gets the C++ handle of the Native SDK. |
| getNetworkType | Gets the local network connection type. |
| getNtpWallTimeInMs | Gets the current NTP (Network Time Protocol) time. |
| getVersion | Gets the SDK version. |
| isFeatureAvailableOnDevice | Checks whether the device supports the specified advanced feature. |
| queryDeviceScore | Queries the device score level. |
| rate | Rates a call. |
| sendCustomReportMessage | Sends a custom report message. |
| sendCustomReportMessageEx | Custom data reporting and analytics service. |
| setCloudProxy | Sets the cloud proxy service. |
| setParameters | The SDK's JSON configuration, used for technical preview or customized features. |
| setRemoteSubscribeFallbackOption | Sets the fallback option for subscribed audio and video streams under poor network conditions. |
| startEchoTest | Starts an audio and video call loopback test. |
| startLastmileProbeTest | Starts a last-mile network probe test before a call. |
| stopEchoTest | Stops the audio call loopback test. |
| stopLastmileProbeTest | Stops the last mile network probe test before a call. |
| onConnectionLost | Callback when the network connection is lost and the SDK cannot reconnect to the server within 10 seconds. |
| onConnectionStateChanged | Callback when the network connection state changes. |
| onEncryptionError | Callback when an error occurs with built-in encryption. |
| onLastmileProbeResult | Callback for the last mile uplink and downlink quality probe result before a call. |
| onLastmileQuality | Callback for the last mile network quality report. |
| onMultipathStats | Callback for multipath transmission statistics. |
| onNetworkQuality | Callback for the last mile uplink and downlink network quality report of each user during a call. |
| onNetworkTypeChanged | Callback when the local network type changes. |
| onPermissionError | Callback when failing to obtain device permissions. |
| onPermissionGranted | Callback when permission is granted. |
| onProxyConnected | Callback for proxy connection status. |
| onRemoteSubscribeFallbackToAudioOnly | Callback when the subscribed stream falls back to audio-only or recovers to audio and video. |
| onUplinkNetworkInfoUpdated | Callback when uplink network information changes. |