startNetworkDetection method

FutureOr<int> startNetworkDetection(
  1. boolean isTestUplink,
  2. int expectedUplinkBitrate,
  3. boolean isTestDownlink,
  4. int expectedDownlinkBitrate,
)

@detail api @author hanchenchen.c @brief 开启通话前网络探测 @param isTestUplink 是否探测上行带宽 @param expectedUplinkBitrate 期望上行带宽,单位:kbps
范围为 {0, [100-10000]},其中, 0 表示由 SDK 指定最高码率。 @param isTestDownlink 是否探测下行带宽 @param expectedDownlinkBitrate 期望下行带宽,单位:kbps
范围为 {0, [100-10000]},其中, 0 表示由 SDK 指定最高码率。 @return - 0: 调用成功。 - < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明 @note - 成功调用本接口后,会在 3s 内收到一次 onNetworkDetectionResult{@link #IRTCEngineEventHandler#onNetworkDetectionResult} 回调,此后每 2s 收到一次该回调,通知探测结果; - 若探测停止,则会收到一次 onNetworkDetectionStopped{@link #IRTCEngineEventHandler#onNetworkDetectionStopped} 通知探测停止。

Implementation

FutureOr<int> startNetworkDetection(
    boolean isTestUplink,
    int expectedUplinkBitrate,
    boolean isTestDownlink,
    int expectedDownlinkBitrate) async {
  return await nativeCall('startNetworkDetection', [
    isTestUplink,
    expectedUplinkBitrate,
    isTestDownlink,
    expectedDownlinkBitrate
  ]);
}