Class

AVAssetResourceLoadingDataRequest

An object used to request data from a resource referenced by an asset resource loading request.

Declaration

@interface AVAssetResourceLoadingDataRequest : NSObject

Overview

The AVAssetResourceLoaderDelegate uses the AVAssetResourceLoadingDataRequest class to do the actual data reading, and its methods will be invoked, as necessary, to acquire data for the AVAssetResourceLoadingRequest instance.

When the resource loading delegate, which implements the AVAssetResourceLoaderDelegate protocol, receives an instance of AVAssetResourceLoadingRequest as the second parameter of the delegate’s resourceLoader:shouldWaitForLoadingOfRequestedResource: method, it has the option of accepting responsibility for loading the referenced resource. If it accepts that responsibility, by returning YES, it must check whether the dataRequest property of the AVAssetResourceLoadingRequest 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 respondWithData: 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.

When the AVAssetResourceLoadingRequest method finishLoading 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.

Topics

Providing Data to a Request

- respondWithData:

Provides data to the loading request.

requestedLength

The length, in bytes, of the data requested.

requestedOffset

The position within the resource of the first byte requested.

currentOffset

The position within the resource of the next byte.

requestsAllDataToEndOfResource

A Boolean value that indicates the entire remaining length of the resource from the offest to the end of the resource is being requested.

Relationships

Inherits From

See Also

Asset Retrieval

AVURLAsset

A concrete subclass of AVAsset that's used to initialize an asset from a local or remote URL.

AVAssetDownloadURLSession

A URL session used to support the creation and execution of asset download tasks.

AVAssetResourceLoader

An object that mediates resource requests from a URL asset.

AVAssetResourceLoadingRequest

An object that encapsulates information about a resource request issued by a resource loader object.

response

The URL response for the loading request.

AVAssetResourceRenewalRequest

An object that encapsulates information about a resource request issued by a resource loader to renew a previously issued request.

AVAssetResourceLoadingContentInformationRequest

A query used to get essential information about a resource referenced by an asset resource loading request.

AVAssetDownloadStorageManager

A manager of policies used to automatically purge downloaded assets.

AVAssetDownloadStorageManagementPolicy

A set of properties that defines a policy to automatically purge downloaded assets.

AVMutableAssetDownloadStorageManagementPolicy

A mutable set of properties that defines a policy to automatically purge downloaded assets.