3

Problem:

When an iPad/iPhone have Settings/General/Accessibility/Closed Captioning + SDH enabled closed captioning cannot be disabled using selectMediaOption:inMediaSelectionGroup:. When this device setting is disabled, closed captioning can be enabled/disabled within the application using selectMediaOption:inMediaSelectionGroup:. Adding self.player.view.player.appliesMediaSelectionCriteriaAutomatically = FALSE; made no difference in the observed behavior of the application.

What’s interesting about this issue is that sometimes the application is successful enabling/disabling captions. At other times it isn’t.

If the device setting is expected to always override application settings, then I’d expect the behavior to be consistent, i.e., the application would never be able to override the device settings.

My questions are:

  1. Is it expected to be possible for an application to be able to override the device's closed captioning settings?
  2. If the application is allowed to override the device settings how can this be accomplished in a deterministic way (vs. the non-deterministic behavior I'm seeing)?

Observations:

Logging the values provided to selectMediaOption:inMediaSelectionGroup:, as well as the before/after values of the associated settings, shows the expected results. I.e., the arguments provided to the function are correct and the effect on the underlying settings are what is expected.

The logs show the following when captioning is expected to be disabled:

  1. The value for the option provided to the function is null as expected
  2. The current value for the AVMediaSelectionOption is <AVMediaSelectionKeyValueOption: 0x28188fb00, language = (null), mediaType = 'clcp', tagged media characteristics = {public.accessibility.transcribes-spoken-dialog, public.accessibility.describes-music-and-sound}, default = YES>
  3. The value of AVMediaSelectionOption after calling selectMediaOption:inMediaSelectionGroup: is null

The logs show that the reverse is true when enabling Closed Captioning.

Related posts:

Rich
  • 658
  • 1
  • 9
  • 18

1 Answers1

1

While not exactly an answer, I was able to track the cause of the problem. I'm using an external library for most, but not all, of the AVPlayer interactions. It turns out that it has a similar capability that interferes with the AVPlayer behavior. Interestingly enough, if I call the AVPlayer function (e.g., selectMediaOption:inMediaSelectionGroup:) and the associated function in the external library, it works. Neither function works on it's own, both have to be called.

Rich
  • 658
  • 1
  • 9
  • 18
  • Thanks for the reply. Can you give me some sample code so that i can check. and which external library i need to use for this. – Raxit Pandya Jun 05 '19 at 04:37