setAbrFallbackLayer
Sets the fallback option for the subscribed remote video stream.
public void setAbrFallbackLayer(Constants.AbrFallbackLayer fallbackLayer) throws RteException
- Since
- Available since v4.4.0.
When the network condition is poor, the SDK downgrades the resolution of the subscribed remote video stream to the specified video quality layer. Each quality layer corresponds to a specific resolution and bitrate. Once the network recovers, the SDK restores the video stream to the original quality layer.
LOW or AUDIO_ONLY.Scenario
In general scenarios, you can call this method and set the fallback quality layer to kRteAbrFallbackLow or kRteAbrFallbackAudioOnly. When the network is poor, the SDK will fall back to a lower quality video stream or audio-only stream.
If you require higher resolution for fallback video streams, you can contact technical support to enable the ABR feature. Once enabled, you can customize the resolution of each layer. The SDK will use the resolution of the lowest quality layer you specify as the lower bound and dynamically adjust the resolution within that range based on network conditions.
Timing
This method must be called before calling setConfigs.
Parameters
- fallbackLayer
- The fallback quality layer of the video stream. See AbrFallbackLayer.
Note: When customizing resolutions, ensure that the video quality layers are sorted from high to low resolution. If the resolutions are the same, sort by frame rate from high to low.
Video Quality Layer Resolution LAYER12160p (4K) LAYER21440p (2K) LAYER31080p (HD) LAYER4720p (HD) LAYER5540p (SD) LAYER6480p (SD)
Exceptions
If the call fails, the SDK throws an exception and returns the corresponding error message. You need to catch and handle the exception.