[video_player_avfoundation] Applies the standardized transform for videos with different orientations#5069
Conversation
e8cf3ac to
a80dd47
Compare
|
/cc @jmagman Would a test like: Test if |
a80dd47 to
7c1211e
Compare
75aa03b to
f984752
Compare
|
The current test only tests with the existing video's transform in the new case. If we want to cover more cases, we might need another video for this test. |
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Outdated
Show resolved
Hide resolved
|
Can you confirm that the reproduction case in flutter/flutter#17606 is not regressed? |
This fix does not change the orientation of videos, since it does not manipulate with |
|
I didn't get the time to make screenshots, but based on the comment at fluttercandies/flutter_photo_manager#685 (comment), all cases are well addressed. |
|
@AlexV525 I checked out your code and replaced the example remote url to https://squiredev.com/golf.mp4, but still got the same issue |
@hellohuanlin Did you override the avfoundation to the local path in the example? With the video you provided, I got the correct display on my device. D997FCCE6F3C744B4D0C156E09188EFE.mp4 |
Not sure what you mean by "override the avfoundation to the local path. can you share the code? |
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
Outdated
Show resolved
Hide resolved
In dependency_overrides:
video_player_avfoundation:
path: ../../video_player_avfoundation |
This comment was marked as duplicate.
This comment was marked as duplicate.
5483df7 to
a91fa2c
Compare
|
I've done a further investigation about what is the |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Sorry, I hit the wrong button with my last comments; they were intended to be "request changes" not "approve", as I don't think this has sufficient test coverage.
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
Show resolved
Hide resolved
a91fa2c to
d45e721
Compare
packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
Outdated
Show resolved
Hide resolved
| * on iOS 14 and above. This method provide a standardized transform | ||
| * according to the orientation of the track. | ||
| */ | ||
| static CGAffineTransform FLTGetStandardizedTransformForTrack(AVAssetTrack *track) { |
There was a problem hiding this comment.
A static function is internal to the compilation unit (this file), so can't be access from the test. You need a public declaration of this in a header, just as you do for ObjC classes you want to use in other files.
You should have a separate AVAssetTrackUtils.h and AVAssetTrackUtils.m where you declare and implement this, just as you did when you had it as a category, just using a (non-static) function like this instead of a category.
There was a problem hiding this comment.
Thanks! That helps a lot
| /** | ||
| * Note: https://stackoverflow.com/questions/64161544 | ||
| * `AVAssetTrack.preferredTransform` can have wrong `tx` and `ty` | ||
| * on iOS 14 and above. This function provides a standardized transform |
There was a problem hiding this comment.
oh just double check - have you tested both iOS 14+ and earlier OS version?
There was a problem hiding this comment.
Sorry I can only and have tested this on iOS14+...
There was a problem hiding this comment.
let me try it on earlier OS. could you please hold this PR for now?
There was a problem hiding this comment.
let me try it on earlier OS. could you please hold this PR for now?
Sure. Thanks!
There was a problem hiding this comment.
Tested on iOS 13.7 and it worked. I am curious where is this "iOS 14 and above" coming from?
There was a problem hiding this comment.
this one: "used to be broken and now is working"
There was a problem hiding this comment.
let me try iOS 12 too
There was a problem hiding this comment.
Let me update the comment then.
it shows a blank video on iOS 12.4. Same result with or without this fix.
Maybe we can file another issue to track this?
There was a problem hiding this comment.
sounds good if you think it's unrelated.
packages/video_player/video_player_avfoundation/ios/Classes/AVAssetTrackUtils.h
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/ios/Classes/AVAssetTrackUtils.h
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
Outdated
Show resolved
Hide resolved
eb0fb1d to
b801da1
Compare
…orm for videos with different orientations (flutter/plugins#5069)
* master: (153 commits) Roll Flutter from fd360c4 to ef5a6da (1 revision) (flutter#5298) [video_player_avfoundation] Applies the standardized transform for videos with different orientations (flutter#5069) Roll Flutter from 3752fb7 to fd360c4 (2 revisions) (flutter#5295) Roll Flutter from 3c4d7a1 to 3752fb7 (11 revisions) (flutter#5294) Add owners for Android implementations (flutter#5293) Roll Flutter from f4875ae to 3c4d7a1 (2 revisions) (flutter#5292) [video_player_web] Stop buffering when browser canPlayThrough. (flutter#5068) Roll Flutter from aa5d7b6 to f4875ae (1 revision) (flutter#5289) Roll Flutter from 44be0b8 to aa5d7b6 (12 revisions) (flutter#5286) Roll Flutter from ec8289c to 44be0b8 (2 revisions) (flutter#5284) Roll Flutter from 329ceae to ec8289c (26 revisions) (flutter#5283) [flutter_plugin_tools] Preserve Dart SDK version in all-plugins-app (flutter#5281) [webview_flutter_wkwebview] Implements the `HostApis` and methods for the `CookieManager`. (flutter#5244) [webview_flutter_wkwebview] Implement `WKNavigationDelegate.didFinishNavigation` as a proof of concept for callback methods (flutter#5199) Roll Flutter from 08e467d to 2b83332 (5 revisions) (flutter#5270) Roll Flutter from e2d1206 to 08e467d (1 revision) (flutter#5268) Roll Flutter from ff9d6e5 to e2d1206 (2 revisions) (flutter#5266) Roll Flutter from 0575932 to ff9d6e5 (1 revision) (flutter#5265) [local_auth] Refactor package to make use of new platform interface and native implementations (flutter#4701) Roll Flutter from cb968c5 to 0575932 (1 revision) (flutter#5263) ...
…orm for videos with different orientations (flutter/plugins#5069)
…deos with different orientations (flutter#5069)


Fixes flutter/flutter#71299.
Changes:
FakeAVAssetTrackin the test.UIImageOrientation.Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).