AVAssetResourceLoaderDelegate Protocol Reference
Available in iOS 6.0 and later.
AVAssetResourceLoaderDelegate protocol defines a method that lets your code handle resource loading requests coming from an
A class should adopt this protocol when associated with the asset’s resource loader—that is, an instance of the
AVAssetResourceLoader class. The resource loader works with your delegate to process the request.
Processing Resource Requests
Invoked to inform the delegate that a prior loading request has been cancelled
The resource loader.
The loading request that has been cancelled.
Previously issued loading requests can be cancelled when data from the resource is no longer required or when a loading request is superseded by new requests for data from the same resource.
For example, if to complete a seek operation it becomes necessary to load a range of bytes that's different from a range previously requested, the prior request may be cancelled while the delegate is still handling it.
- Available in iOS 7.0 and later.
Asks the delegate if it wants to load the requested resource.
The resource loader object that is making the request.
The loading request object that contains information about the requested resource.
YES if your delegate can load the resource specified by the loadingRequest parameter or
NO if it cannot.
The resource loader object calls this method when assistance is required of your code to load the specified resource. For example, the resource loader might call this method to load decryption keys that have been specified using a custom URL scheme.
YES from this method, implies only that the receiver will load, or at least attempt to load, the resource. In some implementations, the actual work of loading the resource might be initiated on another thread, running asynchronously to the resource loading delegate; whether the work begins immediately or merely soon is an implementation detail of the client application.
You can load the resource synchronously or asynchronously. In both cases, you must indicate success or failure of the operation by calling the
finishLoadingWithError: method of the request object when you finish. If you load the resource asynchronously, you must also store a strong reference to the object in the loadingRequest parameter before returning from this method.
If you return
NO from this method, the resource loader treats the loading of the resource as having failed.
- Available in iOS 6.0 and later.