Download Class

open class Download : Codable

Download

Public

  • Download identifier.

    Declaration

    Swift

    public let uuid: String
  • Source playback configuration used to create this download.

    Declaration

    Swift

    public let playerConfiguration: PlayerConfiguration
  • Creation timestamp.

    Declaration

    Swift

    public let startDate: TimeInterval
  • User-visible title associated with this download.

    Declaration

    Swift

    public var title: String
  • Relative local storage path.

    Declaration

    Swift

    public var localRelativePath: String?
  • User metadata attached to this download.

    Declaration

    Swift

    public var userMeta: [String : String]?
  • Resume data blob used to continue interrupted transfers.

    Declaration

    Swift

    public var resumeData: Data?
  • Redirect-resolved remote URL, when applicable.

    Declaration

    Swift

    public var redirectedUrl: URL?
  • Additional request headers used by download operations.

    Declaration

    Swift

    public var headers: [String : String]?
  • Whether download requests may use cellular transport.

    Declaration

    Swift

    public var allowCellularAccess: Bool
  • Whether I-frame/trickplay tracks should be excluded.

    Declaration

    Swift

    public var filterIFrameTracks: Bool
  • Track model associated with this download.

    Declaration

    Swift

    public var tracks: [Track]?

only for DASH streams

  • Selected video renditions for download.

    Declaration

    Swift

    public private(set) var selectedVideoRenditions: [VideoRendition] { get }
  • Selected audio renditions for download.

    Declaration

    Swift

    public private(set) var selectedAudioRenditions: [Rendition] { get }
  • Selected text tracks for download.

    Declaration

    Swift

    public private(set) var selectedTextTracks: [TextTrack] { get }
  • 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]
  • 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?
  • 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?
  • Local download URL.

    Declaration

    Swift

    public var localUrl: URL? { get }
  • Current download lifecycle state.

    Declaration

    Swift

    public var state: DownloadState { get set }
  • Current immutable progress snapshot.

    Declaration

    Swift

    public var progress: DownloadProgress { get set }
  • Delegate receiving state/progress callbacks.

    Declaration

    Swift

    public var delegate: DownloadDelegate? { get set }
  • Returns true when download is completed.

    Declaration

    Swift

    public var isCompleted: Bool { get }
  • Convenience view of video tracks.

    Declaration

    Swift

    public var videoTracks: [VideoTrack] { get }
  • Convenience view of audio tracks.

    Declaration

    Swift

    public var audioTracks: [AudioTrack] { get }
  • Convenience view of text tracks.

    Declaration

    Swift

    public var textTracks: [TextTrack] { get }
  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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

  • Declaration

    Swift

    public required init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws