androidx / androidx/media

Custom subtitle outline width

Open
#1,834 1 comment 0 reactions 1 assignee View on GitHub

@icbaker is already working on this.

Since Oct 28, 2024.

enhancement low priority
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Use case description

Subtitle edge (text outline) is an important part of accessibility to make text readable. However the current implementation hardcodes this to twoDpInPx and on some devices like some TV screens, this might be very small and make text unreadable. There is currently no API surface nor internal method accessible via reflection to change the subtitle outline width.

Proposed solutions/Alternatives considered
  1. Allow for some sort of modification of this via CaptionStyleCompat. I know this might not be possible due to android.view.accessibility.CaptioningManager.CaptionStyle. But honestly, this restriction is makes no sense if I as an app developer want to deliver an specific experience.
  2. Change this to Sp. Why is it even in Dp to begin with? The android docs specifically calls Sp when text is involved. https://developer.android.com/training/multiscreen/screendensities
  3. Allow for cues to modify this so we can modify the text style in SubtitleParser.
  4. Allow for custom subtitle painters/subtitle views. Right now the subtitle view is directly set to R.id.exo_subtitles and is a final SubtitleView, meaning that there is no possible way to modify the subtitle rendering after parsing it.
  5. Insert a hidden reflection method/mark as non final. Even with reflection this property is currently impossible to modify as it is marked as private + final. Just adding a hidden method or marking this as non final would fix this. It is impossible to modify this one variable without forking the entire repository.

Note, this is a resubmission of https://github.com/google/ExoPlayer/issues/10507 but exoplayer has been marked as deprecated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.