Instance Method

makeAssetDownloadTask(asset:assetTitle:assetArtworkData:options:)

Creates and initializes an asset download task to be used with this download session.

Declaration

func makeAssetDownloadTask(asset URLAsset: AVURLAsset, assetTitle title: String, assetArtworkData artworkData: Data?, options: [String : Any]? = nil) -> AVAssetDownloadTask?

Parameters

URLAsset

The HTTP Live Streaming asset to download.

title

A human readable title for this asset in the user's preferred language. This value will be displayed in the usage pane of the Settings app.

artworkData

Optional artwork data for this asset. This value will be displayed in the usage pane of the Settings app.

options

Configures non-default behavior for the download task. Using this parameter is required for downloading non-default media selections for HLS assets.

Return Value

A new instance of AVAssetDownloadTask.

Discussion

This method may return nil if the AVAssetDownloadURLSession has been invalidated.

See Also

Creating a Download Task

let AVAssetDownloadTaskMinimumRequiredMediaBitrateKey: String

The key used by the options dictionary indicating the lowest media bitrate to be used that is greater than or equal to this value.

let AVAssetDownloadTaskMediaSelectionKey: String

The key used by the options dictionary indicating the media selection for a new download selection.

class AVAssetDownloadTask

A session used to download HTTP Live Streaming assets.

class AVAggregateAssetDownloadTask

A single task that downloads multiple media selections for a single asset.