feat: add subtitle size and position controls#9120
Conversation
Head branch was pushed to by a user without write access
|
quick update: I submitted the upstream PR to Shaka Player (shaka-project/shaka-player#10077) to add native live hover previews for subtitle settings! I have also updated the PR body for this. |
|
Final update: The PR is merged now :) will make a new PR for integrating this feature when they release 5.2.0 |
|
Just update this PR to have that when 5.2.0 is out? |
Sure I'll make it draft till then |
Pull request was converted to draft
|
hi @aditya0155 thanks for looking into this. I have a concern though because we recently moved allot of the video controls into the player overflow menu because it was getting too crowded. This implementation will make new options available in the overflow when subtitles are enabled. This ironically will introduce the same issue but within the overflow. If we look ahead into the future and add way more configuration for subtitles then it will get way more bloated. Im not sure if it is possible but i would love to see a sub menu for this like how its done on youtube firefox_T7RRnWkjDC.mp4 |
Pull Request Type
Related Issue
Partially closes #968 (check additional context)
Description
This PR brings Shaka’s built-in subtitle style controls directly into FreeTube’s video player.
After this PR, when you’re watching a video, you can tweak the subtitle size and move the subtitles up or down—straight from the player menu. To keep things solid, this uses Shaka’s native
captions-positionandcaptions-sizecontrols.Also, FreeTube saves your preferences. So if you change the subtitle size or reposition them, FreeTube remembers what you picked by saving
fontScaleFactorandpositionAreain yourdefaultCaptionSettings. Next time you watch a video or restart the player, your subtitles will look just how you left them.And to make sure nothing breaks, the app double-checks your saved settings before loading them. If anything is corrupt or doesn’t make sense, the player just skips it and keeps working as usual.
Screenshots
Before:
Before.The.Pr.mp4
After:
After.The.Pr.1.mp4
Testing
150%), and make sure the subtitles actually get bigger.Center Right), and confirm they move over.Desktop
Additional Context
Update on Hover Previews: I’ve sent an upstream PR to Shaka Player (shaka-project/shaka-player#10077) to add live hover previews for subtitle styles. Having this in Shaka itself means FreeTube doesn’t need to change around with the DOM anymore. Once Shaka merges that PR and FreeTube updates its Shaka version, #968 will be natively fixed.
(requiring only a one line configuration toggle in FreeTube to enable the native preview)