|
|
long | getNativeHandle () |
| |
| void | setAutoPlay (boolean autoPlay) throws RteException |
| | Sets whether to enable autoplay. More...
|
| |
| boolean | getAutoPlay () throws RteException |
| | Gets the autoplay setting. More...
|
| |
| void | setPlaybackSpeed (int speed) throws RteException |
| | Sets the playback speed parameter. More...
|
| |
| int | getPlaybackSpeed () throws RteException |
| | Gets the playback speed parameter. More...
|
| |
|
void | setPlayoutAudioTrackIdx (int idx) throws RteException |
| |
|
int | getPlayoutAudioTrackIdx () throws RteException |
| |
|
void | setPublishAudioTrackIdx (int idx) throws RteException |
| |
|
int | getPublishAudioTrackIdx () throws RteException |
| |
|
void | setAudioTrackIdx (int idx) throws RteException |
| |
|
int | getAudioTrackIdx () throws RteException |
| |
|
void | setSubtitleTrackIdx (int idx) throws RteException |
| |
|
int | getSubtitleTrackIdx () throws RteException |
| |
|
void | setExternalSubtitleTrackIdx (int idx) throws RteException |
| |
|
int | getExternalSubtitleTrackIdx () throws RteException |
| |
|
void | setAudioPitch (int audioPitch) throws RteException |
| |
|
int | getAudioPitch () throws RteException |
| |
| void | setPlayoutVolume (int volume) throws RteException |
| | Sets the playback volume parameter. More...
|
| |
| int | getPlayoutVolume () throws RteException |
| | Gets the playback volume of the media player. More...
|
| |
|
void | setAudioPlaybackDelay (int delay) throws RteException |
| |
|
int | getAudioPlaybackDelay () throws RteException |
| |
|
void | setAudioDualMonoMode (int mode) throws RteException |
| |
|
int | getAudioDualMonoMode () throws RteException |
| |
|
void | setPublishVolume (int volume) throws RteException |
| |
|
int | getPublishVolume () throws RteException |
| |
| void | setLoopCount (int count) throws RteException |
| | Sets the number of times the media file loops during playback. More...
|
| |
| int | getLoopCount () throws RteException |
| | Gets the loop count parameter of the media file. More...
|
| |
| void | setJsonParameter (String jsonParameter) throws RteException |
| |
| String | getJsonParameter () throws RteException |
| | Gets the configured SDK JSON settings. More...
|
| |
| void | setAbrSubscriptionLayer (Constants.AbrSubscriptionLayer subscriptionLayer) throws RteException |
| | Sets the quality level of the subscribed media stream. More...
|
| |
| Constants.AbrSubscriptionLayer | getAbrSubscriptionLayer () throws RteException |
| | Gets the quality layer of the subscribed video stream. More...
|
| |
| void | setAbrFallbackLayer (Constants.AbrFallbackLayer fallbackLayer) throws RteException |
| | Sets the fallback option for subscribed remote video streams. More...
|
| |
| Constants.AbrFallbackLayer | getAbrFallbackLayer () throws RteException |
| | Gets the configured video stream fallback option. More...
|
| |
This class provides methods related to Media player options.
- Since
- v4.4.0
| void io.agora.rte.PlayerConfig.setAbrSubscriptionLayer |
( |
Constants.AbrSubscriptionLayer |
subscriptionLayer | ) |
throws RteException |
Sets the quality level of the subscribed media stream.
- Since
- v4.4.0
You can switch between different video quality levels of the subscribed stream based on actual network conditions, corresponding to different resolutions. By default, after calling this method, viewers can only switch between the HIGH and LOW quality levels of the video stream. If you require more advanced 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 level, allowing viewers to switch between all levels of the multi-layer video stream based on their needs. For detailed implementation, see the Viewer-side URL Media Pull. Applicable scenarios: In unstable network environments, the viewer can select an appropriate video quality level based on actual network conditions to ensure smooth viewing experience. Call timing: This method must be called before setConfigs(PlayerConfig config).
- Note
- If the ABR feature is not enabled, you can only subscribe to the
HIGH or LOW video quality levels.
- Parameters
-
| subscriptionLayer | The video quality level to subscribe to. See AbrSubscriptionLayer. When customizing resolutions for LAYER1 to LAYER6, you can refer to the table below, or configure them based on your actual requirements: Note: When customizing resolutions, be sure to sort the video quality levels (Layers) in descending order of resolution, and by descending frame rate if resolutions are the same.
| Video Quality Layer | Resolution |
LAYER1 | 2160p (4K) |
LAYER2 | 1440p (2K) |
LAYER3 | 1080p (HD) |
LAYER4 | 720p (HD) |
LAYER5 | 540p (SD) |
LAYER6 | 480p (SD) |
|
- Exceptions
-
| RteException | If the method call fails, the SDK throws an RteException with corresponding error information. You need to catch and handle the exception. |
| void io.agora.rte.PlayerConfig.setAbrFallbackLayer |
( |
Constants.AbrFallbackLayer |
fallbackLayer | ) |
throws RteException |
Sets the fallback option for subscribed remote video streams.
- Since
- v4.4.0
In suboptimal network conditions, the quality of real-time audio and video communication may degrade. After calling this method, the SDK downgrades the resolution of the video stream to the specified quality layer when network conditions worsen. Each video quality layer corresponds to a specific resolution and bitrate. At the same time, the SDK continuously monitors network conditions and restores the subscribed remote video streams to the original quality layer when the network improves. By default, after calling this method, you can only choose to fall back to LOW or AUDIO_ONLY. If you require higher video quality, you can contact technical support to enable the ABR feature. Once enabled, you can fall back to any quality layer of the multi-layer video stream and customize the resolution corresponding to each layer. Applicable scenarios:
- In general video scenarios, you can call this method and set the fallback quality layer to
LOW or AUDIO_ONLY. The SDK downgrades the video stream to a lower-quality stream or receives only the audio stream when the network is poor.
- If you have higher requirements for the resolution of 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 dynamically adjusts the resolution within the range starting from the lowest resolution layer you specify, depending on the network conditions. For implementation details, refer to
Audience-side URL streaming. Call timing: You must call this method before setConfigs(PlayerConfig config).
- Note
- If you have not enabled the ABR feature when calling this method, the fallback quality layer of the video stream can only be set to
LOW or AUDIO_ONLY.
- Parameters
-
| fallbackLayer | The fallback quality layer for the video stream. See AbrFallbackLayer. When customizing the resolution for LAYER1 through LAYER6, you can refer to the table below or define them based on your actual needs:
| Video Quality Layer | Resolution |
LAYER1 | 2160p (4K) |
LAYER2 | 1440p (2K) |
LAYER3 | 1080p (HD) |
LAYER4 | 720p (HD) |
LAYER5 | 540p (SD) |
LAYER6 | 480p (SD) |
Note: When customizing resolutions, make sure to sort the video quality layers from highest to lowest resolution. If the resolutions are the same, sort them by frame rate in descending order. |
- Exceptions
-
| RteException | If this method call fails, the SDK throws an RteException with the corresponding error information. You need to catch and handle the exception accordingly. |