Package com.theoplayer.android.api.cache
Class CachingParameters.Builder
-
- All Implemented Interfaces:
public class CachingParameters.Builder
The builder for the caching parameters.
-
-
Constructor Summary
Constructors Constructor Description CachingParameters.Builder()
-
Method Summary
Modifier and Type Method Description CachingParameters.Builder
amount(@Nullable() String amount)
Sets the amount of data to cache for the given stream. CachingParameters.Builder
expirationDate(@Nullable() Date expirationDate)
Sets the expiration date of the cached data. CachingParameters.Builder
bandwidth(@Nullable() Long bandwidth)
Sets the upper bandwidth limit of the quality to cache. CachingParameters.Builder
preferredTrackSelection(@Nullable() CachingPreferredTrackSelection preferredTrackSelection)
Sets the preferred audio/text tracks to cache. CachingParameters
build()
Builds the caching parameters. -
-
Method Detail
-
amount
CachingParameters.Builder amount(@Nullable() String amount)
Sets the amount of data to cache for the given stream. Will be ignored for progressive media caching. Possible formats:
- A number in seconds.
- A percentage string (XX%) for a proportion of the content duration.
Default: "100%"
- Parameters:
amount
- The amount of data to cache, in seconds or percentage string (XX%).
-
expirationDate
CachingParameters.Builder expirationDate(@Nullable() Date expirationDate)
Sets the expiration date of the cached data.
- Must be a date in the future.
Default: 30 minutes after starting the caching task.
- Parameters:
expirationDate
- The expiration date of the cached data.
-
bandwidth
CachingParameters.Builder bandwidth(@Nullable() Long bandwidth)
Sets the upper bandwidth limit of the quality to cache.
- This will take the quality with the highest bandwidth that is lower than the specified bandwidth.
- It should be a value between one and MAX_VALUE or null.
- In case the value is null, it defaults to the highest bandwidth possible.
- Parameters:
bandwidth
- The bandwidth between one and MAX_VALUE or null.
-
preferredTrackSelection
CachingParameters.Builder preferredTrackSelection(@Nullable() CachingPreferredTrackSelection preferredTrackSelection)
Sets the preferred audio/text tracks to cache.
- In case the value is null, it defaults to the first track in manifest.
- Parameters:
preferredTrackSelection
- The CachingPreferredTrackSelection representing the preferred tracks to cache.
-
build
CachingParameters build()
Builds the caching parameters.
-
-
-
-