Adaptive Media Player

AmpDownloader Docs

AmpDownloadManager

public class AmpDownloadManager

Class in charge of managing the asset downloads.

  • Registers a new delegate to be able to receive notifications of the download events.

    Declaration

    Swift

    public static func registerDelegate(delegate: AmpDownloaderDelegate)

    Parameters

    delegate

    Instance of the delegate to register.

  • Removes a delegate.

    Declaration

    Swift

    public static func removeDelegate(delegate: AmpDownloaderDelegate)

    Parameters

    delegate

    Instance of the delegate to remove.

  • Gets the asset download list.

    Declaration

    Swift

    public static func getDownloadList() -> [AmpDownload]

    Return Value

    The download list.

  • Gets a downloaded asset.

    Declaration

    Swift

    public static func getDownload(playlist: String) -> AmpDownload?

    Parameters

    playlist

    The playlist url to search the asset.

    Return Value

    if the asset is found returns an AmpDownload object.

  • Starts a new asset download.

    Declaration

    Swift

    public static func startNewDownload(title: String, url: String, fairplayConfiguration: FairplayConfiguration? = nil, assetArtworkData: Data? = nil) -> AmpDownload?

    Parameters

    title

    The asset title.

    url

    The playlist url of the asset.

    fairplayConfiguration

    The FairplayConfiguration instance of the asset.

    assetArtworkData

    The asset artwork.

    Return Value

    An AmpDownload object.

  • Resumes a download task.

    Declaration

    Swift

    public static func resumeDownload(for asset: AmpDownload)

    Parameters

    asset

    The asset in download that will be resumed.

  • Pauses a download task.

    Declaration

    Swift

    public static func pauseDownload(for asset: AmpDownload)

    Parameters

    asset

    The asset in download that will be paused.

  • Deletes a download.

    Declaration

    Swift

    public static func deleteDownload(for asset: AmpDownload)

    Parameters

    asset

    The asset download that will be removed.

  • Cancels a download task.

    Declaration

    Swift

    public static func cancelDownload(for asset: AmpDownload)

    Parameters

    asset

    The asset in download that will be canceled.

  • Restores the download tasks.

    Declaration

    Swift

    public static func restoreDownloads()