# DownloadProgress Class

    public class DownloadProgress : Codable

MediaDownloadProgress

### Lifecycle

- `init(expectedContentDuration:downloadedContentDuration:expectedContentSize:downloadedContentSize:averageDownloadBitrate:)`

  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

- `expectedContentDuration`

  Total expected media duration in seconds, if known.

  #### Declaration

  Swift

      public let expectedContentDuration: TimeInterval?

- `downloadedContentDuration`

  Total downloaded media duration in seconds, if known.

  #### Declaration

  Swift

      public let downloadedContentDuration: TimeInterval?

- `expectedContentSize`

  Total expected media size in bytes, if known.

  #### Declaration

  Swift

      public let expectedContentSize: Float?

- `downloadedContentSize`

  Downloaded media size in bytes, if known.

  #### Declaration

  Swift

      public let downloadedContentSize: Float?

- `averageDownloadBitrate`

  Rolling average download bitrate in bits per second, if known.

  #### Declaration

  Swift

      public let averageDownloadBitrate: Int64?

- `percent`

  Download completion ratio expressed as a percentage in range `[0, 100]`.

  #### Declaration

  Swift

      public var percent: Double { get }

- `copy(withExpectedDuration:)`

  Returns a copy with updated expected duration.

  #### Declaration

  Swift

      public func copy(withExpectedDuration: TimeInterval) -> DownloadProgress

- `copy(withDownloadedDuration:)`

  Returns a copy with updated downloaded duration.

  #### Declaration

  Swift

      public func copy(withDownloadedDuration: TimeInterval) -> DownloadProgress

- `copy(withExpectedContentSize:)`

  Returns a copy with updated expected content size.

  #### Declaration

  Swift

      public func copy(withExpectedContentSize: Float) -> DownloadProgress

- `copy(withDownloadedContentSize:)`

  Returns a copy with updated downloaded content size.

  #### Declaration

  Swift

      public func copy(withDownloadedContentSize: Float) -> DownloadProgress

- `copy(withAverageBitRate:)`

  Returns a copy with updated average bitrate.

  #### Declaration

  Swift

      public func copy(withAverageBitRate: Int64) -> DownloadProgress