SetAbrSubscriptionLayer

Sets the video quality layer of the subscribed media stream.

void SetAbrSubscriptionLayer(AbrSubscriptionLayer abr_subscription_layer, Error *err = nullptr)
Since
Available since v4.4.0.

You can switch between different video quality layers based on the actual network conditions, with each layer corresponding to a different resolution. By default, after calling this method, the subscriber can only switch between high and low quality, i.e., kRteAbrSubscriptionHigh and kRteAbrSubscriptionLow. If you require more control over video resolution switching, you can contact technical support to enable the ABR (Adaptive Bitrate) feature. Once enabled, you can customize the resolution for each video quality layer, and the subscriber can switch between all quality layers as needed.

Note: If the ABR feature is not enabled when calling this method, the subscribed video quality layer can only be kRteAbrSubscriptionHigh or kRteAbrSubscriptionLow.

Scenario

In unstable network environments, the subscriber can select an appropriate video quality layer based on the actual network conditions to ensure a smooth viewing experience.

Timing

This method must be called before calling SetConfigs.

Parameters

abr_subscription_layer
The video quality layer to subscribe to. See RteAbrSubscriptionLayer. When customizing the resolution from kRteAbrSubscriptionLayer1 to kRteAbrSubscriptionLayer6, refer to the table below or set according to actual needs: Note: When customizing resolutions, ensure the video quality layers are sorted by resolution from high to low; when resolutions are the same, sort by frame rate from high to low.
Video Quality Layer Resolution
kRteAbrSubscriptionLayer1 2160p (4K)
kRteAbrSubscriptionLayer2 1440p (2K)
kRteAbrSubscriptionLayer3 1080p (HD)
kRteAbrSubscriptionLayer4 720p (HD)
kRteAbrSubscriptionLayer5 540p (SD)
kRteAbrSubscriptionLayer6 480p (SD)
err
Output parameter. Status or error information. See Error.