CachingPlayerItemConfiguration

public struct CachingPlayerItemConfiguration

CachingPlayerItem global configuration.

  • How much data is downloaded in memory before stored on a file. Defaults to 15.MB.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `default` instance instead to set configuration values.")
    public static var downloadBufferLimit: Int { get set }
  • How much data is allowed to be read in memory at a time. Defaults to 10.MB.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `default` instance instead to set configuration values.")
    public static var readDataLimit: Int { get set }
  • Flag for deciding whether an error should be thrown when URLResponse’s expectedContentLength is not equal with the downloaded media file bytes count. Defaults to false.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `default` instance instead to set configuration values.")
    public static var shouldVerifyDownloadedFileSize: Bool { get set }
  • If set greater than 0, the set value with be compared with the downloaded media size. If the size of the downloaded media is lower, an error will be thrown. Useful when expectedContentLength is unavailable. Default value is 0.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `default` instance instead to set configuration values.")
    public static var minimumExpectedFileSize: Int { get set }
  • Flag for deciding whether an NSFileWriteOutOfSpaceError should be thrown when there is not enough available disk space left for caching the entire media file. Defaults to true.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `default` instance instead to set configuration values.")
    public static var shouldCheckAvailableDiskSpaceBeforeCaching: Bool { get set }
  • Log level. Defaults to none.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `default` instance instead to set configuration values.")
    public static var logLevel: LogLevel { get set }
  • The default configuration instance used for CachingPlayerItem instances.

    Default values:

    • downloadBufferLimit: 15 MB
    • readDataLimit: 10 MB
    • shouldVerifyDownloadedFileSize: false
    • minimumExpectedFileSize: 0
    • shouldCheckAvailableDiskSpaceBeforeCaching: true
    • logLevel: .none

    Declaration

    Swift

    public static var `default`: CachingPlayerItemConfiguration
  • How much data is downloaded in memory before stored on a file.

    Declaration

    Swift

    public let downloadBufferLimit: Int
  • How much data is allowed to be read in memory at a time.

    Declaration

    Swift

    public let readDataLimit: Int
  • Flag for deciding whether an error should be thrown when URLResponse’s expectedContentLength is not equal with the downloaded media file bytes count.

    Declaration

    Swift

    public let shouldVerifyDownloadedFileSize: Bool
  • If set greater than 0, the set value with be compared with the downloaded media size. If the size of the downloaded media is lower, an error will be thrown. Useful when expectedContentLength is unavailable.

    Declaration

    Swift

    public let minimumExpectedFileSize: Int
  • Flag for deciding whether an NSFileWriteOutOfSpaceError should be thrown when there is not enough available disk space left for caching the entire media file.

    Declaration

    Swift

    public let shouldCheckAvailableDiskSpaceBeforeCaching: Bool
  • Allows seeking into uncached parts of the media, downloading data temporarily.

    Declaration

    Swift

    public let allowsUncachedSeek: Bool
  • Log level.

    Declaration

    Swift

    public let logLevel: LogLevel
  • Creates a new configuration instance.

    Declaration

    Swift

    public init(
        downloadBufferLimit: Int = 15 * 1024 * 1024, // 15MB
        readDataLimit: Int = 10 * 1024 * 1024, // 10MB
        shouldVerifyDownloadedFileSize: Bool = false,
        minimumExpectedFileSize: Int = 0,
        shouldCheckAvailableDiskSpaceBeforeCaching: Bool = true,
        allowsUncachedSeek: Bool = true,
        logLevel: LogLevel = .none
    )

    Parameters

    downloadBufferLimit

    How much data is downloaded in memory before stored on a file. Defaults to 15 MB.

    readDataLimit

    How much data is allowed to be read in memory at a time. Defaults to 10 MB.

    shouldVerifyDownloadedFileSize

    Flag for deciding whether an error should be thrown when URLResponse’s expectedContentLength is not equal with the downloaded media file bytes count. Defaults to false.

    minimumExpectedFileSize

    If set greater than 0, the set value will be compared with the downloaded media size. If the size of the downloaded media is lower, an error will be thrown. Useful when expectedContentLength is unavailable. Defaults to 0.

    shouldCheckAvailableDiskSpaceBeforeCaching

    Flag for deciding whether an NSFileWriteOutOfSpaceError should be thrown when there is not enough available disk space left for caching the entire media file. Defaults to true.

    allowsUncachedSeek

    Allows seeking into uncached parts of the media, downloading data temporarily. Defaults to true.

    logLevel

    Log level. Defaults to .none.