Repository navigation
fix: fit video inside the screen, refit on rotation (#17, #31) - #49
Merged
Merged
Conversation
PR Summary by QodoFit video within the screen and refit after resizing
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab) |
2 of 15 tasks
The view width was derived from the screen height only, so on screens narrower than the stream (16:10 and 4:3 tablets) the left and right edges were cut off (fixes #17). - fitInside() picks the largest size with the stream's aspect ratio that fits in the container (letterbox or pillarbox). - A layout-change listener on the root refits the video when the container size changes: rotation, multi-window, and Android 16 ignoring the fixed landscape orientation on large screens (fixes #31). - Zoom is reset on refit, since it depends on the view size.
compot-dev
force-pushed
the
fix/video-fit
branch
from
October 12, 2026 15:00
f9485ea to
53674cb
Compare
Collaborator
Author
|
Device-tested (#53): on an emulated 4:3 screen ( |
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.
Fixes #17, fixes #31.
fitInside(): the largest size with the stream's aspect ratio that fits inside the container. A narrower screen gets black bars top and bottom, a wider one left and rightOnLayoutChangeListenerrefits the video whenever the container size changes: rotation, multi-window, a resized windowZoom is reset on refit, because it depends on the view size.
Tests
VideoFitTest: same aspect ratio; 16:9 on 16:10 and on 4:3; 4:3 on 16:9; 21:9; portrait screen; never larger than the box.assembleDebugandlintDebugpass.Device checklist
Independent of #48. Both touch
Decoder.java, but in different places.