Package com.castlabs.android.network
Class NetworkConfiguration.Builder
- java.lang.Object
-
- com.castlabs.android.network.NetworkConfiguration.Builder
-
- Enclosing class:
- NetworkConfiguration
public static class NetworkConfiguration.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(NetworkConfiguration copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkConfiguration.Builder
connectionTimeoutMs(int value)
Sets the connection timeout for both manifest and segment requestsNetworkConfiguration.Builder
dashCallbackConnectionTimeoutMs(int value)
Sets the connection timeout for DASH callbacksNetworkConfiguration.Builder
dashCallbackReadTimeoutMs(int value)
Sets the read timeout for DASH callbacksNetworkConfiguration.Builder
drainConnectionTimeoutMs(int value)
Sets the drain timeout in milliseconds.NetworkConfiguration.Builder
drmAcquisitionTimeoutMs(int value)
Sets the acquisition timeout for DRM requests.NetworkConfiguration.Builder
drmConnectionTimeoutMs(int value)
Sets the connection timeout for DRM requestsNetworkConfiguration.Builder
drmReadTimeoutMs(int value)
Sets the read timeout for DRM requestsNetworkConfiguration.Builder
drmRetryConfiguration(RetryConfiguration value)
Sets the retry configuration used for DRM license requestsNetworkConfiguration
get()
Get the network configurationNetworkConfiguration.Builder
iptvReadTimeoutMs(int value)
Sets the read timeout for DRM requestsNetworkConfiguration.Builder
manifestConnectionTimeoutMs(int value)
Sets the connection timeout for manifest requestsNetworkConfiguration.Builder
manifestReadTimeoutMs(int value)
Sets the read timeout for manifest requestsNetworkConfiguration.Builder
manifestRetryConfiguration(RetryConfiguration value)
Sets the retry configuration used for manifestsNetworkConfiguration.Builder
provisioningRetryConfiguration(RetryConfiguration value)
Sets the retry configuration used for device provisioningNetworkConfiguration.Builder
readTimeoutMs(int value)
Sets the read timeout for both manifest and segment requestsNetworkConfiguration.Builder
retryConfiguration(RetryConfiguration value)
Sets the retry configuration used for both manifests and segmentsNetworkConfiguration.Builder
segmentsConnectionTimeoutMs(int value)
Sets the connection timeout for segment requestsNetworkConfiguration.Builder
segmentsReadTimeoutMs(int value)
Sets the read timeout for segment requestsNetworkConfiguration.Builder
segmentsRetryConfiguration(RetryConfiguration value)
Sets the retry configuration used for segments
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(NetworkConfiguration copy)
-
-
Method Detail
-
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 orNetworkConfiguration.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 orNetworkConfiguration.DEFAULT_CONNECT_TIMEOUT_MILLIS
to use default- 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
-
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 orNetworkConfiguration.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 orNetworkConfiguration.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 orNetworkConfiguration.DEFAULT_READ_TIMEOUT_MILLIS
to use default- 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 orNetworkConfiguration.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
-
-