A track in a composition object, consisting of a media type, a track identifier, and track segments.


class AVCompositionTrack : AVAssetTrack


The of the first track segment in a composition track is kCMTimeZero, and the of each subsequent track segment equals CMTimeRangeGetEnd(<#previousTrackSegment#>

The AVFoundation framework also provides a mutable subclass, AVMutableCompositionTrack.


Accessing Track Segments

func segment(forTrackTime: CMTime) -> AVCompositionTrackSegment?

Returns the composition track segment from the segment array that either contains or is closest to the supplied track time.

var segments: [AVCompositionTrackSegment]

The composition track’s track segments.


Inherits From

Conforms To

See Also

Media Composition

class AVComposition

An object that combines media data from multiple file-based sources to present or process media data from multiple sources.

class AVCompositionTrackSegment

A segment of a track, consisting of a URL, a track identifier, and a time mapping from the source track to the composition track.

class AVMutableComposition

A mutable object used to create a new composition from existing assets.

class AVMutableCompositionTrack

A mutable track in a composition object that you use to insert, remove, and scale track segments without affecting their low-level representation.

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