Instance Method

generateCGImagesAsynchronouslyForTimes:completionHandler:

Creates a series of image objects for an asset at or near specified times.

Declaration

- (void)generateCGImagesAsynchronouslyForTimes:(NSArray<NSValue *> *)requestedTimes completionHandler:(AVAssetImageGeneratorCompletionHandler)handler;

Parameters

requestedTimes

An array of NSValue objects, each containing a CMTime, specifying the asset times at which an image is requested.

handler

A block called when an image request is complete.

Discussion

This method uses an efficient “batch mode” to get images in time order.

The client receives exactly one handler callback for each requested time in requestedTimes. Changes to the generator’s properties (snap behavior, maximum size, and so on) do not affect pending asynchronous image generation requests.

See Also

Generating Images

- copyCGImageAtTime:actualTime:error:

Returns an image for the asset at or near a specified time.

AVAssetImageGeneratorCompletionHandler

A block that you use to receive thumbnail images generated from an asset.

AVAssetImageGeneratorResult

The statuses indicating the outcome of image generation.

- cancelAllCGImageGeneration

Cancels all pending image generation requests.