OfflineManager
@objcMembers
@objc(BMPOfflineManager)
public class OfflineManager : NSObject
-
Value in megabytes for minimum system free space available before suspending active downloads. Default is
500.Declaration
Swift
public static var minimumAvailableSpaceThreshold: UInt -
Indicates if the
OfflineManageris initialized.Declaration
Swift
public static var isOfflineManagerInitialized: Bool { get } -
Specifies if an active WiFi connection is required for downloading media for offline playback. Default is
false.Declaration
Swift
public var restrictMediaDownloadsToWiFi: Bool { get set } -
Indicates if the
OfflineManagerhas finished restoring suspended downloads.Any
resumeorcancelactions triggered before this returnstrueare not guaranteed and might result in unexpected behaviour.Declaration
Swift
public private(set) var areSuspendedDownloadsRestored: Bool { get } -
The delegate for the
OfflineManagerDeclaration
Swift
public weak var delegate: OfflineManagerDelegate? -
The singleton instance of the
OfflineManager.Declaration
Swift
public static func sharedInstance() -> OfflineManager -
Has to be called in your
AppDelegate‘sapplication(application:didFinishLaunchingWithOptions:)method to initialize handling of offline content.If the shared instance is already initialized, this method will not have any effect.
Declaration
Swift
public static func initializeOfflineManager() -
Has to be called in your
AppDelegate‘sapplication(application:didFinishLaunchingWithOptions:)method to initialize handling of offline content.Initializes the shared instance with a given
OfflineConfig. If the shared instance is already initialized, this method will not have any effect.Declaration
Swift
public static func initializeOfflineManager(offlineConfig: OfflineConfig)Parameters
offlineConfigThe
OfflineConfig -
Returns an
OfflineContentManagerinstance which can be used to manage offline content and offline DRM related tasks for the providedSourceConfig.The instance returned by this method will always be the same for the same
SourceConfig.This method will throw an error in case a
SourceConfigis passed that is not supported for being downloaded. ASourceConfigis only valid for download when it’s configured using an HLS asset.Declaration
Swift
@objc(offlineContentManagerForSourceConfig:error:) public func offlineContentManager(for sourceConfig: SourceConfig) throws -> OfflineContentManagerParameters
sourceConfigA
SourceConfigfor which theOfflineContentMangeris requested.Return Value
OfflineContentManagerinstance for the providedSourceConfig -
Returns an
OfflineContentManagerinstance which can be used to manage offline content and offline DRM related tasks for the providedSourceConfig.The provided
identifierwill be used to create a folder containing needed resources for the offline content.The instance returned by this method will always be the same for the same
identifier.This method will throw an error in case a
SourceConfigis passed that is not supported for being downloaded. ASourceConfigis only valid for download when it’s configured using an HLS asset.If an
OfflineContentManageris acquired using this method, subsequent calls to any content related API on theOfflineManagerare not supported, meaning they could result in unexpected behaviour.Declaration
Swift
@objc(offlineContentManagerForSourceConfig:identifier:error:) public func offlineContentManager( for sourceConfig: SourceConfig, id identifier: String ) throws -> OfflineContentManagerParameters
forA
SourceConfigfor which theOfflineContentMangeris requested.idA unique identifier for the given
SourceConfigwhich must not change once provided.Return Value
OfflineContentManager
instance for the providedSourceConfig` -
Has to be called in your
AppDelegate‘sapplication(application:didFinishLaunchingWithOptions:)Needs to be called from the main thread.
Declaration
Swift
@objc(addCompletionHandler:forIdentifier:) public func add(completionHandler: @escaping () -> Void, for identifier: String)Parameters
completionHandlerThe completion handler which is provided by the system.
forThe identifier which is provided by the system.
OfflineManager Class Reference