One Logo Pool Ball
AVFoundation · IOS API REFERENCE

AVMutableComposition

class · iOS 4.0+ · SDK 27.1

class AVMutableComposition

Members (19)

init · iOS 9.0+

init

TypeScript
static init(URLAssetInitializationOptions?: (Record<string, unknown>) | null): AVMutableComposition
Swift declaration
convenience init(urlAssetInitializationOptions URLAssetInitializationOptions: [String : Any]? = nil)
method

addMutableTrack

TypeScript
addMutableTrack(mediaType: AVMediaType, preferredTrackID: number): (AVMutableCompositionTrack) | null
Swift declaration
func addMutableTrack(withMediaType mediaType: AVMediaType, preferredTrackID: CMPersistentTrackID) -> AVMutableCompositionTrack?
method

insertEmptyTimeRange

TypeScript
insertEmptyTimeRange(timeRange: _CoreMedia_CMTimeRange): void
Swift declaration
func insertEmptyTimeRange(_ timeRange: CMTimeRange)
method · iOS 16.0+ · Deprecated in iOS 18.0

insertTimeRange

TypeScript
insertTimeRangeOfAtCompletionHandler(timeRange: _CoreMedia_CMTimeRange, asset: AVAsset, startTime: _CoreMedia_CMTime, completionHandler: ((arg0: (NativeError) | null) => void)): void
Swift declaration
func insertTimeRange(_ timeRange: CMTimeRange, of asset: AVAsset, at startTime: CMTime, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
method · iOS 4.0+ · Deprecated in iOS 18.0

insertTimeRange

TypeScript
insertTimeRangeOfAt(timeRange: _CoreMedia_CMTimeRange, asset: AVAsset, startTime: _CoreMedia_CMTime): void
Swift declaration
func insertTimeRange(_ timeRange: CMTimeRange, of asset: AVAsset, at startTime: CMTime) throws
method · iOS 15.0+

loadTrack

TypeScript
loadTrack(trackID: number, completionHandler: ((arg0: (AVMutableCompositionTrack) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadTrack(withTrackID trackID: CMPersistentTrackID) async throws -> AVMutableCompositionTrack?
method · iOS 15.0+

loadTracks

TypeScript
loadTracksWithMediaCharacteristicCompletionHandler(mediaCharacteristic: AVMediaCharacteristic, completionHandler: ((arg0: (Array<AVMutableCompositionTrack>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadTracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) async throws -> [AVMutableCompositionTrack]
method · iOS 15.0+

loadTracks

TypeScript
loadTracksWithMediaTypeCompletionHandler(mediaType: AVMediaType, completionHandler: ((arg0: (Array<AVMutableCompositionTrack>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadTracks(withMediaType mediaType: AVMediaType) async throws -> [AVMutableCompositionTrack]
method

mutableTrack

TypeScript
mutableTrack(track: AVAssetTrack): (AVMutableCompositionTrack) | null
Swift declaration
func mutableTrack(compatibleWith track: AVAssetTrack) -> AVMutableCompositionTrack?
method

removeTimeRange

TypeScript
removeTimeRange(timeRange: _CoreMedia_CMTimeRange): void
Swift declaration
func removeTimeRange(_ timeRange: CMTimeRange)
method

removeTrack

TypeScript
removeTrack(track: AVCompositionTrack): void
Swift declaration
func removeTrack(_ track: AVCompositionTrack)
method

scaleTimeRange

TypeScript
scaleTimeRange(timeRange: _CoreMedia_CMTimeRange, duration: _CoreMedia_CMTime): void
Swift declaration
func scaleTimeRange(_ timeRange: CMTimeRange, toDuration duration: CMTime)
method

track

TypeScript
track(trackID: number): (AVMutableCompositionTrack) | null
Swift declaration
func track(withTrackID trackID: CMPersistentTrackID) -> AVMutableCompositionTrack?
method

tracks

TypeScript
tracksWithMediaCharacteristic(mediaCharacteristic: AVMediaCharacteristic): Array<AVMutableCompositionTrack>
Swift declaration
func tracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> [AVMutableCompositionTrack]
method

tracks

TypeScript
tracksWithMediaType(mediaType: AVMediaType): Array<AVMutableCompositionTrack>
Swift declaration
func tracks(withMediaType mediaType: AVMediaType) -> [AVMutableCompositionTrack]
get · iOS 4.0+

naturalSize

TypeScript
get naturalSize(): { width: number; height: number }
Swift declaration
var naturalSize: CGSize { get set }
set · iOS 4.0+

naturalSize

TypeScript
set naturalSize(value: { width: number; height: number })
Swift declaration
var naturalSize: CGSize { get set }
get · iOS 4.0+

tracks

TypeScript
get tracks(): Array<AVMutableCompositionTrack>
Swift declaration
var tracks: [AVMutableCompositionTrack] { get }
method · iOS 16.0+

insertTimeRange

TypeScript
insertTimeRangeOfAt11368(timeRange: _CoreMedia_CMTimeRange, asset: AVAsset, time: _CoreMedia_CMTime): Promise<void>
Swift declaration
@backDeployed(before: macOS 15, iOS 18, tvOS 18, watchOS 11, visionOS 2)
final func insertTimeRange(_ timeRange: CMTimeRange, of asset: AVAsset, at time: CMTime, isolation: isolated (any Actor)? = #isolation) async throws

Inserts all the tracks of a timeRange of an asset into a composition. - Parameters: - timeRange: Specifies the timeRange of the asset to be inserted. - asset: Specifies the asset that contains the tracks that are to be inserted. Only instances of AVURLAsset and AVComposition are supported. - time: Specifies the time at which the inserted tracks are to be presented by the composition. - isolation: The actor isolation for accessing non-Sendable values. Inherits the calling isolation by default.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

AVMutableComposition.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All AVFoundation types →