AVAssetResourceLoadingRequest Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 6.0 and later.
Declared in
AVAssetResourceLoader.h

Overview

An AVAssetResourceLoadingRequest object encapsulates information about a resource request issued from a resource loader object.

When an AVURLAsset object needs help loading a resource, it asks its AVAssetResourceLoader object to assist. The resource loader encapsulates the request information by creating an instance of this object, which it then hands to its delegate object for processing. The delegate uses the information in this object to perform the request and report on the success or failure of the operation.

Tasks

Accessing the Request Data

Reporting the Result of the Request

Properties

cancelled

A Boolean value that indicates whether the request has been cancelled. (read-only)

@property(nonatomic, readonly, getter=isCancelled) BOOL cancelled
Discussion

YES when the resource loader cancels the loading of a request, just prior to sending the message resourceLoader:didCancelLoadingRequest: to the delegate.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAssetResourceLoader.h

contentInformationRequest

Information about the requested resource. (read-only)

@property(nonatomic, readonly) AVAssetResourceLoadingContentInformationRequest *contentInformationRequest
Discussion

An instance of AVAssetResourceLoadingContentInformationRequest that you populate with information about the resource. The value of this property is nil if no such information is being requested.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAssetResourceLoader.h

dataRequest

The range of requested resource data. (read-only)

@property(nonatomic, readonly) AVAssetResourceLoadingDataRequest *dataRequest
Discussion

An instance of AVAssetResourceLoadingDataRequest that indicates the range of resource data that's being requested. The value of this property is nil if no data is being requested.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAssetResourceLoader.h

finished

A Boolean value that indicates whether loading of the resource has finished. (read-only)

@property(nonatomic, readonly, getter=isFinished) BOOL finished
Discussion

The value of this property is NO initially. The value changes to YES when the delegate object handling the request calls the finishLoadingWithResponse:data:redirect: or finishLoadingWithError: method.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVAssetResourceLoader.h

redirect

An URL request instance if the loading request was redirected.

@property(nonatomic, copy) NSURLRequest *redirect
Discussion

Set this property to an instance of NSURLRequest indicating a redirection of the loading request to another URL.

If no redirection is needed, the value of this property must be nil, which is the default.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAssetResourceLoader.h

request

The URL request object for the resource. (read-only)

@property(nonatomic, readonly) NSURLRequest *request
Discussion

Use the value in this property to identify the requested resource and to formulate an appropriate response object.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVAssetResourceLoader.h

response

The URL response for the loading request.

@property(nonatomic, copy) NSURLResponse *response
Discussion

The value of this property to an instance of NSURLResponse, indicating a response to the loading request. If no response is needed, the value of this property is nil.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAssetResourceLoader.h

Instance Methods

finishLoading

Causes the receiver to treat the processing of the request as complete.

- (void)finishLoading
Discussion

If a dataRequest is present and the resource does not contain the full extent of the data that has been requested according to the values of the requestedOffset and requestedLength properties of the request, invoke finishLoading after providing as much of the requested data as the resource contains.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVAssetResourceLoader.h

finishLoadingWithError:

Causes the receiver to handle the failure to load a resource for which a resource loader’s delegate took responsibility.

- (void)finishLoadingWithError:(NSError *)error
Parameters
error

An error object indicating the reason for the failure.

Discussion

When a resource loader’s delegate takes responsibility for loading a resource, it calls this method when a failure occurred when loading the resource. This method marks the loading request as finished and notifies the resource loader object that the resource could not be loaded.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVAssetResourceLoader.h

streamingContentKeyRequestDataForApp:contentIdentifier:options:error:

Obtains key request data for a specific combination of application and content.

- (NSData *)streamingContentKeyRequestDataForApp:(NSData *)appIdentifier contentIdentifier:(NSData *)contentIdentifier options:(NSDictionary *)options error:(NSError **)outError
Parameters
appIdentifier

An opaque content identifier for the application. The value of this identifier depends on the particular system used to provide the decryption key.

contentIdentifier

An opaque identifier for the content. The value of this identifier depends on the particular system used to provide the decryption key.

options

Additional information necessary to obtain the key, or nil if no additional information is required.

outError

On input, a pointer to an error object. If an error occurs while obtaining the streaming content key, the pointer is set to an appropriate error object on output.

Return Value

The key request data that must be transmitted to the key vendor to obtain the content key.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVAssetResourceLoader.h