OfflineManagerListener
@available(*, deprecated, message: "Use OfflineContentManagerListener instead")
@objc(BMPOfflineManagerListener)
public protocol OfflineManagerListener : NSObjectProtocol
Protocol for listeners for the OfflineManager.
-
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
OfflineManager.offlineState(for:)and then taking one of the actions allowed in the current state as documented in OfflineManager.hDeclaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener.onOfflineError(_:offlineContentManager:﹚ instead") @objc optional func offlineManager(_ offlineManager: OfflineManager, didFailWithError error: Error?)Parameters
offlineManagerThe
OfflineManagercalling the listener.errorAn optional error object describing the cause of the failure.
-
Is called when the download of the media content was successful.
Declaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener.onContentDownloadFinished(_:offlineContentManager:﹚ instead") @objc optional func offlineManagerDidFinishDownload(_ offlineManager: OfflineManager)Parameters
offlineManagerThe
OfflineManagercalling the listener. -
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
@available(*, deprecated, message: "Use OfflineContentManagerListener.onContentDownloadProgressChanged(_:offlineContentManager:﹚ instead") @objc optional func offlineManager(_ offlineManager: OfflineManager, didProgressTo progress: Double)Parameters
offlineManagerThe
OfflineManagercalling the listener.progressThe percentage of completion for the current download task.
-
Is called when the download of the media content was suspended. This could be the result of a call to
OfflineManager.suspendDownloadForSourceConfig: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
@available(*, deprecated, message: "Use OfflineContentManagerListener.onContentDownloadSuspended(_:offlineContentManager:﹚ instead") @objc optional func offlineManagerDidSuspendDownload(_ offlineManager: OfflineManager)Parameters
offlineManagerThe
OfflineManagercalling the listener. -
Is called when the download of the media content was resumed after it was suspended.
Declaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener.onContentDownloadResumed(_:offlineContentManager:﹚ instead") @objc optional func offlineManager(_ offlineManager: OfflineManager, didResumeDownloadWithProgress progress: Double)Parameters
offlineManagerThe
OfflineManagercalling the listener.progressThe percentage of completion for the current download task.
-
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
@available(*, deprecated, message: "Use OfflineContentManagerListener.onContentDownloadCanceled(_:offlineContentManager:﹚ instead") @objc optional func offlineManagerDidCancelDownload(_ offlineManager: OfflineManager)Parameters
offlineManagerThe
OfflineManagercalling the listener. -
Is called when the offline license was successfully renewed and written to disk.
Declaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener.onOfflineContentLicenseRenewed(_:offlineContentManager:﹚ instead") @objc optional func offlineManagerDidRenewOfflineLicense(_ offlineManager: OfflineManager)Parameters
offlineManagerThe
OfflineManagercalling the listener. -
Is called on every call to
OfflineManager.createOfflineSourceConfig(restrictedToAssetCache:)if it is DRM protected and the offline DRM license has expired.Declaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener.onOfflineContentLicenseExpired(_:offlineContentManager:﹚ instead") @objc optional func offlineManagerOfflineLicenseDidExpire(_ offlineManager: OfflineManager)Parameters
offlineManagerThe
OfflineManagercalling the listener. -
Is called when information on available tracks is available.
Declaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener.onAvailableTracksFetched(_:offlineContentManager:﹚ instead") @objc optional func offlineManager( _ offlineManager: OfflineManager, didFetchAvailableTracks tracks: OfflineTrackSelection )Parameters
offlineManagerThe
OfflineManagercalling the listener.tracksThe available
OfflineTrackSelection.
OfflineManagerListener Protocol Reference