rtcEngine$onRemoteAudioStateChanged$info$state$reason method

FutureOr<void> rtcEngine$onRemoteAudioStateChanged$info$state$reason(
  1. dynamic engine,
  2. dynamic streamId,
  3. dynamic info,
  4. dynamic state,
  5. dynamic reason,
)
override

@detail callback @author zhangyuanyuan.0101 @brief Receive this callback when the state of the remote audio stream subscribed to changes. @param engine ByteRTCEngine object @param streamId ID of Remote stream. @param info Remote stream information. See ByteRTCStreamInfo{@link #ByteRTCStreamInfo}. @param state The current state of the remote audio stream. See ByteRTCRemoteAudioState{@link #ByteRTCRemoteAudioState} @param reason The reason for the change in the state of the remote audio stream. See ByteRTCRemoteAudioStateChangeReason{@link #ByteRTCRemoteAudioStateChangeReason}

Implementation

FutureOr<void> rtcEngine$onRemoteAudioStateChanged$info$state$reason(
    dynamic engine,
    dynamic streamId,
    dynamic info,
    dynamic state,
    dynamic reason) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler)
      .onRemoteAudioStateChanged
      ?.call(
          streamId.toString(),
          packObject(
              info,
              () => StreamInfo.fromMap(StreamInfo.deepPackedMapValues(
                  StreamInfo.mapMemberToConstructorParams(info)))),
          t_RemoteAudioState.ios_to_code($p_i.ByteRTCRemoteAudioState.values
              .firstWhere((t) => t.$value == state || t.name == state)),
          t_RemoteAudioStateChangeReason.ios_to_code($p_i
              .ByteRTCRemoteAudioStateChangeReason.values
              .firstWhere((t) => t.$value == reason || t.name == reason)));
}