Class NetworkConfiguration
-
- All Implemented Interfaces:
public final class NetworkConfigurationConfiguration for the player's network stack and retry mechanisms.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classNetworkConfiguration.BuilderThe builder for the network and retry configuration.
-
Field Summary
Fields Modifier and Type Field Description private final IntegermaxRetriesprivate final LongminimumBackOffprivate final LongmaximumBackOffprivate final BooleanuseHttpEngine
-
Method Summary
Modifier and Type Method Description final IntegergetMaxRetries()The maximum amount of retries before the player throws a fatal error. final LonggetMinimumBackOff()Sets the initial delay in milliseconds before a retry request occurs. final LonggetMaximumBackOff()Sets the maximum amount of delay in milliseconds between retry requests. final BooleangetUseHttpEngine()Whether the player should use android.net.http.HttpEngine or Cronet for its network stack, if available. final NetworkConfiguration.BuilderbuildUpon()Creates a builder initialized with the values as this NetworkConfiguration. -
-
Method Detail
-
getMaxRetries
final Integer getMaxRetries()
The maximum amount of retries before the player throws a fatal error.
Default:
Integer.MAX_VALUE.
-
getMinimumBackOff
final Long getMinimumBackOff()
Sets the initial delay in milliseconds before a retry request occurs. Exponential backoff will be applied on this value.
Default:
200.
-
getMaximumBackOff
final Long getMaximumBackOff()
Sets the maximum amount of delay in milliseconds between retry requests.
Default:
30000.
-
getUseHttpEngine
final Boolean getUseHttpEngine()
Whether the player should use android.net.http.HttpEngine or Cronet for its network stack, if available.
By default, the player uses android.net.http.HttpEngine (on Android 14 and higher) or Cronet (when added as a library to your app) for all its network requests, taking advantage of HTTP/2 and HTTP/3 support for optimal media streaming. When neither of these APIs are available, the player falls back to HTTP/1.1 using java.net.HttpURLConnection.
When set to
true, the player will attempt to use either android.net.http.HttpEngine or Cronet for its network requests.When set to
false, the player will always use java.net.HttpURLConnection.
Note: Some APIs such as com.theoplayer.android.api.settings.SslSettings.setKeyStore are not supported when using the modern network stack.
Default:
true- Since:
v9.10.0
-
buildUpon
final NetworkConfiguration.Builder buildUpon()
Creates a builder initialized with the values as this NetworkConfiguration.
- Since:
v9.10.0
-
-
-
-