Class NetworkConfiguration.Builder

java.lang.Object
com.castlabs.android.network.NetworkConfiguration.Builder
Enclosing class:
NetworkConfiguration

public static class NetworkConfiguration.Builder extends Object
  • Constructor Details

  • Method Details

    • retryConfiguration

      public NetworkConfiguration.Builder retryConfiguration(@NonNull RetryConfiguration value)
      Sets the retry configuration used for both manifests and segments
      Parameters:
      value - Retry configuration
      Returns:
      The builder
    • segmentsRetryConfiguration

      public NetworkConfiguration.Builder segmentsRetryConfiguration(@NonNull RetryConfiguration value)
      Sets the retry configuration used for segments
      Parameters:
      value - Retry configuration
      Returns:
      The builder
    • drmRetryConfiguration

      public NetworkConfiguration.Builder drmRetryConfiguration(@NonNull RetryConfiguration value)
      Sets the retry configuration used for DRM license requests
      Parameters:
      value - Retry configuration
      Returns:
      The builder
    • provisioningRetryConfiguration

      public NetworkConfiguration.Builder provisioningRetryConfiguration(@NonNull RetryConfiguration value)
      Sets the retry configuration used for device provisioning
      Parameters:
      value - Retry configuration
      Returns:
      The builder
    • manifestRetryConfiguration

      public NetworkConfiguration.Builder manifestRetryConfiguration(@NonNull RetryConfiguration value)
      Sets the retry configuration used for manifests
      Parameters:
      value - Retry configuration
      Returns:
      The builder
    • connectionTimeoutMs

      public NetworkConfiguration.Builder connectionTimeoutMs(int value)
      Sets the connection timeout for both manifest and segment requests
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • segmentsConnectionTimeoutMs

      public NetworkConfiguration.Builder segmentsConnectionTimeoutMs(int value)
      Sets the connection timeout for segment requests
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • manifestConnectionTimeoutMs

      public NetworkConfiguration.Builder manifestConnectionTimeoutMs(int value)
      Sets the connection timeout for manifest requests
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • drmConnectionTimeoutMs

      public NetworkConfiguration.Builder drmConnectionTimeoutMs(int value)
      Sets the connection timeout for DRM requests
      Parameters:
      value - The new connection timeout or NetworkConfiguration.DEFAULT_DRM_CONNECT_TIMEOUT_MILLIS to use default
      Returns:
      The builder
    • dashCallbackConnectionTimeoutMs

      public NetworkConfiguration.Builder dashCallbackConnectionTimeoutMs(int value)
      Sets the connection timeout for DASH callbacks
      Parameters:
      value - The new connection timeout or NetworkConfiguration.DEFAULT_CONNECT_TIMEOUT_MILLIS to use default
      Returns:
      The builder
    • thumbnailConnectionTimeoutMs

      public NetworkConfiguration.Builder thumbnailConnectionTimeoutMs(int value)
      Sets the connection timeout for thumbnail requests. This timeout is used only if the ThumbsPlugin is registered.
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • readTimeoutMs

      public NetworkConfiguration.Builder readTimeoutMs(int value)
      Sets the read timeout for both manifest and segment requests
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • segmentsReadTimeoutMs

      public NetworkConfiguration.Builder segmentsReadTimeoutMs(int value)
      Sets the read timeout for segment requests
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • segmentsCallTimeoutMs

      public NetworkConfiguration.Builder segmentsCallTimeoutMs(int value)
      Sets the Call timeout for segment requests including the request, redirect and response This only currently works with the OkHttp Plugin. TODO: Add support in the Default Http Plugin.
      Parameters:
      value - The new segment call timeout.
      Returns:
      The builder
    • manifestReadTimeoutMs

      public NetworkConfiguration.Builder manifestReadTimeoutMs(int value)
      Sets the read timeout for manifest requests
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • drmReadTimeoutMs

      public NetworkConfiguration.Builder drmReadTimeoutMs(int value)
      Sets the read timeout for DRM requests
      Parameters:
      value - The new connection timeout or NetworkConfiguration.DEFAULT_DRM_READ_TIMEOUT_MILLIS to use default
      Returns:
      The builder
    • iptvReadTimeoutMs

      public NetworkConfiguration.Builder iptvReadTimeoutMs(int value)
      Sets the read timeout for DRM requests
      Parameters:
      value - The new read timeout or NetworkConfiguration.DEFAULT_READ_TIMEOUT_MILLIS to use default
      Returns:
      The builder
    • dashCallbackReadTimeoutMs

      public NetworkConfiguration.Builder dashCallbackReadTimeoutMs(int value)
      Sets the read timeout for DASH callbacks
      Parameters:
      value - The new connection timeout or NetworkConfiguration.DEFAULT_READ_TIMEOUT_MILLIS to use default
      Returns:
      The builder
    • thumbnailReadTimeoutMs

      public NetworkConfiguration.Builder thumbnailReadTimeoutMs(int value)
      Sets the read timeout for thumbnail requests. This timeout is used only if the ThumbsPlugin is registered.
      Parameters:
      value - The new connection timeout
      Returns:
      The builder
    • drmAcquisitionTimeoutMs

      public NetworkConfiguration.Builder drmAcquisitionTimeoutMs(int value)
      Sets the acquisition timeout for DRM requests. Maximum total time a single DRM request can take.
      Parameters:
      value - The new acquisition timeout or NetworkConfiguration.DEFAULT_DRM_ACQUISITION_TIMEOUT_MILLIS to use default
      Returns:
      The builder
    • drainConnectionTimeoutMs

      public NetworkConfiguration.Builder drainConnectionTimeoutMs(int value)
      Sets the drain timeout in milliseconds. This is the time that we give the player to drain and read all remaining data when a connection is closed. If all data can be drained in time, the connection can potentially be re-used.
      Parameters:
      value - The new timeout in milliseconds
      Returns:
      The builder
    • get

      public NetworkConfiguration get()
      Get the network configuration
      Returns:
      The network configuration