setPublishFallbackOption method

Future<int?> setPublishFallbackOption(
  1. PublishFallbackOption option
)

@detail api @author panjian.fishing @brief Sets the fallback option for published audio & video streams.
You can call this API to set whether to automatically lower the resolution you set of the published streams under limited network conditions. @param option Fallback option, see PublishFallbackOption{@link #PublishFallbackOption}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note - This API only works after you call setLocalSimulcastMode{@link #RTCEngine#setlocalsimulcastmode-2} to enable the mode of publishing multiple streams. - You must call this API before entering the room. - After calling this method, if there is a performance degradation or recovery due to poor performance or network conditions, the local end will receive early warnings through the onPerformanceAlarms{@link #IRTCEngineEventHandler#onPerformanceAlarms} callback to adjust the capture device. - After you allow video stream to fallback, your stream subscribers will receive onSimulcastSubscribeFallback{@link #IRTCEngineEventHandler#onSimulcastSubscribeFallback} when the resolution of your published stream are lowered or restored. - You can alternatively set fallback options with distrubutions from server side, which is of higher priority.

Implementation

Future<int?> setPublishFallbackOption(PublishFallbackOption option) async {
  $a() => ($instance as $p_a.RTCEngine).setPublishFallbackOption(
      t_PublishFallbackOption.code_to_android(option));
  $i() => ($instance as $p_i.ByteRTCEngine)
      .setPublishFallbackOption(t_PublishFallbackOption.code_to_ios(option));

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}