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

finished

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

@property (nonatomic, readonly) 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

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

Instance Methods

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

finishLoadingWithResponse:data:redirect:

Causes the receiver to finish loading a resource for which a resource loader’s delegate took responsibility .

- (void)finishLoadingWithResponse:(NSURLResponse *)response data:(NSData *)data redirect:(NSURLRequest *)redirect
Parameters
response

The response object for the requested resource. Use the request object in the receiver’s request property to get information about the requested resource.

data

The data of the resource. If no data is available, specify nil.

redirect

When redirecting a resource request, use this parameter to specify the corresponding NSURLRequest object. If you are handling the request and not redirecting it, specify nil.

Discussion

When a resource loader’s delegate takes responsibility for loading a resource, it calls this method to indicate that the resource was loaded successfully. This method marks the loading request as finished and returns the provided data back to the resource loader object for processing.

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.

Discussion

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

Did this document help you? Yes It's good, but... Not helpful...