Instance Method

mutableTrack(compatibleWith:)

Provides a reference to a track from a mutable movie into which any time range can be inserted.

Declaration

func mutableTrack(compatibleWith track: AVAssetTrack) -> AVMutableMovieTrack?

Parameters

track

The AVAssetTrack containing the desired time range.

Return Value

An AVMutableMovieTrack object that can accommodate the time range insertion. Returns nil when no track is available.

Discussion

Keep the number of tracks in a movie to a minimum, corresponding to the number of tracks for which media data must be presented in parallel. If media data of the same type is presented serially, even from multiple assets, a single track of that media type should be used. This method can help the client to identify an existing target track for an insertion.

See Also

Modifying Tracks

func addMutableTracksCopyingSettings(from: [AVAssetTrack], options: [String : Any]?) -> [AVMutableMovieTrack]

Adds one or more empty tracks to the target movie and copies the track settings from the source tracks.

func removeTrack(AVMovieTrack)

Removes the specified track from the target movie.

var tracks: [AVMutableMovieTrack]

An array of tracks in a mutable movie.

func track(withTrackID: CMPersistentTrackID) -> AVMutableMovieTrack?

A mutable movie track representing the track with the specified track identifier.

func tracks(withMediaCharacteristic: AVMediaCharacteristic) -> [AVMutableMovieTrack]

An array of mutable movie tracks that match the specified media characteristic.

func tracks(withMediaType: AVMediaType) -> [AVMutableMovieTrack]

An array of mutable movie tracks that match the specified media type.