Android

Updated at:

The Real-Time Communication (RTC) SDK provides a feature to monitor network quality. When network conditions change, you can retrieve the network quality from a callback and adjust audio and video specifications accordingly. This ensures a basic communication experience. This topic describes how to retrieve network quality and set audio and video specifications.

Feature overview

Poor network quality degrades the audio and video communication experience. When you detect a weak network, you can apply the following optimizations on both the publishing and subscribing clients to ensure a basic communication experience:

  • Adjust video stream specifications: Set a lower VideoProfile to reduce the network resources consumed by video communication.

  • Switch to the small stream: The small stream has the same aspect ratio as the large stream but a lower resolution and bitrate. This reduces the demand for network resources.

  • Publish only the audio stream: In extremely poor network conditions, send only the audio stream to maintain communication.

The onNetworkQualityChanged callback is triggered when network quality changes. You can use this callback to retrieve the current network quality and apply your optimization policy.

Implementation

The following table lists common methods to set audio and video stream specifications. For more information, see DingRtcEngine methods.

API

Description

setVideoEncoderConfiguration

Sets the video encoding properties for the camera stream.

subscribeRemoteVideoStream

Stops or resumes subscribing to a remote user's video stream.

publishLocalVideoStream

Whether to push the local video stream.