onSimulcastSubscribeFallback method

FutureOr<void> onSimulcastSubscribeFallback(
  1. dynamic streamId,
  2. dynamic streamInfo,
  3. dynamic event
)
override

@detail callback @author panjian.fishing @brief When the simulcast subscribe fallback occurs, this callback is received. @param streamId Stream ID. @param streamInfo Stream information. See StreamInfo{@link #StreamInfo}. @param event The information about the change of the simulcast subscribe. See RemoteStreamSwitch{@link #RemoteStreamSwitch} for specific indications.

Implementation

FutureOr<void> onSimulcastSubscribeFallback(
    dynamic streamId, dynamic streamInfo, dynamic event) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance
          as IRTCEngineEventHandler)
      .onSimulcastSubscribeFallback
      ?.call(
          streamId.toString(),
          packObject(
              streamInfo,
              () => StreamInfo.fromMap(StreamInfo.deepPackedMapValues(
                  StreamInfo.mapMemberToConstructorParams(streamInfo)))),
          packObject(
              event,
              () => RemoteStreamSwitch.fromMap(
                  RemoteStreamSwitch.deepPackedMapValues(
                      RemoteStreamSwitch.mapMemberToConstructorParams(
                          event)))));
}