CloudHub Docs
Download Documents


Network and device detection before the call

Function description

In scenarios with high quality requirements, pre-call detection can help identify and troubleshoot problems in advance to ensure real-time communication experience. Before the callTesting can usually be carried out from the following two perspectives:

CloudHub SDK provides a complete network detection and device detection interface to help you achieve the above functions and ensure the user experience.This article describes how to use related APIs to implement the above functions.

Network quality detection

CloudHub SDK provides the startLastmileProbeTest method, which supports users to perform network quality detection before joining the channel.Then, through callbacks, the current network quality related data, including round-trip delay, uplink and downlink packet loss rate, uplink and downlink network bandwidth, etc. are returned toapp.


Before starting, please make sure that you have implemented basic audio and video communication or live broadcast functions in your project.

  1. Before the user joins the channel or goes to the microphone, call startLastmileProbeTest to perform network quality detection. When calling this method,You need to specify the desired maximum uplink and downlink bit rate.
  2. After enabling this method, the SDK will return the following two callbacks in turn:
  1. After obtaining the network quality data, call stopLastmileProbeTest to stop the network quality detection before the call.

API reference



Equipment quality inspection

The CloudHub SDK supports a startEchoTest method to enable users to start a call test before joining a channel. The purpose of the testIt is to test whether the audio equipment (headset, speaker, etc.) and network connection of the system are normal.


Before you start, make sure you have understood how to implement audio and video calls or implement interactive live broadcasts

  1. Before joining the channel, call the startEchoTest method. When calling this method, you need to set aThe intervalInSeconds parameter indicates the interval time for obtaining the test results. The unit of this parameter is seconds, and the value range is[2,10], the default value is 10

  2. After successfully calling the startEchoTest method, guide the user to say a paragraph first, if the sound is played back after the set time intervalCome, and the user can hear what he just said, it means that the system audio equipment and network connection are normal

  3. After obtaining the audio device test results, call the stopEchoTest method to stop the voice call detection, and then you can call joinChannel join a channel

API reference



Development considerations