insertTimeRange(_:of:at:copySampleData:)
Inserts a portion of an asset track into the target movie.
Declaration
func insertTimeRange(_ timeRange: CMTimeRange, of track: AVAssetTrack, at startTime: CMTime, copySampleData: Bool) throwsParameters
- timeRange:
The time range of the track to insert.
- track:
An Avassettrack object indicating the source of the inserted media. This value can’t be
nil. - startTime:
The time in the target track at which the media is to be inserted.
- copySampleData:
A Boolean value that indicates whether sample data is to be copied from the source to the destination during edits. If
YES, the sample data is written to the location specified by the track propertymediaDataStorageif non-nil, or else by the movie propertydefaultMediaDataStorageif non-nil; if both are nil, the method fails and returnsNO. IfNO, sample data isn’t written and sample references to the samples in their original container are added as necessary.