DownloadProgress Class

public class DownloadProgress : Codable

MediaDownloadProgress

Lifecycle

  • Creates an immutable download-progress snapshot.

    Declaration

    Swift

    public init(
        expectedContentDuration: TimeInterval?,
        downloadedContentDuration: TimeInterval?,
        expectedContentSize: Float?,
        downloadedContentSize: Float?,
        averageDownloadBitrate: Int64?
    )

    Parameters

    expectedContentDuration

    Expected total media duration in seconds.

    downloadedContentDuration

    Downloaded media duration in seconds.

    expectedContentSize

    Expected total payload size in bytes.

    downloadedContentSize

    Downloaded payload size in bytes.

    averageDownloadBitrate

    Average transfer bitrate in bits per second.

Public

  • Total expected media duration in seconds, if known.

    Declaration

    Swift

    public let expectedContentDuration: TimeInterval?
  • Total downloaded media duration in seconds, if known.

    Declaration

    Swift

    public let downloadedContentDuration: TimeInterval?
  • Total expected media size in bytes, if known.

    Declaration

    Swift

    public let expectedContentSize: Float?
  • Downloaded media size in bytes, if known.

    Declaration

    Swift

    public let downloadedContentSize: Float?
  • Rolling average download bitrate in bits per second, if known.

    Declaration

    Swift

    public let averageDownloadBitrate: Int64?
  • Download completion ratio expressed as a percentage in range [0, 100].

    Declaration

    Swift

    public var percent: Double { get }
  • Returns a copy with updated expected duration.

    Declaration

    Swift

    public func copy(withExpectedDuration: TimeInterval) -> DownloadProgress
  • Returns a copy with updated downloaded duration.

    Declaration

    Swift

    public func copy(withDownloadedDuration: TimeInterval) -> DownloadProgress
  • Returns a copy with updated expected content size.

    Declaration

    Swift

    public func copy(withExpectedContentSize: Float) -> DownloadProgress
  • Returns a copy with updated downloaded content size.

    Declaration

    Swift

    public func copy(withDownloadedContentSize: Float) -> DownloadProgress
  • Returns a copy with updated average bitrate.

    Declaration

    Swift

    public func copy(withAverageBitRate: Int64) -> DownloadProgress