Skip to content

feat: add subtitle style controls - #9723

Closed
aditya0155 wants to merge 1 commit into
FreeTubeApp:developmentfrom
aditya0155:feat/shaka-subtitle-style-controls-v2
Closed

feat: add subtitle style controls#9723
aditya0155 wants to merge 1 commit into
FreeTubeApp:developmentfrom
aditya0155:feat/shaka-subtitle-style-controls-v2

Conversation

@aditya0155

@aditya0155 aditya0155 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Feature

Related Issue

Closes #968
Closes #5072

Description

continuation of #9120

This PR adds subtitle size and position controls to FreeTube's Shaka video player.

When subtitles are enabled, the player menu includes Subtitle Size and Subtitle Position controls. Users can
change the subtitle size and position directly from the player menu.

This PR updates Shaka Player to version 5.2.8, which includes subtitle preview support from my PR shaka-project/shaka-player#10077.

When users hover over or focus an option with the keyboard, they can preview the change without saving it. Changes are saved only after an option is selected.

FreeTube saves the selected subtitle size (fontScaleFactor) and position (positionArea) in defaultCaptionSettings.
Settings stay the same when the player restarts or you watch another video. Other caption settings are not changed.

Saved values are validated before they are applied. Invalid values are ignored safely.

Testing

Before:

Before.1.mp4

After:

After.1.mp4
  1. Open a video with subtitles and enable them.
  2. Open the player menu and confirm Subtitle Size and Subtitle Position are visible.
  3. Check that both controls work and preview changes on hover/focus.
  4. Select a size and position, then confirm they persist after opening another video.
  5. Reopen the menus and confirm the selected options are checked.
  6. Test without subtitles and confirm the controls are hidden.
  7. Confirm both controls also appear in the context menu.

Desktop

  • OS: Windows
  • OS Version: 11
  • FreeTube version: 0.25.3

Additional Context

The hover and keyboard-focus subtitle previews were added upstream in [shaka-project/shaka-player#10077](https://
github.com/shaka-project/shaka-player/pull/10077), which has been merged and is included through the Shaka Player
5.2.8 upgrade in this PR.

The controls use Shaka Player's built-in captions-size and captions-position elements. This keeps the
implementation aligned with Shaka's released UI and preview behavior.

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 31, 2026 11:40
@github-actions github-actions Bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Aug 31, 2026
@radmorecameron

Copy link
Copy Markdown
Member

Due to some of the changes in Shaka-player 5.2.x, I believe #9487 will need to be merged before this PR

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have still the same concerns as in #9120 (comment) even though its now only showing when subtitles are enabled.

The size of the overflow will expand allot when all the controls are added

Due to some of the changes in Shaka-player 5.2.x, I believe #9487 will need to be merged before this PR

Yup, reviewing this will be on hold

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@aditya0155

aditya0155 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@efb4f5ff-1298-471a-8973-3d47447115dc hey, I'll love to know some opinions how to continue this:

  1. I can add submenu support to Shaka Player first, then update this PR after Shaka releases it. This is the cleanest option, but it may take around 3-5 months because shaka will take time to release.

  2. I can make a FreeTube only subtitle settings menu. Shaka’s built-in subtitle size and position controls cannot be placed inside one submenu without making it fragile so I can make a FreeTube only subtitle settings menu instead like:

More
├─ Captions
└─ Subtitle style >
├─ Size
└─ Position

so it will keep menu smaller and give space for more subtitles options later

  1. We can merge the current version with the separate size and position options, and I can work on the Shaka submenu later by add generic submenu support in Shaka Player first.

@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

I would opt for option 1. Also their next minor release is closer then you think based on historical release data

@aditya0155

Copy link
Copy Markdown
Contributor Author

okay I'll start working for adding support to Shaka Player first

and I think it might take a bit time so I should close this PR and open a new one later

@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

so I should close this PR and open a new one later

Sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: blocked PR: dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Ability to move captions Subtitle settings - Show example text to present selected choices

3 participants