Class NetworkConfiguration

  • All Implemented Interfaces:

    
    public final class NetworkConfiguration
    
                        

    Configuration for the player's network stack and retry mechanisms.

    • Constructor Detail

    • 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 java.net.HttpURLConnection for all its network requests. However, on most Android devices, this implementation only supports HTTP/1.1, which is suboptimal for media streaming. This option allows the player to select a more modern network stack that supports HTTP/2 and/or HTTP/3, which can be more efficient.

        • When set to true, the player will attempt to use either android.net.http.HttpEngine (on Android 14 and higher) or Cronet (when added as a library to your app) for its network requests.

        • When set to false, the player will always use java.net.HttpURLConnection.

        • When set to null, the player will use its default value. The default value is currently false, so an opt-in is needed to use the new network stack. In a future major version, this default value will change to true, so an opt-out will be needed to use the old network stack.

        Note: Some APIs such as com.theoplayer.android.api.settings.SslSettings.setKeyStore are not supported when using the modern network stack.

        Default: null (equivalent to false)

        Since:

        v9.10.0