Contents

loadMediaSelectionGroup(for:completionHandler:)

Loads a media selection group that contains one or more options with the specified media characteristic.

Declaration

func loadMediaSelectionGroup(for mediaCharacteristic: AVMediaCharacteristic, completionHandler: @escaping  @Sendable (AVMediaSelectionGroup?, (any Error)?) -> Void)
func loadMediaSelectionGroup(for mediaCharacteristic: AVMediaCharacteristic) async throws -> AVMediaSelectionGroup?

Parameters

  • mediaCharacteristic:

    A media characteristic to load the available media selection options for. The supported characterisics are:

    • Audible to return the group of available options for audio media in various languages and for various purposes, such as descriptive audio

    • Legible to return the group of available options for subtitles in various languages and for various purposes

    • Visual to return the group of available options for video media

  • completionHandler:

    A callback that the system invokes after it finishes the loading request. It passes the completion handler the following parameters:

    mediaSelectionGroup

    The loaded media selection group, or nil if no group is available or if an error occurs.

    error

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

See Also

Loading media selections