Instance Method

mediaSelectionGroup(forMediaCharacteristic:)

Returns a media selection group object 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 you wish to obtain the available media selection options.

Only audible, visual, and legible are currently supported.

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

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

  • Pass visual to obtain the group of available options for video media.

Return Value

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

Discussion

You can invoke this method without blocking when the key availableMediaCharacteristicsWithMediaSelectionOptions has been loaded.

You can filter the options in the returned media selection group according to playability, locale, and additional media characteristics can be accomplished using the filtering methods defined in the AVMediaSelectionGroup class.

See Also

Finding Media Selections

var preferredMediaSelection: AVMediaSelection

The default media selections for this asset’s media selection groups.

var availableMediaCharacteristicsWithMediaSelectionOptions: [AVMediaCharacteristic]

An array of media characteristics for which a media selection option is available.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software