---
title: "loadTracks(withMediaType:completionHandler:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablemovie/loadtracks(withmediatype:completionhandler:)"
---

# loadTracks(withMediaType:completionHandler:)

Loads tracks that contain media of a specified type.

## Declaration

```swift
func loadTracks(withMediaType mediaType: AVMediaType, completionHandler: @escaping @Sendable ([AVMutableMovieTrack]?, (any Error)?) -> Void)
```

```swift
func loadTracks(withMediaType mediaType: AVMediaType) async throws -> [AVMutableMovieTrack]
```

## Parameters

- `mediaType`: The media type of the tracks to load.
- `completionHandler`: A callback that the system invokes after it finishes the loading operation. It passes the completion handler the following parameters:

## See Also

### Loading tracks

- [tracks](avfoundation/avpartialasyncproperty/tracks-2lj40.md)
- [loadTrack(withTrackID:completionHandler:)](avfoundation/avmutablemovie/loadtrack(withtrackid:completionhandler:).md)
- [loadTracks(withMediaCharacteristic:completionHandler:)](avfoundation/avmutablemovie/loadtracks(withmediacharacteristic:completionhandler:).md)
