Skip to content

Automatically show closed captioning/hard of hearing track based on accessibility settings #5749

@sobbe81

Description

@sobbe81

Hi,

I'm using ExoPlayer for playback of DASH-content. I'm looking for a way to

  • Pick a certain language as default for subtitles, now done by using setPreferredTextLanguage
  • Pick cc/hard of hearing track if this setting in accessibility settings is enabled.

The DefaultTrackSelector has an API to setPreferredTextLanguage which works fine for displaying subtitle tracks.

However, my app needs to support both subtitles and closed captions and my problem is that if I use setPreferredTextLanguage it will always display the closed captions since these are using the same language code.

The CaptioningManager, https://developer.android.com/reference/android/view/accessibility/CaptioningManager, offers an API to read accessibility settings. From what I understand, ExoPlayer uses this setting to determine the styling of the closed captions but not to determine whether text should be shown or not.

Is there any way to get the ExoPlayer automatically enable closed captioning based on accessibility settings? And that setPreferredTextLanguage only applies to subtitles and not closed captions?

Thanks,
Martin

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions