startNetworkDetection method
@detail api
@author hanchenchen.c
@brief Pre-call network detection
@param isTestUplink Whether to detect uplink bandwidth
@param expectedUplinkBitrate Expected uplink bandwidth, unit: kbps
Range: {0, 100-10000}, 0: Auto, that RTC will set the highest bite rate.
@param isTestDownlink Whether to detect downlink bandwidth
@param expectedDownlinkBitrate Expected downlink bandwidth, unit: kbps
Range: {0, 100-10000}, 0: Auto, that RTC will set the highest bite rate.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- After calling this interface, you will receive rtcEngine:onNetworkDetectionResult:quality:rtt:lostRate:bitrate:jitter:{@link #ByteRTCEngineDelegate#rtcEngine:onNetworkDetectionResult:quality:rtt:lostRate:bitrate:jitter} within 3s and every 2s thereafter notifying the probe result;
- If the probe stops, you will receive rtcEngine:onNetworkDetectionStopped:{@link #ByteRTCEngineDelegate#rtcEngine:onNetworkDetectionStopped} Notify probe to stop.
Implementation
FutureOr<int> startNetworkDetection(
bool isTestUplink,
int expectedUplinkBitrate,
bool isTestDownlink,
int expectedDownlinkBitrate) async {
return await nativeCall(
'startNetworkDetection:uplinkBandwidth:downlink:downlinkBandwidth:', [
isTestUplink,
expectedUplinkBitrate,
isTestDownlink,
expectedDownlinkBitrate
]);
}