Agora Java API Reference for Android
Public Member Functions | Protected Member Functions | List of all members
io.agora.rte.PlayerConfig Class Reference

Public Member Functions

long getNativeHandle ()
 
void setAutoPlay (boolean autoPlay) throws RteException
 
boolean getAutoPlay () throws RteException
 
void setPlaybackSpeed (int speed) throws RteException
 
int getPlaybackSpeed () throws RteException
 
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
 
int getPlayoutVolume () throws RteException
 
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
 
int getLoopCount () throws RteException
 
void setJsonParameter (String jsonParameter) throws RteException
 
String getJsonParameter () throws RteException
 
void setAbrSubscriptionLayer (Constants.AbrSubscriptionLayer subscriptionLayer) throws RteException
 
Constants.AbrSubscriptionLayer getAbrSubscriptionLayer () throws RteException
 
void setAbrFallbackLayer (Constants.AbrFallbackLayer fallbackLayer) throws RteException
 
Constants.AbrFallbackLayer getAbrFallbackLayer () throws RteException
 

Protected Member Functions

void finalize ()
 

Detailed Description

Player configuration class

Since
v4.4.0

Member Function Documentation

◆ setAutoPlay()

void io.agora.rte.PlayerConfig.setAutoPlay ( boolean  autoPlay) throws RteException

Whether to automatically play after a successful call to Player.openWithUrl. If not set, the default value is true.

Since
v4.4.0
Parameters
autoPlay
  • true: Automatically start streaming and playing after a successful opening.
  • false: After a successful open with Player.openWithUrl, you need to actively call Player.play() to play the audio and video stream.
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode
Returns
void

◆ getAutoPlay()

boolean io.agora.rte.PlayerConfig.getAutoPlay ( ) throws RteException

Get the auto-play setting

Since
v4.4.0
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode
Returns
boolean Returns whether auto-play is enabled

◆ setJsonParameter()

void io.agora.rte.PlayerConfig.setJsonParameter ( String  jsonParameter) throws RteException

Set player private parameters. This parameter setting can be done according to actual needs, referring to the suggestions of Agora SA.

Since
v4.4.0
Parameters
jsonParameterJSON formatted string
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode:
  • ErrorCode.INVALID_ARGUMENT: Indicates that the jsonParameter parameter is empty.
Returns
void

◆ getJsonParameter()

String io.agora.rte.PlayerConfig.getJsonParameter ( ) throws RteException

Get the currently configured private parameters of the player.

Since
v4.4.0
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode:
Returns
String JSON formatted string of private parameters

◆ setAbrSubscriptionLayer()

void io.agora.rte.PlayerConfig.setAbrSubscriptionLayer ( Constants.AbrSubscriptionLayer  subscriptionLayer) throws RteException

Set the ABR subscription layer. If ABR is not enabled, the audience can only switch the high and low video stream in the origin channel. After enabling it, the audience can switch any layer in the abr channel.

Since
v4.4.0
Parameters
subscriptionLayerThe layer to subscribe to. Refer to the Constants.AbrSubscriptionLayer enumeration values for details.
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode:
  • ErrorCode.INVALID_ARGUMENT: An illegal AbrSubscriptionLayer value was set.
Returns
void

◆ getAbrSubscriptionLayer()

Constants.AbrSubscriptionLayer io.agora.rte.PlayerConfig.getAbrSubscriptionLayer ( ) throws RteException

Get the ABR subscription layer. If ABR is not enabled, after calling this method, the audience can only set Constans.AbrFallbackLayer.DISABLED ~ Constans.AbrFallbackLayer.AUDIO_ONLY in the original channel. After enabling it, the audience can switch all values of AbrFallbackLayer in the abr channel.

Since
v4.4.0
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode:
Returns
AbrSubscriptionLayer The currently set subscription layer.

◆ setAbrFallbackLayer()

void io.agora.rte.PlayerConfig.setAbrFallbackLayer ( Constants.AbrFallbackLayer  fallbackLayer) throws RteException

Set the ABR fallback layer option.

Since
v4.4.0
Parameters
fallbackLayerThe ABR fallback option to set. Refer to the Constants.AbrFallbackLayer enumeration values for details.
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode:
  • ErrorCode.INVALID_ARGUMENT: An illegal AbrFallbackLayer value was set. Check the value of the passed fallbackLayer parameter.
Returns
void

◆ getAbrFallbackLayer()

Constants.AbrFallbackLayer io.agora.rte.PlayerConfig.getAbrFallbackLayer ( ) throws RteException

Get the ABR fallback layer option.

Since
v4.4.0
Exceptions
RteExceptionRteException.errorCode() may return the following ErrorCode:
Returns
AbrFallbackLayer The currently set ABR fallback option.