Instance Method


Tells the delegate when assistance is required of the application to renew a resource.


optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForRenewalOfRequestedResource renewalRequest: AVAssetResourceRenewalRequest) -> Bool



The resource loader.


An instance of AVAssetResourceRenewalRequest that provides information about the requested resource.

Return Value

true if the delegate can renew the resource; otherwise false.


Delegates receive this message when assistance is required to renew a resource previously loaded by resourceLoader(_:shouldWaitForLoadingOfRequestedResource:). For example, this method is invoked to for decryption keys that require renewal, as indicated in a response to a prior invocation of resourceLoader(_:shouldWaitForLoadingOfRequestedResource:).

If the result is true, the resource loader expects invocation, either subsequently or immediately, of either the AVAssetResourceRenewalRequest method finishLoading or finishLoadingWithError:. If you intend to finish loading the resource after your handling of this message returns, you must retain the renewalRequest until after loading is finished.

If the result is false, the resource loader treats the loading of the resource as having failed.

See Also

Processing Resource Requests

Content Key Types

The types of custom URLs that should be handled as content keys.

func resourceLoader(AVAssetResourceLoader, didCancel: AVAssetResourceLoadingRequest)

Informs the delegate that a prior loading request has been cancelled.