public interface CachingTask extends EventDispatcher<CachingTaskEvent>
Modifier and Type | Method and Description |
---|---|
long |
getBytes()
The estimation of the amount this task will download and store, in bytes.
|
long |
getBytesCached()
The amount downloaded and stored, in bytes.
|
TimeRanges |
getCached()
The time ranges indicating the data which has been cached.
|
double |
getDuration()
The requested cached duration of the media, in seconds.
|
String |
getId()
The identifier of the task.
|
CachingParameters |
getParameters()
The configuration of the task.
|
double |
getPercentageCached()
The percentage of content that has been cached.
|
Integer |
getProgressNotificationId()
The notification identifier of the task when showing its progress notification.
|
double |
getSecondsCached()
The amount of content that has been cached.
|
SourceDescription |
getSource()
The media source associated with the task.
|
CachingTaskStatus |
getStatus()
The current status of the task.
|
Integer |
getStatusNotificationId()
The notification identifier of the task when showing its status notification.
|
CachingTaskLicense |
license()
The API for license related queries and operations.
|
void |
pause()
Pause caching the media.
|
void |
remove()
Remove the cached media.
|
void |
start()
Start caching the media.
|
addEventListener, removeEventListener
String getId()
CachingTaskStatus getStatus()
- For possible values, see CachingTaskStatus
.
CachingTaskStatus.IDLE
SourceDescription getSource()
CachingParameters getParameters()
- These parameters can not be modified after creating a task. Instead, a new task should be created with different parameters.
double getDuration()
- Returns -1 if the duration is not available yet.
long getBytes()
- Returns -1 if the estimate is not available yet.
long getBytesCached()
TimeRanges getCached()
double getSecondsCached()
double getPercentageCached()
Integer getStatusNotificationId()
- The identifier is null when the task has not been started yet.
Integer getProgressNotificationId()
- The identifier is null when the task has not been started yet.
CachingTaskLicense license()
CachingTaskLicense
. (NonNull)void start()
- A manifest or segment will only be cached if it is not yet present in the cache.
void pause()
- Segments that are currently being downloaded will still be completed and stored.
- A paused task can be resumed with start()
.
void remove()
- A manifest or segment referenced by multiple tasks will only be evicted if all associated tasks are removed.