OfflineContentManagerListener

@objc(BMPOfflineContentManagerListener)
public protocol OfflineContentManagerListener : NSObjectProtocol

Protocol for listeners for the OfflineContentManager.

  • Is called when the download of the media content failed. Downloaded content may have been stored to disk. It is possible to retry the download by first checking the state of the source config using OfflineContentManager.offlineState and then taking one of the actions allowed in the current state as documented in OfflineContentManager.h

    Declaration

    Swift

    @objc
    optional func onOfflineError(
        _ event: OfflineErrorEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when the download of the media content was successful.

    Declaration

    Swift

    @objc
    optional func onContentDownloadFinished(
        _ event: ContentDownloadFinishedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when the download of the media content progressed to a new percentage value. The method is only called when the according SourceConfig is in state OfflineStateDownloading.

    Declaration

    Swift

    @objc
    optional func onContentDownloadProgressChanged(
        _ event: ContentDownloadProgressChangedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when the download of the media content was suspended. This could be the result of a call to OfflineContentManager.suspendDownload() or if the app was terminated by the user while downloads were running. In the latter case, this listener method is called upon first application startup after termination.

    Declaration

    Swift

    @objc
    optional func onContentDownloadSuspended(
        _ event: ContentDownloadSuspendedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when the download of the media content was resumed after it was suspended.

    Declaration

    Swift

    @objc
    optional func onContentDownloadResumed(
        _ event: ContentDownloadResumedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when the download of the media content was cancelled by the user and all partially downloaded content has been deleted from disk.

    Declaration

    Swift

    @objc
    optional func onContentDownloadCanceled(
        _ event: ContentDownloadCanceledEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when the offline license was successfully renewed and written to disk.

    Declaration

    Swift

    @objc
    optional func onOfflineContentLicenseRenewed(
        _ event: OfflineContentLicenseRenewedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called on every call to OfflineContentManager.createOfflineSourceConfig(restrictedToAssetCache:) if it is DRM protected and the offline DRM license has expired.

    Declaration

    Swift

    @objc
    optional func onOfflineContentLicenseExpired(
        _ event: OfflineContentLicenseExpiredEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when information on available tracks is available.

    Declaration

    Swift

    @objc
    optional func onAvailableTracksFetched(
        _ event: AvailableTracksFetchedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called when content migration triggered via OfflineContentManager.tweaks.migrateDownload(remoteAssetUrl:resourceIdentifierCallback:) has finished.

    Declaration

    Swift

    @objc
    optional func onContentUrlMigrationFinished(
        _ event: ContentUrlMigrationFinishedEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    An object holding specific event data.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event

  • Is called for each occurring offline event.

    Declaration

    Swift

    @objc
    optional func onEvent(
        _ event: OfflineEvent,
        offlineContentManager: OfflineContentManager
    )

    Parameters

    event

    The offline event. Use event.name or event.isKind(of:) to check the specific event type.

    offlineContentManager

    The OfflineContentManager which is associated with the emitted event.