SetAbrFallbackLayer
Sets the fallback option for the subscribed video stream.
void SetAbrFallbackLayer(AbrFallbackLayer abr_fallback_layer, Error *err = nullptr)
- Since
- Available since v4.4.0.
When the network condition is poor, the SDK will downgrade the video stream resolution to the specified fallback quality layer to ensure continuous playback. Different quality layers correspond to different resolutions and bitrates. The SDK continuously monitors the network condition and automatically restores the video stream to the subscribed quality layer when the network recovers.
By default, fallback is only supported to kRteAbrFallbackLow or kRteAbrFallbackAudioOnly. For a more flexible video experience, you can contact technical support to enable the ABR feature. Once enabled, fallback to all quality layers is supported, and you can customize the resolution of each layer.
kRteAbrFallbackLow or kRteAbrFallbackAudioOnly.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
- abr_fallback_layer
- The fallback quality layer of the video stream. See RteAbrFallbackLayer. When customizing the resolution from
kRteAbrFallbackLayer1tokRteAbrFallbackLayer6, refer to the table below:Note: When customizing resolutions, be sure to sort the video quality layers by resolution from high to low; when resolutions are the same, sort by frame rate from high to low.Video Quality Layer Resolution kRteAbrSubscriptionLayer12160p (4K) kRteAbrSubscriptionLayer21440p (2K) kRteAbrSubscriptionLayer31080p (HD) kRteAbrSubscriptionLayer4720p (HD) kRteAbrSubscriptionLayer5540p (SD) kRteAbrSubscriptionLayer6480p (SD) - err
- Status or error information. See Error.