AVAssetResourceLoader 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 AVAssetResourceLoader object mediates resource requests from an AVURLAsset object with a delegate object that you provide. When a request arrives, the resource loader asks your delegate if it is able to handle the request and reports the results back to the asset.

You do not create resource loader objects yourself. Instead, you retrieve a resource loader from the resourceLoader property of an AVURLAsset object and use it to assign your custom delegate object.

The delegate you associate with this object must adopt the AVAssetResourceLoaderDelegate protocol. For more information, see AVAssetResourceLoaderDelegate Protocol Reference.

Tasks

Accessing the Delegate

Getting the Dispatch Queue

Properties

delegate

The delegate object to use when handling resource requests. (read-only)

@property (nonatomic, readonly) id<AVAssetResourceLoaderDelegate> delegate
Discussion

The delegate object is responsible for indicating whether or not it is able to handle a resource request. And for those requests it does handle, the delegate object must initiate the loading of the requested resource.

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

delegateQueue

The dispatch queue to use when handling resource requests. (read-only)

@property (nonatomic, readonly) dispatch_queue_t delegateQueue
Discussion

Resource requests are processed synchronously on the specified dispatch queue.

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

Instance Methods

setDelegate:queue:

Sets the delegate and dispatch queue to use with the resource loader.

- (void)setDelegate:(id<AVAssetResourceLoaderDelegate>)delegate queue:(dispatch_queue_t)delegateQueue
Parameters
delegate

The delegate object to query when handling resource requests. You may specify nil if you want to clear the delegate object. The resource loader does not store a strong reference to the delegate object.

delegateQueue

The dispatch queue on which to execute resource requests. If the delegate parameter is not nil, this parameter must also not be nil and must contain a valid dispatch queue. However, if delegate is nil, this parameter may also be nil.

The resource loader maintains a strong reference to the dispatch queue you specify.

Discussion

You use this method to specify the object to use when handling resource requests and the dispatch queue on which to process those requests. Resource requests are processed synchronously on the dispatch queue you provide.

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