Type Method

mediaSelectionOptionsFromArray:filteredAndSortedAccordingToPreferredLanguages:

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

Declaration

+ (NSArray<AVMediaSelectionOption *> *)mediaSelectionOptionsFromArray:(NSArray<AVMediaSelectionOption *> *)mediaSelectionOptions filteredAndSortedAccordingToPreferredLanguages:(NSArray<NSString *> *)preferredLanguages;

Parameters

mediaSelectionOptions

An array of AVMediaSelectionOption objects to be filtered and sorted.

preferredLanguages

An array of NSString objects, each of which contains a canonicalized IETF BCP 47 language identifier. The strings should be sorted in order of preference, with the string corresponding to the most preferred language as the first element in the array. Typically, you retrieve these strings using the preferredLanguages class method of the NSLocale class.

Return Value

An array of AVMediaSelectionOption objects that match one of the languages in the preferredLanguages parameter. The objects in this array are sorted based on the language each one matches, with objects matching the most preferred language first in the array.

See Also

Filtering Selection Options

- makeNowPlayingInfoLanguageOptionGroup

Creates a language option group from the media selection group.

+ playableMediaSelectionOptionsFromArray:

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

+ mediaSelectionOptionsFromArray:withLocale:

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

+ mediaSelectionOptionsFromArray:withMediaCharacteristics:

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

+ mediaSelectionOptionsFromArray:withoutMediaCharacteristics:

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