insertTimeRange(_:of:at:)
Inserts all the tracks within a given time range of a specified asset into the composition.
Declaration
func insertTimeRange(_ timeRange: CMTimeRange, of asset: AVAsset, at startTime: CMTime) throwsParameters
- timeRange:
The time range of the asset to be inserted.
- asset:
An asset that contains the tracks to be inserted.
- startTime:
The time at which the inserted tracks should be presented by the receiver.
Discussion
This method may add new tracks to ensure that all tracks of the asset are represented in the inserted time range.
Existing content at the specified start time is pushed out by the duration of the time range.
Media data for the inserted time range is presented at its natural duration; you can scale it to a different duration using scaleTimeRange(_:toDuration:).