public protocol DownloaderAPI
Downloader Interface.
public protocol DownloaderAPI
Downloader Interface.
createDownload(_:headers:allowCellularAccess:)
Default implementation
Creates a download for a given player configuration.
Player Configuration is verified in the prepare
method
Swift
func createDownload(
_ config: PlayerConfiguration,
headers: [String: String],
allowCellularAccess: Bool
) -> Download
config
|
Player configuration. |
headers
|
List of request headers. |
allowCellularAccess
|
|
Prepare a single download metadata and track model. The model contains video qualities, audio tracks, and subtitle tracks and implementations need to select which of these tracks should be downloaded.
Swift
func prepareDownload(
_ downloadId: String,
completion: @escaping (Download?, PRESTOError?) -> Void
)
downloadId
|
Download identifier. |
completion
|
Called on completion. |
Starts a given download.
Swift
func startDownload(
_ downloadId: String,
delegate: DownloadDelegate?
) -> PRESTOError?
downloadId
|
Download identifier. |
delegate
|
Download delegate. |
The error that can occur when pausing the download of the given downloadId
.
Pause a download.
Swift
func pauseDownload(
_ downloadId: String
) -> PRESTOError?
downloadId
|
Download identifier. |
The error that can occur when pausing the download of the given downloadId
.
Resume a download.
Swift
func resumeDownload(
_ downloadId: String
) -> PRESTOError?
downloadId
|
Download identifier. |
The error that can occur when resuming the download of the given downloadId
.
Stops the download progress but keep the content and the reference in the history.
Swift
func cancelDownload(
_ downloadId: String
) -> PRESTOError?
id
|
Download identifier. |
The error that can occur when cancelling the download of the given downloadId
.
Cancel the download and remove any content and reference from the history.
Swift
func removeDownload(
_ downloadId: String
) -> PRESTOError?
id
|
Download identifier. |
The error that can occur when removing downloaded content
for the given downloadId
.
Get list of ongoing and completed downloads.
Swift
func getDownloads() -> [Download]
list of downloads