AVAssets - AVFoundation
AVAsset
is an abstract, immutable class providing a composite representation of a media resource, modeling the static attributes of the media as a whole, such as its title, duration, and metadata. AVAsset is not the media itself, but acts as a container for timed media. It is composed of one or more media tracks along with metadata describing its contents.
AVAsset
confirms the AVAsynchronousKeyValueLoading
protocol. We can querying an asset’s properties asynchronously.
1 | // check for status for a key |
1 | // example |
Note that:
The completionHandler block will be called only once per invocation of loadValuesAsynchronouslyForKeys:completionHandler:, no matter how many keys you pass to this methods.
We need to call status statusOfValueForKey:error: on each property you requested.
https://developer.apple.com/documentation/avfoundation/avasset