### Swift Example Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Quick/README.md An example of how to write a QuickSpec using Swift, demonstrating describe, it, and context blocks with Nimble assertions. ```swift // Swift import Quick import Nimble class TableOfContentsSpec: QuickSpec { override class func spec() { describe("the 'Documentation' directory") { it("has everything you need to get started") { let sections = Directory("Documentation").sections expect(sections).to(contain("Organized Tests with Quick Examples and Example Groups")) expect(sections).to(contain("Installing Quick")) } context("if it doesn't have what you're looking for") { it("needs to be updated") { let you = You(awesome: true) expect{you.submittedAnIssue}.toEventually(beTruthy()) } } } } } ``` -------------------------------- ### CocoaPods Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Quick/README.md Instructions for installing Quick and Nimble using CocoaPods by adding them to the Podfile. ```ruby # Podfile use_frameworks! target "MyApp" do # Normal libraries target 'MyApp_Tests' do inherit! :search_paths pod 'Quick' pod 'Nimble' end end ``` -------------------------------- ### CocoaPods Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/index.html Instructions for installing CachingPlayerItem using CocoaPods. ```bash $ gem install cocoapods ``` ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' use_frameworks! target '' do pod 'CachingPlayerItem' end ``` -------------------------------- ### Swift Package Manager Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Quick/README.md Instructions for installing Quick and Nimble using Swift Package Manager by adding them to the Package.swift file. ```swift dependencies: [ .package(url: "https://github.com/Quick/Quick.git", from: "7.0.0"), .package(url: "https://github.com/Quick/Nimble.git", from: "12.0.0"), ], ``` -------------------------------- ### CocoaPods Podfile Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Nimble/README.md Example of adding Nimble to a CocoaPods Podfile. ```ruby platform :ios, '13.0' source 'https://github.com/CocoaPods/Specs.git' # Whatever pods you need for your app go here target 'YOUR_APP_NAME_HERE_Tests', :exclusive => true do use_frameworks! pod 'Nimble' end ``` -------------------------------- ### Swift Expectations Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Nimble/README.md Examples of using Nimble matchers in Swift. ```swift // Swift expect(1 + 1).to(equal(2)) expect(1.2).to(beCloseTo(1.1, within: 0.1)) expect(3) > 2 expect("seahorse").to(contain("sea")) expect(["Atlantic", "Pacific"]).toNot(contain("Mississippi")) expect(ocean.isClean).toEventually(beTruthy()) ``` -------------------------------- ### tvOS, Linux, and other platforms Usage Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/CwlMachBadInstructionHandler/README.md Example of catching a bad instruction on tvOS, Linux, and other platforms using the POSIX version of CwlPreconditionTesting. ```swift import CwlPosixPreconditionTesting let e = catchBadInstruction { precondition(false, "THIS PRECONDITION FAILURE IS EXPECTED") } ``` -------------------------------- ### Quick Start Usage Source: https://github.com/sukov/cachingplayeritem/blob/master/README.md Basic usage of CachingPlayerItem to play and cache a remote video URL. ```swift import UIKit import AVFoundation import CachingPlayerItem class ViewController: UIViewController { // You need to keep a strong reference to your player. var player: AVPlayer! override func viewDidLoad() { super.viewDidLoad() let url = URL(string: "https://random-url.com/video.mp4")! let playerItem = CachingPlayerItem(url: url) player = AVPlayer(playerItem: playerItem) player.automaticallyWaitsToMinimizeStalling = false player.play() } } ``` -------------------------------- ### Quick Start Usage Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/index.html Basic usage of CachingPlayerItem to play a remote video URL. ```swift import UIKit import AVFoundation import CachingPlayerItem class ViewController: UIViewController { // You need to keep a strong reference to your player. var player: AVPlayer! override func viewDidLoad() { super.viewDidLoad() let url = URL(string: "https://random-url.com/video.mp4")! let playerItem = CachingPlayerItem(url: url) player = AVPlayer(playerItem: playerItem) player.automaticallyWaitsToMinimizeStalling = false player.play() } } ``` -------------------------------- ### macOS and iOS Usage Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/CwlMachBadInstructionHandler/README.md Example of catching a bad instruction on macOS and iOS using CwlPreconditionTesting. ```swift import CwlPreconditionTesting let e = catchBadInstruction { precondition(false, "THIS PRECONDITION FAILURE IS EXPECTED") } ``` -------------------------------- ### Swift Package Manager Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/README.md Add CachingPlayerItem as a dependency in your Swift package. ```swift dependencies: [ .package(url: "https://github.com/sukov/CachingPlayerItem.git", upToNextMajor(from: "2.2.0")) ] ``` -------------------------------- ### Swift Package Manager Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/index.html Add CachingPlayerItem as a dependency in your Swift package. ```swift dependencies: [ .package(url: "https://github.com/sukov/CachingPlayerItem.git", upToNextMajor(from: "2.2.0")) ] ``` -------------------------------- ### CocoaPods Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/README.md Integrate CachingPlayerItem into your Xcode project using CocoaPods by specifying it in your Podfile. ```bash $ gem install cocoapods ``` ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' use_frameworks! target '' do pod 'CachingPlayerItem' end ``` -------------------------------- ### Carthage Cartfile.private Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Nimble/README.md Example of adding Nimble to a Cartfile.private for Carthage. ```plaintext github "Quick/Nimble" ~> 13.2 ``` -------------------------------- ### CocoaPods Installation Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/index.html Integrate CachingPlayerItem into your Xcode project using CocoaPods by specifying it in your Podfile. ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' use_frameworks! target '' do pod 'CachingPlayerItem' end ``` -------------------------------- ### Swift Package Manager - Package.swift Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/Nimble/README.md Example of adding Nimble as a dependency in Package.swift for Swift Package Manager. ```swift // swift-tools-version:5.7 import PackageDescription let package = Package( name: "MyAwesomeLibrary", products: [ // ... ], dependencies: [ // ... .package(url: "https://github.com/Quick/Nimble.git", from: "13.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "MyAwesomeLibrary", dependencies: ...), .testTarget( name: "MyAwesomeLibraryTests", dependencies: ["MyAwesomeLibrary", "Nimble"]) ] ) ``` -------------------------------- ### Initializer Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Structs/CachingPlayerItemConfiguration.html Creates a new configuration instance with default values. ```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 ) ``` -------------------------------- ### Initializer for playing from a file path Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem with a local file path, an optional file extension, and optional configuration. ```swift public init(filePathURL: URL, fileExtension: String? = nil, configuration: CachingPlayerItemConfiguration = .default) ``` -------------------------------- ### Initializer for playing from data Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem with media data, a custom file extension, and optional configuration. ```swift public convenience init(data: Data, customFileExtension: String, configuration: CachingPlayerItemConfiguration = .default) throws ``` -------------------------------- ### Full Initialization with Save File Path Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem to play and cache remote media to a specific local file path. Requires a unique, empty save file path and optionally accepts a custom file extension, AVURLAsset options, and configuration. ```Swift @MainActor public init(url: URL, saveFilePath: String, customFileExtension: String?, avUrlAssetOptions: [String: Any]? = nil, configuration: CachingPlayerItemConfiguration = .default) ``` -------------------------------- ### didFinishDownloadingFileAt Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Protocols/CachingPlayerItemDelegate.html Called when the media file is fully downloaded. ```Swift @objc optional func playerItem(_ playerItem: CachingPlayerItem, didFinishDownloadingFileAt filePath: String) ``` -------------------------------- ### Basic URL Initialization Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem to play and cache remote media from a given URL. The save file path is generated randomly. Requires the URL to have a path extension. ```Swift public convenience init(url: URL) ``` -------------------------------- ### URL Initialization with AVURLAsset Options and Configuration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem to play and cache remote media, allowing customization through AVURLAsset options and a CachingPlayerItemConfiguration. The save file path is generated randomly. Requires the URL to have a path extension. ```Swift @MainActor public convenience init(url: URL, avUrlAssetOptions: [String : Any]? = nil, configuration: CachingPlayerItemConfiguration = .default) ``` -------------------------------- ### URL Initialization with Custom File Extension, AVURLAsset Options, and Configuration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem to play and cache remote media, specifying a custom file extension for better compatibility, along with AVURLAsset options and configuration. The save file path is generated randomly. ```Swift @MainActor public convenience init(url: URL, customFileExtension: String, avUrlAssetOptions: [String : Any]? = nil, configuration: CachingPlayerItemConfiguration = .default) ``` -------------------------------- ### Download Media Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Downloads the media file. Works only with the initializers intended for play and cache. ```Swift @MainActor public func download() ``` -------------------------------- ### Downloading delegate methods Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Protocols/CachingPlayerItemDelegate.html Delegate methods related to the downloading process of media files. ```swift @objc optional func playerItem(_ playerItem: CachingPlayerItem, didFinishDownloadingFileAt filePath: String) ``` ```swift @objc optional func playerItem(_ playerItem: CachingPlayerItem, didDownloadBytesSoFar bytesDownloaded: Int, outOf bytesExpected: Int) ``` ```swift @objc optional func playerItem(_ playerItem: CachingPlayerItem, downloadingFailedWith error: Error) ``` -------------------------------- ### minimumExpectedFileSize Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html 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`. ```Swift public static var minimumExpectedFileSize: Int { get set } ``` -------------------------------- ### Initializer for playing from an AVAsset Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem with an AVAsset. Caching is not supported for this method. ```swift override public init(asset: AVAsset, automaticallyLoadedAssetKeys: [String]?) ``` -------------------------------- ### downloadBufferLimit Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/CachingPlayerItemConfiguration.html How much data is downloaded in memory before stored on a file. ```swift public static var downloadBufferLimit: Int ``` -------------------------------- ### downloadingFailedWith Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Protocols/CachingPlayerItemDelegate.html Called on downloading error. ```Swift @objc optional func playerItem(_ playerItem: CachingPlayerItem, downloadingFailedWith error: Error) ``` -------------------------------- ### minimumExpectedFileSize Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/CachingPlayerItemConfiguration.html 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`. ```swift public static var minimumExpectedFileSize: Int ``` -------------------------------- ### downloadBufferLimit Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html How much data is downloaded in memory before stored on a file. ```Swift public static var downloadBufferLimit: Int { get set } ``` -------------------------------- ### playerItemReadyToPlay Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Protocols/CachingPlayerItemDelegate.html Called after initial prebuffering is finished, means we are ready to play. ```Swift @objc optional func playerItemReadyToPlay(_ playerItem: CachingPlayerItem) ``` -------------------------------- ### CocoaPods Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/CwlMachBadInstructionHandler/README.md Integrate CwlPreconditionTesting into your Xcode project using CocoaPods by specifying it in your Podfile. ```ruby pod 'CwlPreconditionTesting', '~> 2.0' ``` -------------------------------- ### default Instance Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html The default configuration instance used for `[CachingPlayerItem](../Classes/CachingPlayerItem.html)` instances. ```Swift public static var `default`: CachingPlayerItemConfiguration ``` -------------------------------- ### shouldVerifyDownloadedFileSize Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/CachingPlayerItemConfiguration.html 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`. ```swift public static var shouldVerifyDownloadedFileSize: Bool ``` -------------------------------- ### Non-Caching Initialization Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Initializes a CachingPlayerItem to play remote media without caching. Allows customization through AVURLAsset options and a CachingPlayerItemConfiguration. ```Swift @MainActor public init(nonCachingURL url: URL, avUrlAssetOptions: [String : Any]? = nil, configuration: CachingPlayerItemConfiguration = .default) ``` -------------------------------- ### playerItemPlaybackStalled Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Protocols/CachingPlayerItemDelegate.html Called when the data being downloaded did not arrive in time to continue playback. ```Swift @objc optional func playerItemPlaybackStalled(_ playerItem: CachingPlayerItem) ``` -------------------------------- ### shouldVerifyDownloadedFileSize Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html 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`. ```Swift public static var shouldVerifyDownloadedFileSize: Bool { get set } ``` -------------------------------- ### logLevel Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/CachingPlayerItemConfiguration.html Log level. Defaults to `none`. ```swift public static var logLevel: LogLevel ``` -------------------------------- ### Playing delegate methods Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Protocols/CachingPlayerItemDelegate.html Delegate methods related to the playback status of the media. ```swift @objc optional func playerItemReadyToPlay(_ playerItem: CachingPlayerItem) ``` ```swift @objc optional func playerItemDidFailToPlay(_ playerItem: CachingPlayerItem, withError error: Error?) ``` ```swift @objc optional func playerItemPlaybackStalled(_ playerItem: CachingPlayerItem) ``` -------------------------------- ### Swift Package Manager Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/CwlMachBadInstructionHandler/README.md Add the CwlPreconditionTesting package to your Swift Package Manager dependencies. ```swift .package(url: "https://github.com/mattgallagher/CwlPreconditionTesting.git", from: Version("2.0.0")) ``` -------------------------------- ### logLevel Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html Log level. Defaults to `none`. ```Swift public static var logLevel: LogLevel { get set } ``` -------------------------------- ### Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes.html Declaration of the CachingPlayerItem class. ```Swift @MainActor public final class CachingPlayerItem : AVPlayerItem ``` -------------------------------- ### LogLevel Static Method: < Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/LogLevel.html Conforms to the Comparable protocol, allowing LogLevel instances to be compared. ```swift public static func < (lhs: LogLevel, rhs: LogLevel) -> Bool ``` -------------------------------- ### Download without Playing Source: https://github.com/sukov/cachingplayeritem/blob/master/README.md Use the download() method to cache a file without playing it, or to preload it for future playback. ```swift let playerItem = CachingPlayerItem(url: videoURL) playerItem.download() ``` -------------------------------- ### CachingPlayerItemDelegate Protocol Source: https://github.com/sukov/cachingplayeritem/blob/master/README.md The CachingPlayerItemDelegate protocol defines optional methods for handling download progress, completion, errors, and playback status for CachingPlayerItem. ```Swift @objc public protocol CachingPlayerItemDelegate { // MARK: Downloading delegate methods /// Called when the media file is fully downloaded. @objc optional func playerItem(_ playerItem: CachingPlayerItem, didFinishDownloadingFileAt filePath: String) /// Called every time a new portion of data is received. @objc optional func playerItem(_ playerItem: CachingPlayerItem, didDownloadBytesSoFar bytesDownloaded: Int, outOf bytesExpected: Int) /// Called on downloading error. @objc optional func playerItem(_ playerItem: CachingPlayerItem, downloadingFailedWith error: Error) // MARK: Playing delegate methods /// Called after initial prebuffering is finished, means we are ready to play. @objc optional func playerItemReadyToPlay(_ playerItem: CachingPlayerItem) /// Called when the player is unable to play the data/url. @objc optional func playerItemDidFailToPlay(_ playerItem: CachingPlayerItem, withError error: Error?) /// Called when the data being downloaded did not arrive in time to continue playback. @objc optional func playerItemPlaybackStalled(_ playerItem: CachingPlayerItem) } ``` -------------------------------- ### didDownloadBytesSoFar Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Protocols/CachingPlayerItemDelegate.html Called every time a new portion of data is received. ```Swift @objc optional func playerItem(_ playerItem: CachingPlayerItem, didDownloadBytesSoFar bytesDownloaded: Int, outOf bytesExpected: Int) ``` -------------------------------- ### LogLevel Case: info Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/LogLevel.html Represents the 'info' log level. ```swift case info ``` -------------------------------- ### LogLevel Case: warning Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/LogLevel.html Represents the 'warning' log level. ```swift case warning ``` -------------------------------- ### delegate Property Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html `delegate` for status updates. ```Swift @MainActor public weak var delegate: CachingPlayerItemDelegate? ``` -------------------------------- ### LogLevel Case: none Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/LogLevel.html Represents the 'none' log level, with a raw value of 0. ```swift case none = 0 ``` -------------------------------- ### shouldCheckAvailableDiskSpaceBeforeCaching Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/CachingPlayerItemConfiguration.html 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`. ```swift public static var shouldCheckAvailableDiskSpaceBeforeCaching: Bool ``` -------------------------------- ### readDataLimit Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html How much data is allowed to be read in memory at a time. ```Swift public static var readDataLimit: Int { get set } ``` -------------------------------- ### LogLevel Property: description Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/LogLevel.html Provides an emoji representation of the log level. ```swift public var description: String { get } ``` -------------------------------- ### KVO Observe Value Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Undocumented KVO method. ```Swift @MainActor public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) ``` -------------------------------- ### CachingPlayerItemDelegate Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Protocols.html The declaration for the CachingPlayerItemDelegate protocol. ```swift @objc public protocol CachingPlayerItemDelegate ``` -------------------------------- ### shouldCheckAvailableDiskSpaceBeforeCaching Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Structs/CachingPlayerItemConfiguration.html 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`. ```Swift public static var shouldCheckAvailableDiskSpaceBeforeCaching: Bool { get set } ``` -------------------------------- ### CachingPlayerItemConfiguration Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Structs.html Declaration of the CachingPlayerItemConfiguration structure. ```Swift public struct CachingPlayerItemConfiguration ``` -------------------------------- ### CocoaPods Integration Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/CwlCatchExceptionSupport/README.md Integrate CwlCatchException into your Xcode project using CocoaPods by specifying it in your Podfile. ```ruby pod 'CwlCatchException', '~> 2.0' ``` -------------------------------- ### readDataLimit Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/CachingPlayerItemConfiguration.html How much data is allowed to be read in memory at a time. ```swift public static var readDataLimit: Int ``` -------------------------------- ### isCaching Property Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Indicates whether media content is currently being cached to disk. Returns `false` for initializers that don’t support caching. ```Swift @MainActor public var isCaching: Bool { get } ``` -------------------------------- ### Cancel Download Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Cancels the download of the media file and deletes the incomplete cached file. Works only with the initializers intended for play and cache. ```Swift @MainActor public func cancelDownload() ``` -------------------------------- ### Swift Package Manager Dependency Source: https://github.com/sukov/cachingplayeritem/blob/master/Example/Pods/CwlCatchExceptionSupport/README.md Add the CwlCatchException package to your Swift Package Manager dependencies. ```swift .package(url: "https://github.com/mattgallagher/CwlCatchException.git", from: Version("2.0.0")) ``` -------------------------------- ### LogLevel Case: error Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums/LogLevel.html Represents the 'error' log level. ```swift case error ``` -------------------------------- ### LogLevel Declaration Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Enums.html Declaration of the LogLevel enumeration. ```Swift public enum LogLevel : Int, Comparable, CustomStringConvertible ``` -------------------------------- ### passOnObject Property Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/Classes/CachingPlayerItem.html Useful for keeping relevant model associated with CachingPlayerItem instance. This is a **strong** reference, be mindful not to create a **retain cycle**. ```Swift @MainActor public var passOnObject: Any? ``` -------------------------------- ### playerItemDidFailToPlay Source: https://github.com/sukov/cachingplayeritem/blob/master/docs/docsets/CachingPlayerItem.docset/Contents/Resources/Documents/Protocols/CachingPlayerItemDelegate.html Called when the player is unable to play the data/url. ```Swift @objc optional func playerItemDidFailToPlay(_ playerItem: CachingPlayerItem, withError error: Error?) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.