setPublishFallbackOption method
@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
FutureOr<int> setPublishFallbackOption(PublishFallbackOption option) async {
return await nativeCall('setPublishFallbackOption', [option.$value]);
}