AVMediaSelectionGroup Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 5.0 and later.
Companion guide
Declared in
AVMediaSelectionGroup.h

Overview

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

Tasks

Accessing Options

Configuring Empty Selection

Filtering Selection Options

Properties

allowsEmptySelection

Indicates whether it’s possible to present none of the options in the group when an associated player item is played. (read-only)

@property(nonatomic, readonly) BOOL allowsEmptySelection
Discussion

If the value of this property is YES, you can deselect all of the available media options in the group by passing nil as the specified AVMediaSelectionOption object to selectMediaOption:inMediaSelectionGroup:.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h

options

A collection of mutually exclusive media selection options (read-only)

@property(nonatomic, readonly) NSArray *options
Discussion

The value of the property is an array of AVMediaSelectionOption objects.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h

Class Methods

mediaSelectionOptionsFromArray:filteredAndSortedAccordingToPreferredLanguages:

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

+ (NSArray *)mediaSelectionOptionsFromArray:(NSArray *)mediaSelectionOptions filteredAndSortedAccordingToPreferredLanguages:(NSArray *)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.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVMediaSelectionGroup.h

mediaSelectionOptionsFromArray:withLocale:

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

+ (NSArray *)mediaSelectionOptionsFromArray:(NSArray *)array withLocale:(NSLocale *)locale
Parameters
array

An array of AVMediaSelectionOption objects to be filtered.

locale

The locale that must be matched for a media selection option to be copied to the output array.

Return Value

An array containing the media selection options from array that match the locale.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h

mediaSelectionOptionsFromArray:withMediaCharacteristics:

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

+ (NSArray *)mediaSelectionOptionsFromArray:(NSArray *)array withMediaCharacteristics:(NSArray *)mediaCharacteristics
Parameters
array

An array of AVMediaSelectionOption objects to be filtered.

mediaCharacteristics

The media characteristics that must be matched for a media selection option to be present in the output array.

Return Value

An array containing the media selection options from array that match mediaCharacteristics.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h

mediaSelectionOptionsFromArray:withoutMediaCharacteristics:

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

+ (NSArray *)mediaSelectionOptionsFromArray:(NSArray *)array withoutMediaCharacteristics:(NSArray *)mediaCharacteristics
Parameters
array

An array of AVMediaSelectionOption objects to be filtered.

mediaCharacteristics

The media characteristics that must not be present for a media selection option to be present in the output array.

Return Value

An array containing the media selection options from array that lack the media characteristics in mediaCharacteristics.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h

playableMediaSelectionOptionsFromArray:

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

+ (NSArray *)playableMediaSelectionOptionsFromArray:(NSArray *)array
Parameters
array

An array of AVMediaSelectionOption objects to be filtered by playability.

Return Value

An array containing the media selection options from array that are playable.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h

Instance Methods

mediaSelectionOptionWithPropertyList:

Returns the instance of AVMediaSelectionOption with properties that match the given property list.

- (AVMediaSelectionOption *)mediaSelectionOptionWithPropertyList:(id)plist
Parameters
plist

A property list previously obtained from an option in the group using propertyList (AVMediaSelectionOption).

Return Value

If the properties in plist match those of an option in the group, a corresponding instance of AVMediaSelectionOption, otherwise nil.

Availability
  • Available in iOS 5.0 and later.
Declared In
AVMediaSelectionGroup.h