Contents

mediaSelectionGroup(forMediaCharacteristic:)

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

Declaration

func mediaSelectionGroup(forMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> AVMediaSelectionGroup?

Parameters

  • mediaCharacteristic:

    A media characteristic for which to obtain the available media selection options.

    Only Audible, Visual, and Legible are currently supported.

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

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

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

Return Value

An AVMediaSelectionGroup that contains one or more options with the specified media characteristic, or nil if none could be found.

Discussion

Use the filtering methods AVMediaSelectionGroup defines to filter the group’s options according to playability, locale, and additional media characteristics.

You can call this method without blocking the current thread after you’ve asynchronously loaded the availableMediaCharacteristicsWithMediaSelectionOptions property.

See Also

Accessing media selections