AVPlayer method setMediaSelectionCriteria:forMediaCharacteristic: not working

Originator:denis.poifol
Number:rdar://28563670 Date Originated:09/30/2016
Status:Open Resolved:
Product:iOS Product Version:9.3.5
Classification: Reproducible:YES
 
Summary:
I'm trying to optimise the network usage of my app by making the language selection automatic when AVPlayer loads an item to make it ready to play. But the selected languages for AVMediaCharacteristicAudible and AVMediaCharacteristicLegible are not matching at all with the one specified by the AVPlayerMediaSelectionCriteria set using setMediaSelectionCriteria:forMediaCharacteristic.
I have check that the appliesMediaSelectionCriteriaAutomatically property is equal to YES and when checking mediaSelectionCriteriaForMediaCharacteristic: indeed return the correct selection criteria.

Steps to Reproduce:
The criteria used are initialized by the following code :
    AVPlayerMediaSelectionCriteria * audibleCriteria = [[AVPlayerMediaSelectionCriteria alloc] initWithPreferredLanguages:@[preferredLanguage] preferredMediaCharacteristics:nil];
where preferred language is equal to @"fra" @"qaa" or @"".
Then those criteria are set to the player using 
setMediaSelectionCriteria:myCriteria forMediaCharacteristic:relatedMediaCharacteristic
where relatedMediaCharacterictic is equal to AVMediaCharacteristicAudible or AVPlayerMediaSelectionCriteria

Expected Results:
since the preferred language used is defined using:
[myItem.asset mediaSelectionGroupForMediaCharacteristic:mediaCharacteristic].options
I expected to have the correct language used by the player.

Actual Results:
The used language by the player for both legible and audible media appears to me to be random or for the least not what was expected.


Version:
iOS 9.3.5

Notes:


Configuration:
Ipad : MD7!5NF/B connected on Wifi

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!