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