-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[video_player] Fix layout issue caused by Transform.rotate not affecting space calculation.
#8685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
00cdd54
[video_player] using RotatedBox
fa0311 96b33d9
[video_player] update test
fa0311 9de259b
Merge branch 'main' into use-rotated-box
fa0311 960f01c
[video_player] update version
fa0311 5d9b87d
Merge branch 'main' into use-rotated-box
fa0311 6be9577
[video_player] add assertion for rotation to be a multiple of 90
fa0311 5a4ec4f
Merge branch 'main' into use-rotated-box
fa0311 4bea0c6
[video_player] fix test
fa0311 b11717b
[video_player] add assertion for rotation to be a multiple of 90
fa0311 c5131a3
Merge branch 'main' into use-rotated-box
fa0311 5ac9565
[video_player] add assertion for rotation to be a multiple of 90
fa0311 74062cd
[video_player] update CHANGLOG
fa0311 aebd6c4
[video_player] update version
fa0311 6da73c9
Merge branch 'main' into use-rotated-box
fa0311 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
[video_player] using RotatedBox
Signed-off-by: ふぁ <[email protected]>
- Loading branch information
commit 00cdd547171bd712d0c5d23ff5b6df08d76103be
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is silently ignoring any rotation value that's not a multiple of 90 correct? If there are actually cases where this happens, wouldn't silently ignoring them be even more broken than the current behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stuartmorgan
The
rotationvalue in this context can only be 0, 90, 180, or 270 degrees, as most video formats (such as MP4 and MOV) store rotation metadata in 90-degree increments within thetkhd(Track Header) box.For example, in the current Flutter ExoPlayer backend, any value outside this range is ignored:
packages/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/texture/TextureExoPlayerEventListener.java
Lines 67 to 74 in 2d3b24e
Since
RotatedBoxonly supports quarter-turn rotations, this shouldn't be an issue. However, if an unexpected rotation value appears, should we fall back toTransform.rotateinstead of ignoring it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the expectation is that it's impossible for this Dart code to receive values that aren't multiples of 90 degrees, that should be expressed via an assert, not a runtime conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an assert to ensure that only multiples of 90 degrees are allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional statement should be updated to reflect that change as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the conditional statement to reflect the assert change