<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVMutableCompositionTrack/insertTimeRange(_:of:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVMutableCompositionTrack(im)insertTimeRange:ofTrack:atTime:error:"
  },
  "title" : "insertTimeRange(_:of:at:)"
}
-->

# insertTimeRange(_:of:at:)

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

```
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:)`](/documentation/AVFoundation/AVMutableCompositionTrack/scaleTimeRange(_:toDuration:)) method.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)