Instance Method

segment(forTrackTime:)

Returns the track segment that corresponds with, or is closest to, the specified track time.

Declaration

func segment(forTrackTime trackTime: CMTime) -> AVAssetTrackSegment?

Parameters

trackTime

The track time for which you want the segment.

Return Value

The track segment from the segments array that corresponds or is closest to trackTime.

See Also

Finding Track Segments

var segments: [AVAssetTrackSegment]

The time mappings from the track’s media samples to its timeline.

func samplePresentationTime(forTrackTime: CMTime) -> CMTime

Maps the specified track time through the appropriate time mapping and returns the resulting sample presentation time.