In my application i have closed caption settings and i am using AVPLayer to play video/live content without showing default controls. In my app i can able or disable closed captions like switch based on that switch status i am storing BOOL value in userdefaults. Based on userdefaults i am trying to enable or disable cc for avplayer using below api.
[self.player setClosedCaptionDisplayEnabled:enable];
Now problem is Even if i off cc in app but iphone system settings cc enabled that time i am getting cc in avplayer. If i off system cc then my app settings are effecting in avplayer.
Can you please suggest is there any way to bypass system settings for avplayer. If cannot can you please provide apple document link to show as a proof to clinet that we cannot do this like that.
You should set
Instead of this, which is deprecated.
EDIT
This method will be used:
@method setMediaSelectionCriteria:forMediaCharacteristic:
@abstract Applies automatic selection criteria for media that has the specified media characteristic.
@param criteria An instance of AVPlayerMediaSelectionCriteria.
@param mediaCharacteristic The media characteristic for which the selection criteria are to be applied. Supported values include AVMediaCharacteristicAudible, AVMediaCharacteristicLegible, and AVMediaCharacteristicVisual.
@discussion Criteria will be applied to an AVPlayerItem when:
a) It is made ready to play
b) Specific media selections are made by -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] in a different group. The automatic choice in one group may be influenced by a specific selection in another group.
c) Underlying system preferences change, e.g. system language, accessibility captions.
Specific selections made by -[AVPlayerItem selectMediaOption:inMediaSelectionGroup:] within any group will override automatic selection in that group until -[AVPlayerItem selectMediaOptionAutomaticallyInMediaSelectionGroup:] is received.
Documentation for the same is here