Protocol: AVAsynchronousKeyValueLoading
Overview
The AVAsynchronousKeyValueLoading protocol defines methods that let you use an AVAsset or AVAssetTrack object without blocking a thread. Using methods in the protocol, you can find out the current status of a key (for example, whether the corresponding value has been loaded); and ask the object to load values asynchronously, informing you when the operation has completed. Tells the asset to load the values of any of the specified keys that are not already loaded. (required)Reports whether the value for a given key is immediately available without blocking. (required)A type to specify the load status of a given property.Constants to indicate the load status of a property.
Instance Method Summary (collapse)
-
- loadValuesAsynchronouslyForKeys:completionHandler:
Tells the asset to load the values of any of the specified keys that are not already loaded.
-
- statusOfValueForKey:error:
Reports whether the value for a given key is immediately available without blocking.
Instance Method Details
- (Object) loadValuesAsynchronouslyForKeys(keys, completionHandler:handler)
Tells the asset to load the values of any of the specified keys that are not already loaded. (required) The completion handler will be invoked exactly once per invocation of this method:Synchronously if an I/O error or other format-related error occurs immediately.Asynchronously at a subsequent time if a loading error occurs at a later stage of processing, or if cancelLoading is invoked on an AVAsset instance.The completion states of the keys you specify in keys are not necessarily the same—some may be loaded, and others may have failed. You must check the status of each key individually.If you want to receive error reporting for loading that’s still pending, you can call this method at any time—even after an asset has begun to load data for operations in progress or already completed. If a fatal error has already occurred, the completion handler is invoked synchronously.
- (AVKeyValueStatus) statusOfValueForKey(key, error:outError)
Reports whether the value for a given key is immediately available without blocking. (required) You use this method to determine the availability of the value for a key. This method does not cause an asset to load the value of a key that’s not yet available. To request values for keys that may not already be loaded without blocking, use loadValuesAsynchronouslyForKeys:completionHandler: and wait for invocation of the completion handler to be informed of availability.