onAudioRecordingStateUpdate method

FutureOr<void> onAudioRecordingStateUpdate(
  1. dynamic state,
  2. dynamic errorCode
)
override

@detail callback @author huangshouqin @brief When calling startAudioRecording{@link #RTCEngine#startAudioRecording} or stopAudioRecording{@link #RTCEngine#stopAudioRecording} to change the recording status, receive the callback. @param state See AudioRecordingState{@link #AudioRecordingState}. @param errorCode See AudioRecordingErrorCode{@link #AudioRecordingErrorCode}.

Implementation

FutureOr<void> onAudioRecordingStateUpdate(
    dynamic state, dynamic errorCode) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler)
      .onAudioRecordingStateUpdate
      ?.call(
          t_AudioRecordingState.android_to_code($p_a
              .AudioRecordingState.values
              .firstWhere((t) => t.$value == state || t.name == state)),
          t_AudioRecordingErrorCode.android_to_code(
              $p_a.AudioRecordingErrorCode.values.firstWhere(
                  (t) => t.$value == errorCode || t.name == errorCode)));
}