You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subtitle size/position computed from player view bounds, not displayed video rect (orientation-dependent sizing, cues in letterbox) #32
Parity follow-up from the silo-apple subtitle geometry work: on Android, subtitle text size and position are computed against the full player view bounds, not the displayed video rectangle. The Apple clients had the same class of bug (font tiny in landscape, huge in portrait, subs rendered in the letterbox area) and fixed it by sizing/positioning the subtitle overlay to the aspect-fitted video rect.
Media3's SubtitleView measures fractional text size against its own height, and PlayerView lays the subtitle view across the whole PlayerView, not the AspectRatioFrameLayout content frame. Consequences (mainly the phone app, where orientation changes the view aspect):
Portrait fullscreen with a 16:9 video: the view is much taller than the displayed video, so the same preset renders much larger relative to the video than in landscape, and subtitles/bottom padding land in the black letterbox area below the video instead of inside the frame.
Landscape: sizes are computed against the (video-matching) view height, so it looks right — which makes the portrait discrepancy feel like random inconsistency to users.
The TV app is mostly immune in Fit on 16:9 content, but Zoom/Stretch and non-16:9 content still shift the relationship between view height and video height.
What Apple did (for reference)
Compute the displayed video rect (aspect-fit of the video size into the surface bounds) and size/position the subtitle overlay to that rect, so subtitle scale follows the video, is orientation-invariant, and cues render inside the video frame. silo-apple commits 22a1567, 71e275a, cfd4658 (branch subtitles); the helper is a trivial AVMakeRect-style aspect-fit.
After switching to video-relative sizing, the preset ladder needed rebasing (~1.4x) so "Large" visually matches the old "XX-Large". Expect the same: if SubtitleView is laid out to the video rect, retune fractionalSizeFor so the presets visually match the Apple clients (and roughly Plex) at each step. Note SubtitleFontSizePreset.pointSize in shared/.../SubtitleAppearance.kt:17-24 appears unused on Android and is now out of sync with Apple's rebased ladder — either align or remove it.
Suggested approach
Listen for video size / aspect changes (PlayerView already manages AspectRatioFrameLayout), compute the aspect-fitted video rect for the current resize mode, and constrain the SubtitleView layout to that rect (respecting Zoom/Stretch by falling back to full bounds, matching the Apple behavior for fill gravity). Then retune the fractional presets against the Apple/Plex reference.
Activity
zZebrahz commentedon Jul 3, 2026
I can handle this later, was just filing a note
Quick104 commentedon Oct 31, 2026
Fixed by #127, merged on 2026-07-28. Reopen if you still see this on a build that includes it.