Contents

loadTracks(withMediaType:completionHandler:)

Loads tracks that contain media of a specified type.

Declaration

func loadTracks(withMediaType mediaType: AVMediaType, completionHandler: @escaping  @Sendable ([AVFragmentedAssetTrack]?, (any Error)?) -> Void)
func loadTracks(withMediaType mediaType: AVMediaType) async throws -> [AVFragmentedAssetTrack]

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:

    tracks

    An array of tracks, which may be empty if no tracks with the specified media type exist. The value is nil if an error occurs.

    error

    An error object if the request fails; otherwise, nil.

See Also

Loading tracks