FAQ about ARTC

Updated at:
Copy as MD

Answers to frequently asked questions about ApsaraVideo Real-time Communication (ARTC).

What are the differences between joining a channel with a single parameter versus multiple parameters?

  • Functionally, there is no difference. The single-parameter method is a Base64-encoded JSON string that contains all the values required by the multi-parameter method.

  • The single-parameter method lets your app server generate and deliver all authentication parameters in a single payload, preventing parameter inconsistencies between the client and server.

  • We recommend the single-parameter method for new integrations.

Why is the OnJoinChannelResult callback not triggered after joining a channel?

  • If joinchannel returns a non-zero value, the operation failed due to invalid parameters.

  • Check the network connection. If joinchannel does not report an error, the SDK retries connecting to the server when a network issue occurs. Listen for the onConnectionStatusChange callback to monitor the SDK's connection status in real time. You can also stop the SDK and try again.

  • Check the authentication token. If the token is invalid, the OnJoinChannelResult callback reports an error.

Why can't I use DingRTC SDK to join a channel?

ARTC is built on the Global Realtime Transport Network (GRTN), whereas DingRTC is a separate, incompatible system. To use ARTC, create an ARTC application in the ApsaraVideo Live console and integrate the ARTC SDK from the links in the official ApsaraVideo Live documentation.

How do I select a channel profile?

The interactive mode (InteractiveLive) supports a "viewer" role, while the communication mode (Communication) does not. If you are unsure whether you need interactive features, use InteractiveLive for maximum flexibility.

What are the differences between the View provided by ARTC SDK and the system view?

The AliRenderView for iOS and the SurfaceView and TextureView for Android provided by the ARTC SDK are encapsulated UI components based on the system view. Beyond basic rendering, they support View lifecycle monitoring and custom functionality. We recommend using the ARTC SDK views.

Why do I receive an error when calling APIs such as LeaveChannel?

An API call error indicates either invalid parameters or incorrect timing. For LeaveChannel, which takes no parameters, an error means incorrect timing (for example, calling it before joining a channel or calling it multiple times). However, this error is safe to ignore because ARTC uses a stateful API design. You only need to set a desired state; callbacks confirm the actual state. For example, no matter when you call LeaveChannel during the SDK's lifecycle, the SDK ensures its internal state becomes 'left channel'.

Clients must handle unrecoverable errors from the SDK. For details, see Initialize the ARTC engine and register callbacks.

How do I detect the current network status?

Network status reflects the connection between the SDK and the backend service. Listen for the onConnectionStatusChange callback to monitor the connection status in real time. For more information, see Channel connection status management.

Does muting audio affect billing?

  1. You are billed as long as you are in a channel.

  2. Subscribed streams are billed regardless of whether audio is muted.

  3. For more information, see Billing for audio/video communication.

Which ports and domain names should I whitelist if I have a firewall?

Ports

Protocol

Port

TCP

80 443

UDP

8443 1106

Domain names

gw.rtn.aliyuncs.com

rsdk-rtcsub.data.alivecdn.com

r5-rtcpub.media-sh.alivecdn.com

r5-rtcsub.media-sh.alivecdn.com

rs.rtn.aliyuncs.com

How do other platforms communicate with the web platform?

For other platforms such as Android, iOS, Linux, or Windows to communicate with the web platform, the ingested audio stream must use a 48 kHz sample rate. Use one of the following methods:

  1. When you call the setAudioProfile method, select a mode with a 48 kHz sample rate. For available modes, see Common audio operations.

  2. Enable H5 compatibility mode to override the audio sample rate configured by setAudioProfile. This mode pushes mono audio at 48 kHz. On Android and iOS, call the setH5CompatibleMode method before creating the engine. On Linux, select h5mode when you create the engine.