setSubscribeFallbackOption method
@detail api
@author panjian.fishing
@brief Sets the fallback option for subscribed RTC streams.
You can call this API to set whether to lower the resolution of currently subscribed stream under limited network conditions.
@param option Fallback option, see SubscribeFallbackOptions{@link #SubscribeFallbackOptions} for more details.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- You must call this API before enterting the room.
- After you enables the fallback, you will receive onSimulcastSubscribeFallback{@link #IRTCEngineEventHandler#onSimulcastSubscribeFallback} and onRemoteVideoSizeChanged{@link #IRTCEngineEventHandler#onRemoteVideoSizeChanged} when the resolution of your subscribed stream is lowered or restored.
- You can alternatively set fallback options with distrubutions from server side, which is of higher priority.
Implementation
Future<int?> setSubscribeFallbackOption(
SubscribeFallbackOptions option) async {
$a() => ($instance as $p_a.RTCEngine).setSubscribeFallbackOption(
t_SubscribeFallbackOptions.code_to_android(option));
$i() => ($instance as $p_i.ByteRTCEngine).setSubscribeFallbackOption(
t_SubscribeFallbackOptions.code_to_ios(option));
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}