AVPlayerMediaSelectionCriteria Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 7.0 and later.
Declared in
AVPlayerMediaSelectionCriteria.h

Overview

The AVPlayerMediaSelectionCriteria class specifies the preferred languages and media characteristics for an AVPlayer instance.

The languages and media characteristics of assets containing media selection options that an AVPlayer instance should attempt to select automatically when preparing and playing items. The languages and media characteristics are specified in the preferred order.

Tasks

Creating a Media Selection Criteria

Media Selection Criteria Settings

Properties

preferredLanguages

The array of preferred languages in the order of desirability. (read-only)

@property(nonatomic, readonly) NSArray *preferredLanguages
Availability
  • Available in iOS 7.0 and later.
Declared In
AVPlayerMediaSelectionCriteria.h

preferredMediaCharacteristics

The array of preferred media characteristics in the order of desirability. (read-only)

@property(nonatomic, readonly) NSArray *preferredMediaCharacteristics
Availability
  • Available in iOS 7.0 and later.
Declared In
AVPlayerMediaSelectionCriteria.h

Instance Methods

initWithPreferredLanguages:preferredMediaCharacteristics:

Returns an initialized media selection criteria instance with the specified settings.

- (id)initWithPreferredLanguages:(NSArray *)preferredLanguages preferredMediaCharacteristics:(NSArray *)preferredMediaCharacteristics
Parameters
preferredLanguages

An array of strings containing language identifiers, in the preferred order. Can be nil.

preferredMediaCharacteristics

An array of strings indicating additional media characteristics, the preferred order. Can be nil.

Supported media characteristics are defined in AVMediaSelectionOption Constants and Media Characteristics.

Return Value

An initialized AVPlayerMediaSelectionCriteria instance.

Discussion

When making selections, AVPlayer treats the preferredLanguages as the paramount criterion and the preference for preferredMediaCharacteristics as secondary.

The objects in the preferredLanguages array are indicated using BCP 47 language identifiers or ISO 639-2/T language codes.

If no option with any of the preferredLanguages is available, a selection is made according to the default enabling and disabling of media options as stored in the asset.

The preferredMediaCharacteristics are used when selecting media for the AVPlayer.

For example, desirable characteristics of legible media may include AVMediaCharacteristicTranscribesSpokenDialogForAccessibility and AVMediaCharacteristicDescribesMusicAndSoundForAccessibility.

Similarly, desirable characteristics of audible media may include AVMediaCharacteristicDescribesVideoForAccessibility.

If no option is found that possesses all of the desired characteristics, the option that best matches the desired characteristics will be selected.

Availability
  • Available in iOS 7.0 and later.
Declared In
AVPlayerMediaSelectionCriteria.h