Mirror jellyfin-web's Subtitle Appearance panel into mpv - #584
Open
ankitpasayat wants to merge 6 commits into
Open
Mirror jellyfin-web's Subtitle Appearance panel into mpv#584ankitpasayat wants to merge 6 commits into
ankitpasayat wants to merge 6 commits into
Conversation
mpv renders subtitles, so Jellyfin-web's built-in subtitle text-size control has no effect in the desktop app. Add a "Subtitle Size" dropdown (Small/Normal/Large/Larger/Huge) under Playback settings that drives mpv's sub-scale property. - Persist subtitleScale like the other app settings (config round-trip through overlay_json/to_json/cli_json). - Apply live on change (re-renders the current video) and restore the saved value once at startup. - Set sub-ass-override=scale at boot so the size also reaches ASS/SSA subtitles while preserving the rest of each script's styling.
mpv's sub-scale=1.0 (Normal) renders larger than jellyfin-web's own Normal, so re-center the Subtitle Size ladder (Small 0.35 / Normal 0.5 / Large 0.75 / Larger 1 / Huge 1.5) and lower the app default to 0.5, applied at startup even when the value is unset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Set mpv sub-pos=95 so subtitle vertical placement matches the jellyfin-web client's fullscreen position. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New mpv sub-* setters (sub-pos, sub-bold, sub-color, sub-back-color, sub-font, sub-border-size, sub-shadow-offset) plus non-persisted apply_setting_value keys that drive them, so subtitle appearance can be pushed from the web layer straight to mpv. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Advertise the subtitleappearancesettings capability so jellyfin-web shows its Subtitle Appearance panel in the desktop app (mpv, not HTML, renders subs so it is normally hidden). Read that panel from localStorage and map every field - size, text color, weight, font, vertical position, drop shadow, background - to mpv sub-* properties on each playback. Font tokens map to real Windows families. Removes the now-redundant Client Settings Subtitle Size dropdown; the web panel is the single source of truth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ankitpasayat
force-pushed
the
subtitle-size-setting
branch
from
July 28, 2026 14:03
1ba7c48 to
69ee2de
Compare
Author
|
Rebased onto current |
Read the logged-in user's localplayersubtitleappearance entry instead of the first match (a shared device holds one per user), push explicit mpv defaults for color/position/font when a panel field is unset so resetting a field or switching users takes effect without a restart, and drop the now-unread subtitleScale entry from jmpInfo settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In the desktop app, mpv renders subtitles, bypassing jellyfin-web's HTML/CSS subtitle renderer. As a result:
appHost.supports(SubtitleAppearance)("subtitleappearancesettings"), which the native shell didn't advertise.So there's currently no way to adjust subtitle appearance in the desktop client. Closes #583; relates to #182 (size) and #47.
What I'm suggesting (this PR)
Reuse jellyfin-web's own Subtitle Appearance panel instead of adding bespoke UI:
subtitleappearancesettingscapability from the native shell, so jellyfin-web shows its existing Settings → Subtitles → Subtitle Appearance panel in the desktop app.sub-*properties:sub-scalesub-colorsub-boldsub-font(token → real family)sub-possub-border-size/sub-shadow-offsetsub-back-colorNew mpv setters live in
jfn_mpv::api; a non-persistedapply_setting_valuedispatch pushes each field, since the web panel'slocalStorageis the source of truth.What I got
The full jellyfin-web Subtitle Appearance panel now drives mpv subtitles live in the desktop app — size, color, weight, font, vertical position, and drop shadow.
Relationship to #535
#535 (open, by @Sheeplet1) adds subtitle size + bold via a custom Client Settings dropdown and resolves #182/#47. This PR overlaps on those two fields but sources every appearance field from jellyfin-web's own panel instead of adding new UI.
This PR is reviewable as-is. If you'd prefer to land #535 first, I'll rebase on top of it and drop the overlapping size/weight handling here — no decision needed before review.
Testing
main:cargo fmt --check,cargo checkon the touched crates, workspacecargo clippy --all-targetswith the repo's-Dflags, and thejfn-configunit tests pass on Linux. The Windows end-to-end run predates the rebase and the follow-up hardening commit (per-user localStorage read + unset-field resets, JS-only).Caveats / open questions
<userId>-localplayersubtitleappearance…localStorage key and the panel's value vocabulary; a future jellyfin-web change could shift these. Guarded with a regex key match + fallbacks, but I'd value a maintainer's view on whether this coupling is acceptable vs. a self-contained settings set.