CachingParameters
@objc(THEOplayerCachingParameters)
public class CachingParameters : NSObject, Codable
The configuration of a caching task.
-
The expiration date for the cached data.
Remark
Has to be in the future. Data will remain in the cache until at least the provided date if enough disk space is available. The default expiration date is 30 minutes from the start of the caching task.Declaration
Swift
@objc public var expirationDate: Date
-
An approximation of the desired bandwidth, defaults to the highest bandwidth possible.
Remark
This will take the quality with the lowest bandwidth that is higher than the specified bandwidth in bits per second.Declaration
Swift
public var bandwidth: Int?
-
An indication of caching data only on WIFI or on cellular data too. Defaults to true.
Remark
Remark:
- The value can not be changed on a scheduled asset.
- If the download is scheduled/started on WIFI-only mode and suddenly we would like allow Cellular Network download too, the
CachingTask
has to be removed and scheduled again with the newCachingParamaters
Since
v4.9.0
Declaration
Swift
@objc public var allowsCellularAccess: Bool
-
An indication of preferred tracks to be used for offline playback.
Since
v5.0.0
Remark
Remark:
- The preferred tracks by the manifest (or the system) will be always cached.
- This parameter gives an opportunity to specify additional tracks (audio and text tracks) to be saved during caching.
- Use
CachingParametersTrackSelectionBuilder
to create an instance.
Declaration
Swift
@objc public var preferredTrackSelection: CachingParametersTrackSelection
-
The network configuration of the caching task.
Declaration
Swift
@objc public var network: NetworkConfiguration?
-
Constructs a
CachingParameters
.Declaration
Swift
public init(expirationDate: Date, bandwidth: Int? = nil)
Parameters
expirationDate
The expiration date of the cached data.
bandwidth
The upper bandwidth limit of the quality to cache.