iOS

更新时间:
复制 MD 格式

The Real-Time Communication (RTC) software development kit (SDK) lets you monitor network quality. When network conditions change, a callback provides network quality data. You can use this data to adjust audio and video settings to ensure a basic communication experience. This topic describes how to retrieve network quality data and set audio and video specifications.

Feature overview

The quality of RTC calls can be affected when the network condition is poor. To improve the quality of your calls, we recommend that you perform the following operations on the publishing or subscription end when you detect poor network conditions.

  • Switch to a lower-quality video stream. Lower-quality streams have the same aspect ratio as higher-quality streams but have a lower resolution and bitrate. This reduces the demand on network resources.

  • Publish only the audio stream. In extreme network conditions, sending only the audio stream ensures that communication continues.

The onNetworkQualityChanged callback notifies you when network quality changes. You can use this callback to retrieve the latest network quality data and apply your optimization policy.

Implementation methods

The following table lists common methods for setting audio and video stream specifications. For more information, see DingRtcEngine Interface.

Interface

Description

setVideoEncoderConfiguration

Sets the video encoding properties for the camera stream. Republish the stream for the changes to take effect.

subscribeRemoteVideoStream

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

publishLocalVideoStream

Specifies whether to push the local video stream.