Describes the configuration of a caching task.

interface CachingTaskParameters {
    allowsCellularAccess?: boolean;
    amount: string | number;
    bandwidth?: number;
    expirationDate?: Date;
    preferredTrackSelection?: CachingPreferredTrackSelection;
    storageType?: StorageType;
}

Properties

allowsCellularAccess?: boolean

An indication of whether the data should be cached on a cellular network, or only on WIFI. Defaults to true.

Platform

iOS

Remarks


- 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 new CachingParamaters.

amount: string | number

The amount of data to cache for the given stream.

Platform

Android
Web

Remarks


- On iOS this value will always be '100%'.

Possible formats:
- A number in seconds.
- A percentage string (XX%) for a proportion of the content duration.

bandwidth?: number

Upper bandwidth limit of the quality to cache.

Remarks


- This will take the quality with the highest bandwidth that is lower than the specified bandwidth.
- It should be a value between zero and infinity.

Default Value

Infinity
expirationDate?: Date

The expiration date of the cached data.

Remarks


- Must be a date in the future.
- Data might be removed by the browser if it runs out of disk space.

Default Value

30 minutes after starting the caching task.
preferredTrackSelection?: CachingPreferredTrackSelection

The preferred audio/text tracks to cache.

Platform

iOS
Android

Remarks


- By default, the first track will be picked.

storageType?: StorageType

The storage type to use for caching.

Default Value

[StorageType.MEDIA3]

Platform

Android