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 ByteRTCPublishFallbackOption{@link #ByteRTCPublishFallbackOption}.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- This API only works after you call setLocalSimulcastMode:{@link #ByteRTCEngine#setlocalsimulcastmode} to enable the mode of publishing multiple streams.
- You must call this API before the user enters 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 rtcEngine:onPerformanceAlarms:info:mode:reason:sourceWantedData:{@link #ByteRTCEngineDelegate#rtcEngine:onPerformanceAlarms:info:mode:reason:sourceWantedData} callback to adjust the capture device.
- After setting the fallback option, the user subscribed to the audio/video stream will receive rtcEngine:onSimulcastSubscribeFallback:info:event:{@link #ByteRTCEngineDelegate#rtcEngine:onSimulcastSubscribeFallback:info:event} when the audio/video stream published by the local user falls back or resumes from the fallback.
- You can alternatively set fallback options in the console, which is of higher priority.
Implementation
FutureOr<int> setPublishFallbackOption(
ByteRTCPublishFallbackOption option) async {
return await nativeCall('setPublishFallbackOption:', [option.$value]);
}