public interface IDownloadManager
Modifier and Type | Interface and Description |
---|---|
static interface |
IDownloadManager.IRequest
Contract of a download request that can be submitted to the download manager.
|
Modifier and Type | Method and Description |
---|---|
io.reactivex.Observable<com.brightcove.player.store.DownloadRequestSet> |
createDownloadRequestSet(RequestConfig requestConfig,
long estimatedSize,
DownloadManager.Listener listener)
Creates an empty download request set with the specified estimated size.
|
boolean |
deleteDownload(com.brightcove.player.store.DownloadRequestSet requestSet)
Cancels all the download requests in the specified set and removes the download request set.
|
boolean |
deleteDownload(java.lang.Long requestSetKey)
Cancels all the download requests in the specified set and removes the download request set.
|
io.reactivex.Observable<com.brightcove.player.store.DownloadRequestSet> |
enqueueDownload(com.brightcove.player.store.DownloadRequestSet requestSet,
IDownloadManager.IRequest... requests)
Enqueues a set of download requests to the specified request set.
|
DownloadStatus |
getDownloadStatus(com.brightcove.player.store.DownloadRequestSet requestSet)
Queries the overall download status of the specified download request set.
|
DownloadStatus |
getDownloadStatus(java.lang.Long requestSetKey)
Queries the overall download status of the specified download request set.
|
DownloadStatus |
pauseDownload(com.brightcove.player.store.DownloadRequestSet requestSet)
Pauses download of the specified request set, if it is not already paused.
|
DownloadStatus |
pauseDownload(java.lang.Long requestSetKey)
Pauses download of the specified request set, if it is not already paused.
|
DownloadStatus |
resumeDownload(com.brightcove.player.store.DownloadRequestSet requestSet)
Resumes download of the specified request set, if it is currently paused.
|
DownloadStatus |
resumeDownload(java.lang.Long requestSetKey)
Resumes download of the specified request set, if it is currently paused.
|
@NonNull io.reactivex.Observable<com.brightcove.player.store.DownloadRequestSet> createDownloadRequestSet(@Nullable RequestConfig requestConfig, long estimatedSize, @NonNull DownloadManager.Listener listener)
Please note the operation will be carried on a background i/o thread.
requestConfig
- the configuration to be used for handling the download requests.estimatedSize
- the estimated total size of the download.listener
- reference to the callback listener that must be notified about status changes
related to this download request.Observable
that must subscribed to complete operation and
obtain the result.@NonNull io.reactivex.Observable<com.brightcove.player.store.DownloadRequestSet> enqueueDownload(@NonNull com.brightcove.player.store.DownloadRequestSet requestSet, @NonNull IDownloadManager.IRequest... requests)
DownloadStatus.STATUS_PENDING
immediately adding the
requests to the database. The DownloadManager
will start to process the download
requests after this call, because of network availability and current download queue load.
Please note the operation will be carried on a background i/o thread.
requestSet
- reference to therequests
- the download requests to be enqueued.Observable
that must subscribed to complete operation and
obtain the result.@NonNull DownloadStatus pauseDownload(@Nullable com.brightcove.player.store.DownloadRequestSet requestSet)
requestSet
- reference to the download request to be paused.@NonNull DownloadStatus pauseDownload(@NonNull java.lang.Long requestSetKey)
requestSetKey
- the unique identifier to the download request.@NonNull DownloadStatus resumeDownload(@Nullable com.brightcove.player.store.DownloadRequestSet requestSet)
requestSet
- reference to the download request to be resumed.@NonNull DownloadStatus resumeDownload(@NonNull java.lang.Long requestSetKey)
requestSetKey
- the unique identifier to the download request.boolean deleteDownload(@Nullable com.brightcove.player.store.DownloadRequestSet requestSet)
requestSet
- the request set to be cancelled.boolean deleteDownload(@NonNull java.lang.Long requestSetKey)
requestSetKey
- the unique identifier to the download request.@NonNull DownloadStatus getDownloadStatus(@NonNull java.lang.Long requestSetKey)
requestSetKey
- the unique identifier to the download request.@NonNull DownloadStatus getDownloadStatus(@Nullable com.brightcove.player.store.DownloadRequestSet requestSet)
requestSet
- reference to the download request set.