OTVPersistenceManager
final public class OTVPersistenceManager : NSObject
OTVPersistenceManager
is a singleton that manages all download related functionality.
It utilises OTVDownloadingAssetManager
for outstanding downloads and OTVAssetsManager
for completed downloads.
-
Persistence Manager singleton instance.
Declaration
Swift
@objc public static let shared: OTVPersistenceManager
-
Declaration
Swift
@objc(startDownloadWithUrlAsset:title:licenseDelegate:artwork:options:) public func startDownload(urlAsset: AVURLAsset, title: String, licenseDelegate: OTVLicenseDelegate?, artwork: Data?, options: [String : Any]? = nil) -> OTVPersistenceAsset?
-
Declaration
Swift
@objc(prepareDownloadWithUrl:title:) public func prepareDownload(url: URL, title: String) -> OTVPersistenceAsset
-
Declaration
Swift
@objc(startDownloadWithAsset:artwork:options:avMediaSelectionOptions:) public func startDownload(asset: OTVPersistenceAsset, artwork: Data?, options: [String : Any]? = nil, avMediaSelectionOptions: [AVMediaSelection]? = nil) -> Bool
-
Declaration
Swift
@objc(startDownloadWithAsset:artwork:options:) public func startDownload(asset: OTVPersistenceAsset, artwork: Data?, options: [String : Any]? = nil) -> Bool
-
Return downloading and downloaded assets.
Declaration
Swift
@objc public func getDownloads() -> [OTVPersistenceAsset]?
-
Pause the downloading of assigned asset.
Declaration
Swift
@objc public func pauseDownload(asset: OTVPersistenceAsset) -> Bool
Parameters
asset
the asset to be paused.
-
Resume the paused downloading asset.
Declaration
Swift
@objc public func resumeDownload(asset: OTVPersistenceAsset) -> Bool
Parameters
asset
the asset to be resumed.
-
Cancel or remove the asset.
Declaration
Swift
@objc public func deleteDownload(asset: OTVPersistenceAsset) -> Bool
Parameters
asset
the asset to be cancelled or removed.
-
Extends
See moreOTVPersistenceManager
to define a number of values to use as keys in dictionary options.Declaration
Swift
public struct Keys
-
Declaration
Swift
@objc public func totalDiskSpaceInBytes() -> Int64
-
Declaration
Swift
@objc public func freeDiskSpaceInBytes() -> Int64
-
Declaration
Swift
@objc public func usedDiskSpaceInBytes() -> Int64