public class DownloadProgress : Codable
MediaDownloadProgress
public class DownloadProgress : Codable
MediaDownloadProgress
init(expectedContentDuration:downloadedContentDuration:expectedContentSize:downloadedContentSize:averageDownloadBitrate:)
Creates an immutable download-progress snapshot.
Swift
public init(
expectedContentDuration: TimeInterval?,
downloadedContentDuration: TimeInterval?,
expectedContentSize: Float?,
downloadedContentSize: Float?,
averageDownloadBitrate: Int64?
)
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. |
Total expected media duration in seconds, if known.
Swift
public let expectedContentDuration: TimeInterval?
Total downloaded media duration in seconds, if known.
Swift
public let downloadedContentDuration: TimeInterval?
Total expected media size in bytes, if known.
Swift
public let expectedContentSize: Float?
Downloaded media size in bytes, if known.
Swift
public let downloadedContentSize: Float?
Rolling average download bitrate in bits per second, if known.
Swift
public let averageDownloadBitrate: Int64?
Download completion ratio expressed as a percentage in range [0, 100].
Swift
public var percent: Double { get }
Returns a copy with updated expected duration.
Swift
public func copy(withExpectedDuration: TimeInterval) -> DownloadProgress
Returns a copy with updated downloaded duration.
Swift
public func copy(withDownloadedDuration: TimeInterval) -> DownloadProgress
Returns a copy with updated expected content size.
Swift
public func copy(withExpectedContentSize: Float) -> DownloadProgress
Returns a copy with updated downloaded content size.
Swift
public func copy(withDownloadedContentSize: Float) -> DownloadProgress
Returns a copy with updated average bitrate.
Swift
public func copy(withAverageBitRate: Int64) -> DownloadProgress