clapper
clapper copied to clipboard
Feature request: constrain window to video aspect ratio
It would be nice to be able constrain the window to the video's aspect ratio when manually resizing.
I always wanted to have the resize work like that, but it is not easy to achieve in GTK apps. If I am not mistaken other GTK video players don't have that ability either (totem
and celluloid
).
I would prefer to have the video rendering widget merged into GStreamer
first, cause it might require some changes to get working what you ask for. Now that GTK 4.0 is released (and considered stable API), I will work towards having that updated and merged.
A user provided a video with this demonstration.
I think that we can do something similar here for this functionality and make it an opt-in in preferences. So when enabled in Clapper prefs, after user finishes dragging the window to such-and-such size (with black borders), Clapper window automatically resizes itself to best possible (nearest) size for played video, reducing its size by borders amount (with fluid animation, like we have for show/hide bottom panel when clicking PiP button).
That would be great.
This would be really nice. Firefox's PiP window is able to keep a set aspect ratio, maybe looking at that implementation could help?
Besides the whole "preserve aspect ratio while the user is resizing" idea, I think a good first step would be to have clapper auto-size the window to the correct size and aspect ratio when it is launched directly with a video file (i.e. by Nautilus).
If the window is already in the correct aspect ratio, and auto-sized to fit most needs (i.e. look a the video's resolution vs the screen resolution, and try to fill maybe 80% of the screen if the video's resolution isn't too low) from the start, then it would already do most of the job and the user wouldn't even need to resize in most cases.
This could be done independently as a first step, before a (more complicated) solution is found for constraining.