AliRtcEngine API
AliRtcEngine provides the core APIs of the Real-Time Communication Mac SDK for audio and video calls.
Contents
Basic APIs
|
API |
Description |
|
Gets an AliRtcEngine instance. |
|
|
Destroys the engine. |
|
|
Destroys the engine with a callback. |
|
|
Sets the H5 compatibility mode. |
|
|
Checks whether the H5 compatibility mode is enabled. |
|
|
Gets the SDK version number. |
Channel APIs
|
API |
Description |
|
Sets the channel mode. |
|
|
Sets the audio profile. |
|
|
Checks if the channel is in audio-only mode. |
|
|
Sets the channel to audio-only or audio/video mode. |
|
|
Joins a channel. |
|
|
Joins a channel. |
|
|
Joins a channel. |
|
|
Joins a channel. |
|
|
Leaves the channel. |
|
|
Checks if the user is in a channel. |
|
|
Sets the user role. |
|
|
Gets the user role. |
|
|
Refreshes the authentication information. |
|
|
Refreshes the authentication information using a token. |
Publish and subscribe APIs
|
API |
Description |
|
Sets whether to publish the local audio stream, which is published by default. |
|
|
Checks whether the local audio stream is published. |
|
|
Sets whether to subscribe to all remote audio streams by default. Call this method before joining a channel. |
|
|
Stops or resumes subscribing to all remote audio streams. |
|
|
Stops or resumes subscribing to the audio stream of a specified remote user. |
|
|
Sets whether to publish the local video stream. |
|
|
Checks whether the local video stream is published. |
|
|
Sets whether to subscribe to all remote video streams by default. Call this method before joining a channel. |
|
|
Stops or resumes subscribing to all remote video streams. |
|
|
Stops or resumes subscribing to the media stream of a specified remote user. Use this interface to control both the audio and video streams. |
|
|
Stops or resumes subscribing to the audio and video stream of a specified remote user. |
|
|
Stops or resumes subscribing to the cross-channel media stream of a specified remote user. |
|
|
Subscribes to the streams of all users in the destination channel. |
|
|
Stops or resumes subscribing to the video stream of a specified remote user. |
|
|
Sets the playback volume of a remote audio stream. |
Audio device management APIs
|
API |
Description |
|
Stops or resumes publishing local audio. |
|
|
Stops or resumes playing the remote audio stream. |
|
|
Stops or resumes audio playback for all remote users. |
|
|
Starts audio capture. |
|
|
Starts audio capture. |
|
|
Stops audio capture. |
|
|
Enables audio volume indication. |
|
|
Enables ear back. |
|
|
Starts audio playback. |
|
|
Stops audio playback. |
|
|
Sets the playout volume. |
|
|
Sets the recording volume. |
|
|
Starts an audio playback device test. |
|
|
Stops the audio playback device test. |
|
|
Starts an audio capture device test. |
|
|
Stops the audio capture device test. |
Voice changer and reverb
|
API |
Description |
|
Sets the voice changer mode. |
|
|
Sets the pitch parameter. |
|
|
Sets the reverb mode. |
|
|
Sets the reverb effect type and its parameters. |
Custom audio input
|
API |
Description |
|
Adds an external audio stream. |
|
|
Pushes data to the external audio stream. |
|
|
Sets the publish volume. |
|
|
Gets the publish volume. |
|
|
Sets the playout volume. |
|
|
Gets the playout volume. |
|
|
Removes an external audio stream. |
Audio accompaniment
|
API |
Description |
|
Gets information about the audio accompaniment file. |
|
|
Starts accompaniment playback. |
|
|
Stops accompaniment playback. |
|
|
Sets the accompaniment volume. |
|
|
Sets the publish volume for the audio accompaniment. |
|
|
Gets the publish volume for the audio accompaniment. |
|
|
Sets the playout volume for the audio accompaniment. |
|
|
Gets the playout volume for the audio accompaniment. |
|
|
Pauses accompaniment playback. |
|
|
Resumes accompaniment playback. |
|
|
Gets the duration of the accompaniment file. |
|
|
Gets the current position of the accompaniment playback. |
|
|
Sets the accompaniment playback position. |
Audio effect file
|
API |
Description |
|
Preloads an audio effect file. |
|
|
Unloads a preloaded audio effect file. |
|
|
Plays a specified audio effect. |
|
|
Stops a specified audio effect. |
|
|
Stops all audio effects. |
|
|
Pauses a specified audio effect. |
|
|
Pauses all audio effects. |
|
|
Resumes a specified audio effect. |
|
|
Resumes all audio effects. |
|
|
Sets the publish volume for a specified audio effect. |
|
|
Gets the publish volume of a specified audio effect. |
|
|
Sets the publish volume for all audio effects. |
|
|
Sets the playout volume for a specified audio effect. |
|
|
Gets the playout volume of a specified audio effect. |
|
|
Sets the playout volume for all audio effects. |
Recording audio and video files
|
API |
Description |
|
Records audio and video files (AAC, WAV, and MP4). |
|
|
Stops recording audio and video files. |
Video device management interfaces
|
API |
Description |
|
Sets the rendering window and rendering parameters for the local preview. |
|
|
Sets camera capture preferences. |
|
|
Enables or disables local video capture. |
|
|
Mutes or unmutes the local video stream. |
|
|
Sets the rendering window and rendering parameters for a remote video stream. |
|
|
Checks whether the camera is on. |
|
|
Sets the video encoding properties. |
|
|
Sets the video decoding properties. |
|
|
Starts the local preview. |
|
|
Stops the local preview. |
|
|
Sets the mirroring mode for the local preview and published stream. |
|
|
Sets whether to scale video data immediately after capture or during encoding. |
Configure video data callbacks
|
API |
Description |
|
Registers a video data callback. |
|
|
Unregisters a video data callback. |
|
|
Takes a snapshot of the camera feed. |
|
|
Registers a video data output callback. |
|
|
Unregisters a video data output callback. |
Audio data callbacks
|
API |
Description |
|
Enables the audio frame observer. |
|
|
Registers an audio data callback. |
Custom video input
|
API |
Description |
|
Enables an external video input source. |
|
|
Pushes video data. |
Screen sharing API
|
API |
Description |
|
Starts screen share publishing. |
|
|
Starts screen share publishing. |
|
|
Stops screen share publishing. |
|
|
Sets the volume of the shared audio stream. |
|
|
Checks if the screen share is being published. |
|
|
Configures the encoder for screen sharing. |
CDN streaming APIs
|
API |
Description |
|
Starts CDN streaming. |
|
|
Updates CDN streaming parameters. |
|
|
Stops CDN streaming. |
|
|
Gets the CDN streaming status. |
Last-mile network probe APIs
|
API |
Description |
|
Starts the last-mile network probe. |
|
|
Stops the last-mile network probe. |
SEI
|
API |
Description |
|
Sends an SEI stream. |
|
|
Sends an extended SEI stream. |
Other APIs
|
API |
Description |
|
Sets a custom parameter. |
|
|
Gets a custom parameter. |
|
|
Sets the directory path for SDK log files. |
|
|
Sets the log level. |
|
|
Sets the device orientation mode. |
|
|
Gets the network timestamp. |
|
|
Sends a data channel message. |
Callback events
|
API |
Description |
|
Reports a change in the network connection state. |
|
|
Reports an exception with a local device. |
|
|
Occurs 30 seconds before the authentication token expires. Your application must handle this callback to refresh the token. |
|
|
Occurs when an API call that requires authentication fails because the token has expired. |
|
|
Reports the result of joining a channel. |
|
|
Reports the result of joining a channel. |
|
|
Reports the result of leaving a channel. |
|
|
Occurs when a remote user leaves the channel. |
|
|
Occurs when a remote user joins the channel. |
|
|
Occurs when a remote user publishes or unpublishes a media track. |
|
|
Occurs when the local user is removed from the channel by the server or the session ends. |
|
|
Reports a change in the audio publishing state. |
|
|
Reports a change in the audio subscribing state. |
|
|
Occurs when a remote user mutes or unmutes their audio. |
|
|
Occurs when an audio device interruption starts. |
|
|
Occurs when an audio device interruption ends. |
|
|
Reports a change in the video publishing state. |
|
|
Reports a change in the video stream subscribing state. |
|
|
Occurs when a remote user mutes their video by sending black frames. |
|
|
Occurs when a remote user enables or disables their video stream. |
|
|
Occurs when a remote user's application moves to the background. |
|
|
Occurs when a remote user's application returns to the foreground. |
|
|
Occurs when the playback of a local audio effect finishes. |
|
|
Reports the user ID, volume, and voice activity status of subscribed audio streams. |
|
|
Reports the active speaker in the channel based on active speaker detection. |
|
|
Reports a change in the CDN live streaming state. |
|
|
Reports a change in the state of a CDN live streaming task. |
|
|
Reports a change in network quality. |
|
|
Reports the result of the last-mile network quality probe. |
|
|
Reports the result of the last-mile network bandwidth probe. |
|
|
Reports an error that occurs during engine runtime. |
|
|
Occurs when the first local audio packet is sent. |
|
|
Occurs when the first video frame from a remote user is received. |
|
|
Occurs when the first local video packet is sent. |
|
|
Occurs when the first audio packet from a remote user is received. |
|
|
Occurs when the first frame of a remote audio stream is decoded. |
|
|
Occurs when the first frame of a remote video stream is rendered. |
|
|
Occurs when the first frame of the local video preview is rendered. |
|
|
Reports the volume during a pre-call audio capture test. |
|
|
Reports a change in the local audio mixing state. |
|
|
Occurs when a remote user starts audio mixing. |
|
|
Occurs when a remote user finishes audio mixing. |
|
|
Reports runtime statistics of the session. Triggered every 2 seconds. |
|
|
Reports statistics of the local video stream. Triggered every 2 seconds. |
|
|
Reports statistics of remote video streams. Triggered every 2 seconds. |
|
|
Reports statistics of the local audio stream. Triggered every 2 seconds. |
|
|
Reports statistics of remote audio streams. Triggered every 2 seconds. |
|
|
Occurs when a supplemental enhancement information (SEI) message is received. |
|
|
Reports the result of a snapshot request. |
|
|
Reports a change in the state of the local audio capture device. |
|
|
Reports a change in the state of the local video capture device. |
|
|
Occurs when the data channel to a remote user is ready to send messages. |
|
|
Occurs when a message is received on the data channel. |
|
|
Reports a change in the screen sharing publishing state. |
AliRtcAudioFrameDelegate
|
API |
Description |
|
Provides captured raw audio data. |
|
|
Provides audio data after 3A processing. |
|
|
Provides the audio data for publishing. |
|
|
Provides audio data for playback. |
|
|
Provides audio data received from a remote user. |
AliRtcEngineDestroyDelegate
|
API |
Description |
|
Occurs when the engine has finished de-initializing. All resources are released after this callback. |
AliRtcVideoFrameDelegate
|
API |
Description |
|
Provides captured video frames. |
|
|
Provides local video frames before they are encoded. |
|
|
Provides video frames received from a remote user. |
|
|
Lets you specify the preferred format for video data output. |
|
|
Lets you specify the desired position in the video pipeline for observing video frames. |
API
HTML