BMPOfflineManagerListener
Objective-C
@protocol BMPOfflineManagerListener <NSObject>
Swift
protocol OfflineManagerListener : NSObjectProtocol
Protocol for listeners for the BMPOfflineManager.
-
Is called when the download of the media content failed for some reason. Downloaded content may have been stored to disk. It is possible to retry by first checking the state of the sourceItem (BMPOfflineManager#offlineStateForSourceItem:) and taking the appropriate actions which are allowed in the current state as documented in BMPOfflineManager.h
Declaration
Objective-C
- (void)offlineManager:(nonnull BMPOfflineManager *)offlineManager didFailWithError:(nullable NSError *)error;
Swift
func offlineManager(_ offlineManager: BMPOfflineManager, didFailWithError error: Error?)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
error
An optional error object describing the cause of the failure.
-
Is called when the download of the media content was successful, and everything is written to disk.
Declaration
Objective-C
- (void)offlineManagerDidFinishDownload: (nonnull BMPOfflineManager *)offlineManager;
Swift
func offlineManagerDidFinishDownload(_ offlineManager: BMPOfflineManager)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
-
Is called then the download of the media content progressed to a new percentage value. The method is only called when the according SourceItem is in state BMPOfflineStateDownloading.
Declaration
Objective-C
- (void)offlineManager:(nonnull BMPOfflineManager *)offlineManager didProgressTo:(double)progress;
Swift
func offlineManager(_ offlineManager: BMPOfflineManager, didProgressTo progress: Double)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
progress
The 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 BMPOfflineManager#suspendDownloadForSourceItem: 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
Objective-C
- (void)offlineManagerDidSuspendDownload: (nonnull BMPOfflineManager *)offlineManager;
Swift
func offlineManagerDidSuspendDownload(_ offlineManager: BMPOfflineManager)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
-
Is called when the download of the media content was resumed after it was suspended.
Declaration
Objective-C
- (void)offlineManager:(nonnull BMPOfflineManager *)offlineManager didResumeDownloadWithProgress:(double)progress;
Swift
func offlineManager(_ offlineManager: BMPOfflineManager, didResumeDownloadWithProgress progress: Double)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
progress
The 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
Objective-C
- (void)offlineManagerDidCancelDownload: (nonnull BMPOfflineManager *)offlineManager;
Swift
func offlineManagerDidCancelDownload(_ offlineManager: BMPOfflineManager)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
-
Is called when the offline license was successfully renewed and written to disk.
Declaration
Objective-C
- (void)offlineManagerDidRenewOfflineLicense: (nonnull BMPOfflineManager *)offlineManager;
Swift
func offlineManagerDidRenewOfflineLicense(_ offlineManager: BMPOfflineManager)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
-
Is called under following circumstances if and only if the offline DRM license has expired:
- The OfflineManager first access a DRM protected SourceItem.
- On every call to createOfflineSourceItemForSourceItem: if it is DRM protected.
NOTE: This method is only available starting with iOS 11.0
Declaration
Objective-C
- (void)offlineManagerOfflineLicenseDidExpire: (nonnull BMPOfflineManager *)offlineManager;
Swift
func offlineManagerOfflineLicenseDidExpire(_ offlineManager: BMPOfflineManager)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
-
Is called when information on available tracks is available.
Declaration
Objective-C
- (void)offlineManager:(nonnull BMPOfflineManager *)offlineManager didFetchAvailableTracks:(nonnull BMPOfflineTrackSelection *)tracks;
Swift
optional func offlineManager(_ offlineManager: BMPOfflineManager, didFetchAvailableTracks tracks: OfflineTrackSelection)
Parameters
offlineManager
The BMPOfflineManager calling the listener.
tracks
The available BMPOfflineTrackSelection.