Contents

insertTimeRange(_:of:at:)

Inserts a time range of media from a source track into a composition track.

Declaration

func insertTimeRange(_ timeRange: CMTimeRange, of track: AVAssetTrack, at startTime: CMTime) throws

Parameters

  • timeRange:

    The time range of media in the source track to add.

  • track:

    The source asset track that contains the media to add.

  • startTime:

    A start time within the composition track to insert the time range.

Discussion

The time range you insert presents at its natural duration and rate. If necessary, you can scale it to a different duration by calling the scaleTimeRange(_:toDuration:) method.

See Also

Managing time ranges