An object used to request data from a resource referenced by an asset resource loading request.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
AVAsset uses the
AVAsset class to do the actual data reading, and its methods will be invoked, as necessary, to acquire data for the
When the resource loading delegate, which implements the
AVAsset protocol, receives an instance of
AVAsset as the second parameter of the delegate’s
resource method, it has the option of accepting responsibility for loading the referenced resource. If it accepts that responsibility, by returning
true, it must check whether the
data property of the
AVAsset instance is not
nil. If it is not
nil, the resource loading delegate is informed of the range of bytes within the resource that are required by the underlying media system. In response, the data is provided by one or more invocations of
respond(with:) as required to provide the requested data. The data can be provided in increments determined by the resource loading delegate according to convenience or efficiency.
finish is invoked, the data request is considered fully satisfied. If the entire range of bytes requested has not yet been provided, the underlying media system assumes that the resource's length is limited to the provided content.