Contents

addMutableTrack(withMediaType:preferredTrackID:)

Adds an empty track to a composition.

Declaration

func addMutableTrack(withMediaType mediaType: AVMediaType, preferredTrackID: CMPersistentTrackID) -> AVMutableCompositionTrack?

Parameters

  • mediaType:

    The media type of the new track.

  • preferredTrackID:

    The preferred track ID for the new track. The system generates a unique ID if the value you specify isn’t available. If you don’t need to specify a preferred track ID, pass Kcmpersistenttrackid_invalid, and the system generates an appropriate identifier.

Return Value

A new mutable composition track.

See Also

Managing composition tracks