rtcEngine$onNetworkDetectionStopped method

FutureOr<void> rtcEngine$onNetworkDetectionStopped(
  1. dynamic engine,
  2. dynamic errorCode
)
override

@detail callback @author hanchenchen.c @brief Pre-call network probing ends
The following will stop detection and receive this primary callback:
1. This callback is received once when the stopNetworkDetection{@link #ByteRTCEngine#stopNetworkDetection} interface is called to stop probing;
2. Stop detection when the first frame of remote/local audio is received;
3. Stop detecting when the detection exceeds 3 minutes;
4. When the probe link is disconnected for a certain period of time, the probe is stopped. @param engine ByteRTCEngine object @param errorCode
See ByteRTCNetworkDetectionStopReason{@link #ByteRTCNetworkDetectionStopReason} for reasons of stopping probing.

Implementation

FutureOr<void> rtcEngine$onNetworkDetectionStopped(
    dynamic engine, dynamic errorCode) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler)
      .onNetworkDetectionStopped
      ?.call(t_NetworkDetectionStopReason.ios_to_code($p_i
          .ByteRTCNetworkDetectionStopReason.values
          .firstWhere((t) => t.$value == errorCode || t.name == errorCode)));
}