Add aspect ratio selector to video player#50
Conversation
0533094 to
3d9ff44
Compare
|
Thanks. The feature is a good addition, but I think there is a UI semantics issue here. The aspect ratio selector should be part of the same menu as the existing resize mode selector. In the I would recommend keeping a single display-mode menu:
When one of the aspect-ratio entries is selected, the player should apply that ratio with resize mode set to The reset strategy can remain the same: |
3d9ff44 to
5a093c6
Compare
Fold a forced-aspect-ratio selector into the existing resize button so
there is a single display-mode menu instead of two separate controls:
Fit / Fill / Zoom (resize modes, as before)
──────────
1:1 / 4:3 / 16:9 / 18:9 / 21:9 / Custom… (forced aspect ratios)
Selecting a resize mode applies it, is persisted to last_resize_mode, and
clears any forced ratio (so a ratio can never silently have no effect).
Selecting an aspect ratio applies it with the resize mode set to Fit; this
Fit is per-video and not persisted, so the saved resize mode is restored
on the next video while the forced ratio resets per video. Custom accepts
'16:9', '16/9' or '1.78'. Useful for videos uploaded with wrong
proportions (e.g. 4:3 content stretched to 16:9). Hidden in the popup
player, like the resize button.
The two groups are separated with a menu divider, and the currently
active entry is checked (the resize mode when no ratio is forced, the
matching ratio otherwise, or Custom for a non-preset value); the menu is
rebuilt on each open to keep the checkmark in sync.
5a093c6 to
fb263d5
Compare
|
Thanks for the review — makes sense, fixed. There's now a single display-mode menu opened from the resize button, no separate control: Fit / Fill / Zoom
Also added a divider between the two groups and a checkmark on the currently active entry. |
What
Adds an aspect ratio selector to the main video player, next to the existing resize mode (FIT/FILL/ZOOM) button.
16:9,16/9or decimal1.78inputWhy
Some videos are uploaded with wrong proportions (typically old 4:3 content stretched to 16:9, or anamorphic video without proper metadata). The resize modes can't fix that — they change how the video fits the screen, not the picture's own proportions. Forcing the correct ratio is the only way to watch such videos undistorted. VLC and MX Player offer the same control.
Behavior details
onMetadataChanged, which only fires when the stream URL actually changes).