Instance Property


The duration of the asset.


var duration: CMTime { get }


If providesPreciseDurationAndTiming is true, the asset’s precise duration is returned. If providesPreciseDurationAndTiming is false, a best-available estimate of the duration is returned. You can set the degree of precision required for timing-related properties at initialization time for assets initialized with URLs (see AVURLAssetPreferPreciseDurationAndTimingKey in AVURLAsset).

See Also

Inspecting an Asset

var providesPreciseDurationAndTiming: Bool

A Boolean value that indicates whether the asset provides precise timing.

var creationDate: AVMetadataItem?

A value that indicates the creation date of the asset.

var naturalSize: CGSize

The encoded or authored size of the visual portion of the asset.

var preferredRate: Float

The natural rate at which the asset is to be played.

var preferredTransform: CGAffineTransform

The preferred transform to apply to the visual content of the asset for presentation or processing.

var preferredVolume: Float

The preferred volume at which the audible media of the asset is to be played.

var preferredDisplayCriteria: AVDisplayCriteria

The display criteria that define the optimal TV display mode for the asset.

class AVDisplayCriteria

An object containing properties that define the display criteria for a media asset.