iOS Developer Library

Developer

AVFoundation Framework Reference AVMediaSelectionGroup Class Reference

Options
Deployment Target:

On This Page
Language:

AVMediaSelectionGroup

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

Inheritance


Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 5.0 and later.
  • options options Property

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

    Declaration

    Swift

    var options: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly) NSArray *options

    Discussion

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

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    func mediaSelectionOptionWithPropertyList(_ plist: AnyObject!) -> AVMediaSelectionOption!

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

  • The default option in the group. (read-only)

    Declaration

    Swift

    var defaultOption: AVMediaSelectionOption! { get }

    Objective-C

    @property(nonatomic, readonly) AVMediaSelectionOption *defaultOption

    Discussion

    The default option is intended for use in the absence of a specific end-user selection or preference. Can be nil, indicating that without a specific end-user selection or preference, no option in the group is intended to be selected.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 8.0 and later.

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

    Declaration

    Swift

    var allowsEmptySelection: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL allowsEmptySelection

    Discussion

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

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func playableMediaSelectionOptionsFromArray(_ array: [AnyObject]!) -> [AnyObject]!

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func mediaSelectionOptionsFromArray(_ array: [AnyObject]!, withLocale locale: NSLocale!) -> [AnyObject]!

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func mediaSelectionOptionsFromArray(_ array: [AnyObject]!, withMediaCharacteristics mediaCharacteristics: [AnyObject]!) -> [AnyObject]!

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func mediaSelectionOptionsFromArray(_ array: [AnyObject]!, withoutMediaCharacteristics mediaCharacteristics: [AnyObject]!) -> [AnyObject]!

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 5.0 and later.

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

    Declaration

    Swift

    class func mediaSelectionOptionsFromArray(_ mediaSelectionOptions: [AnyObject]!, filteredAndSortedAccordingToPreferredLanguages preferredLanguages: [AnyObject]!) -> [AnyObject]!

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 6.0 and later.