onLocalAudioStateChanged method

FutureOr<void> onLocalAudioStateChanged(
  1. dynamic audioSource,
  2. dynamic state,
  3. dynamic error
)
override

@detail callback @author zhangyuanyuan.0101 @brief When the state of the local audio stream changes, the callback notifies the current local audio stream state. @param audioSource Reserved parameter @param state The status of the local audio device. See LocalAudioStreamState{@link #LocalAudioStreamState} @param error The error code when the state of the local audio stream changes. See LocalAudioStreamError{@link #LocalAudioStreamError}

Implementation

FutureOr<void> onLocalAudioStateChanged(
    dynamic audioSource, dynamic state, dynamic error) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler).onLocalAudioStateChanged?.call(
      audioSource,
      t_LocalAudioStreamState.android_to_code($p_a
          .LocalAudioStreamState.values
          .firstWhere((t) => t.$value == state || t.name == state)),
      t_LocalAudioStreamError.android_to_code($p_a
          .LocalAudioStreamError.values
          .firstWhere((t) => t.$value == error || t.name == error)));
}