# Download Class

    open class Download : Codable

Download

### Public

- `uuid`

  Download identifier.

  #### Declaration

  Swift

      public let uuid: String

- `playerConfiguration`

  Source playback configuration used to create this download.

  #### Declaration

  Swift

      public let playerConfiguration: PlayerConfiguration

- `startDate`

  Creation timestamp.

  #### Declaration

  Swift

      public let startDate: TimeInterval

- `title`

  User-visible title associated with this download.

  #### Declaration

  Swift

      public var title: String

- `localRelativePath`

  Relative local storage path.

  #### Declaration

  Swift

      public var localRelativePath: String?

- `userMeta`

  User metadata attached to this download.

  #### Declaration

  Swift

      public var userMeta: [String : String]?

- `resumeData`

  Resume data blob used to continue interrupted transfers.

  #### Declaration

  Swift

      public var resumeData: Data?

- `redirectedUrl`

  Redirect-resolved remote URL, when applicable.

  #### Declaration

  Swift

      public var redirectedUrl: URL?

- `headers`

  Additional request headers used by download operations.

  #### Declaration

  Swift

      public var headers: [String : String]?

- `allowCellularAccess`

  Whether download requests may use cellular transport.

  #### Declaration

  Swift

      public var allowCellularAccess: Bool

- `filterIFrameTracks`

  Whether I-frame/trickplay tracks should be excluded.

  #### Declaration

  Swift

      public var filterIFrameTracks: Bool

- `tracks`

  Track model associated with this download.

  #### Declaration

  Swift

      public var tracks: [Track]?

### only for DASH streams

- `selectedVideoRenditions`

  Selected video renditions for download.

  #### Declaration

  Swift

      public private(set) var selectedVideoRenditions: [VideoRendition] { get }

- `selectedAudioRenditions`

  Selected audio renditions for download.

  #### Declaration

  Swift

      public private(set) var selectedAudioRenditions: [Rendition] { get }

- `selectedTextTracks`

  Selected text tracks for download.

  #### Declaration

  Swift

      public private(set) var selectedTextTracks: [TextTrack] { get }

- `fairplayKeyURIs`

  TODO: Merge this in drm config above? we collect here all the key URIs found in the attribute URI of EXT-X-KEY and EXT-X-SESSION-KEY

  #### Declaration

  Swift

      public var fairplayKeyURIs: [String]

- `preferredBitrate`

  Set your preferred video bitrate to be downloaded.

  The lowest media bitrate greater than or equal to this value will be selected for download. If no suitable media bitrate is found, the highest media bitrate will be selected.

  Remark

  Value is expressed in bps.

  Remark

  Only for HLS streams.

  #### Declaration

  Swift

      public var preferredBitrate: Int?

- `averageBitrate`

  Download average bitrate read from main playlist If present in the playlist, will be used for download size estimation in bytes. Otherwise the peak bitrate will be used for calculations.

  Remark

  Value is expressed in bps.

  Remark

  Only for HLS streams.

  #### Declaration

  Swift

      public var averageBitrate: Int?

- `localUrl`

  Local download URL.

  #### Declaration

  Swift

      public var localUrl: URL? { get }

- `state`

  Current download lifecycle state.

  #### Declaration

  Swift

      public var state: DownloadState { get set }

- `progress`

  Current immutable progress snapshot.

  #### Declaration

  Swift

      public var progress: DownloadProgress { get set }

- `delegate`

  Delegate receiving state/progress callbacks.

  #### Declaration

  Swift

      public var delegate: DownloadDelegate? { get set }

- `isCompleted`

  Returns `true` when download is completed.

  #### Declaration

  Swift

      public var isCompleted: Bool { get }

- `videoTracks`

  Convenience view of video tracks.

  #### Declaration

  Swift

      public var videoTracks: [VideoTrack] { get }

- `audioTracks`

  Convenience view of audio tracks.

  #### Declaration

  Swift

      public var audioTracks: [AudioTrack] { get }

- `textTracks`

  Convenience view of text tracks.

  #### Declaration

  Swift

      public var textTracks: [TextTrack] { get }

- `selectVideoRendition(_:)`

  Selects a video rendition for download.

  #### Declaration

  Swift

      public func selectVideoRendition(_ rendition: VideoRendition) -> Bool

  #### Return Value

  `true` when rendition belongs to a known video track.

- `unselectVideoRendition(_:)`

  Unselects a video rendition for download.

  #### Declaration

  Swift

      public func unselectVideoRendition(_ rendition: VideoRendition) -> Bool

  #### Return Value

  `true` when rendition belongs to a known video track.

- `selectAudioRendition(_:)`

  Selects an audio rendition for download.

  #### Declaration

  Swift

      public func selectAudioRendition(_ rendition: AudioRendition) -> Bool

  #### Return Value

  `true` when rendition belongs to a known audio track.

- `unselectAudioRendition(_:)`

  Unselects an audio rendition for download.

  #### Declaration

  Swift

      public func unselectAudioRendition(_ rendition: AudioRendition) -> Bool

  #### Return Value

  `true` when rendition belongs to a known audio track.

- `selectTextTrack(_:)`

  Selects a text track for download.

  #### Declaration

  Swift

      public func selectTextTrack(_ track: TextTrack) -> Bool

  #### Return Value

  `true` when track belongs to the known text-track set.

- `unselectTextTrack(_:)`

  Unselects a text track for download.

  #### Declaration

  Swift

      public func unselectTextTrack(_ track: TextTrack) -> Bool

  #### Return Value

  `true` when track belongs to the known text-track set.

### Private

- `init(from:)`

  #### Declaration

  Swift

      public required init(from decoder: Decoder) throws

- `encode(to:)`

  #### Declaration

  Swift

      public func encode(to encoder: Encoder) throws