Adaptive Media Player

AmpDownloader Docs

AmpDownloaderDelegate

@objc
public protocol AmpDownloaderDelegate

Protocol used to receive download events.

  • Callback triggered when a download started.

    Declaration

    Swift

    @objc
    optional func downloadStarted(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.

  • Callback triggered when a download is paused.

    Declaration

    Swift

    @objc
    optional func downloadPaused(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.

  • Callback triggered when a download is resumed.

    Declaration

    Swift

    @objc
    optional func downloadResumed(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.

  • Callback triggered when a download is completed.

    Declaration

    Swift

    @objc
    optional func downloadCompleted(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.

  • Callback triggered when a download is cancelled.

    Declaration

    Swift

    @objc
    optional func downloadCancelled(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.

  • Callback triggered when a download is deleted.

    Declaration

    Swift

    @objc
    optional func downloadDeleted(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.

  • Callback triggered when the progress of the download is changing.

    Declaration

    Swift

    @objc
    optional func downloadProgressChanged(asset: AmpDownload, progress: Float)

    Parameters

    asset

    Instance of the asset download that sends the event.

    progress

    The progress of the download.

  • Callback triggered when the download media option are loaded.

    Declaration

    Swift

    @objc
    optional func downloadStateChanged(asset: AmpDownload, mediaOption: String)

    Parameters

    asset

    Instance of the asset download that sends the event.

    mediaOption

    The media option.

  • Callback triggered when the download failed or update the persistable content key failed.

    Declaration

    Swift

    @objc
    optional func downloadFailed(asset: AmpDownload?, error: Error, message: String)

    Parameters

    asset

    Instance of the asset download that sends the event.

    error

    The download error.

    message

    The error message.

  • Callback triggered when there is a successful result of update the persistable content key.

    Declaration

    Swift

    @objc
    optional func updatePersistableContentKeyCompleted(asset: AmpDownload)

    Parameters

    asset

    Instance of the asset download that sends the event.