Instance Method

startReading()

Prepares the receiver for obtaining sample buffers from the asset.

Declaration

func startReading() -> Bool

Return Value

true if the reader is able to start reading, otherwise false.

Discussion

This method validates the entire collection of settings for outputs for tracks, for audio mixdown, and for video composition and initiates reading of all outputs.

status signals the terminal state of the asset reader, and if a failure occurs, error describes the failure.

See Also

Controlling Reading

var status: AVAssetReader.Status

The status of the reading of sample buffers from the asset.

enum AVAssetReader.Status

The statuses for a reader.

func cancelReading()

Cancels any background work and prevents the receiver’s outputs from reading more samples.

var error: Error?

Describes the error that occurred.

var timeRange: CMTimeRange

The time range to read from the asset.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software