startNetworkDetection method
@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
Future<int?> startNetworkDetection(
{required bool isTestUplink,
required int expectedUplinkBitrate,
required bool isTestDownlink,
required int expectedDownlinkBitrate}) async {
$a() => ($instance as $p_a.RTCEngine).startNetworkDetection(isTestUplink,
expectedUplinkBitrate, isTestDownlink, expectedDownlinkBitrate);
$i() => ($instance as $p_i.ByteRTCEngine).startNetworkDetection(
isTestUplink,
expectedUplinkBitrate,
isTestDownlink,
expectedDownlinkBitrate);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}