[ios][av] Fix the orientation in onReadyForDisplay callback. (#10449)# Why In our app, we're trying to render video previews & chat bubbles with videos in them, and the orientation data on iOS i
[ios][av] Fix the orientation in onReadyForDisplay callback. (#10449)# Why In our app, we're trying to render video previews & chat bubbles with videos in them, and the orientation data on iOS is incorrect. For videos that have been recorded in portrait mode, the orientation is always returned as `landscape`, and the width/height remain as if the video were actually in landscape. As such, it is impossible to detect the correct orientation, and correctly size a box that should contain a portrait video. (On Android, the rotated size is returned as expected.) Inspecting one of the broken videos using `ffprobe` indicates that the video stream itself is in landscape, but a 90 degree rotate transform has been applied. This seems to be the default behavior on both the Android & iOS cameras. The current code for checking the orientation is difficult to follow -- it seems to check whether the transform matrix contains a translation, rather than actually checking for rotation. (A similar trick is described in [this Stack Overflow thread](https://stackoverflow.com/questions/4627940/how-to-detect-if-a-video-file-was-recorded-in-portrait-orientation-or-landscape)) Intuitively, it makes more sense to actually apply the transform matrix, and then to check whether the resulting size is in portrait or landscape. (**Note:** A similar change should possibly also be added to [expo-image-picker's width/height code here](https://github.com/expo/expo/blob/master/packages/expo-image-picker/ios/EXImagePicker/EXImagePicker.m#L418-L421).) # How - Apply the `AVAssetTrack`'s `preferredTransform` to its `naturalSize`. - If the resulting width is less than the height, the video is in portrait. # Test Plan - Add a `portrait_video.mp4` file, which is a rotated version of one of the other sample video files. This file was created using `ffmpeg -i small.mp4 -map_metadata 0 -metadata:s:v rotate="-90" -codec copy portrait-video.mp4`, and verified using `ffprobe`, and by playing it. - Add a test for "correctly detects portrait video". - Also check in the existing test that the expected video is landscape.
show more ...
[expo-image-manipulator] Convert ImageManipulator into universal module (#3245)* [expo-image-manipulator] Move image-manipulator into universal module * [expo-image-manipulator] Adjust docs, str
[expo-image-manipulator] Convert ImageManipulator into universal module (#3245)* [expo-image-manipulator] Move image-manipulator into universal module * [expo-image-manipulator] Adjust docs, structure, add tests & refactor slightly * [expo-image-manipulator] Fix enums case * [expo-image-manipulator] Add changelog entry * [expo-image-manipulator] Remove unnecessary class extending
Move test-suite into the Expo repo under appsThis moves test-suite into the Expo repo, setting things up so that CI can verify changes to modules using test-suite.Tested by loading and running te
Move test-suite into the Expo repo under appsThis moves test-suite into the Expo repo, setting things up so that CI can verify changes to modules using test-suite.Tested by loading and running test-suite with `expu start` for now. Also will check that our CI passes since there are some dependencies on test-suite (e.g. publishing it). Before merging, the shipit bot needs to be redeployed as well and may need some manual repo editing inside its container.fbshipit-source-id: 144e1bd