Class

AVMediaSelectionGroup

An object that represents a collection of mutually exclusive options for the presentation of media within an asset.

Declaration

class AVMediaSelectionGroup : NSObject

Topics

Accessing Options

var options: [AVMediaSelectionOption]

A collection of mutually exclusive media selection options

func mediaSelectionOption(withPropertyList: Any) -> AVMediaSelectionOption?

Returns the media selection options that match the given property list.

var defaultOption: AVMediaSelectionOption?

The default option in the group.

Configuring Empty Selection

var allowsEmptySelection: Bool

A Boolean value that indicates whether it’s possible to present none of the options in the group when an associated player item is played.

Filtering Selection Options

func makeNowPlayingInfoLanguageOptionGroup() -> MPNowPlayingInfoLanguageOptionGroup

Creates a language option group from the media selection group.

class func playableMediaSelectionOptions(from: [AVMediaSelectionOption]) -> [AVMediaSelectionOption]

Returns an array containing the media selection options from a given array that are playable.

class func mediaSelectionOptions(from: [AVMediaSelectionOption], with: Locale) -> [AVMediaSelectionOption]

Returns an array containing the media selection options from a given array that match the specified locale.

class func mediaSelectionOptions(from: [AVMediaSelectionOption], withMediaCharacteristics: [AVMediaCharacteristic]) -> [AVMediaSelectionOption]

Returns an array containing the media selection options from a given array that match given media characteristics.

class func mediaSelectionOptions(from: [AVMediaSelectionOption], withoutMediaCharacteristics: [AVMediaCharacteristic]) -> [AVMediaSelectionOption]

Returns an array containing the media selection options from a given array that do not match given media characteristics.

class func mediaSelectionOptions(from: [AVMediaSelectionOption], filteredAndSortedAccordingToPreferredLanguages: [String]) -> [AVMediaSelectionOption]

Returns an array of media selection options, filtering them according to whether their locales match one of the specified languages.

Relationships

Inherits From

See Also

Media Selection

Adding Subtitles and Alternative Audio Tracks

Extend your app's appeal to users by adding subtitles and alternative audio tracks in their native language.

class AVMediaSelection

An object that represents a complete rendition of media selection options on an asset.

class AVMediaSelectionOption

An object that represents a specific option for the presentation of media within a group of options.

class AVMutableMediaSelection

A mutable object that represents a complete rendition of media selection options on an asset.