Closed EJohnF closed 2 years ago
I tried another version - react-native-video 2.2.0 (with MediaPlayer on Adnroid) and naturalSize become correct { orientation: 'portrait', height: 1280, width: 720 }, 'http://tiney-chat-attachment-qa.s3-website.eu-west-2.amazonaws.com/e974448c-215e-49a6-8238-e7d1d3d543f1.mp4'
Hello,
I think the problem is kind of related to this one
I also have this problem with the player which shows a portrait video with a wrong orientation.
The onLoad event returns width : 1280 height : 720 orientation : landscape
Because it only compares width > height.
I adapted the code from the PR above to return the right orientation so I can at least set the right size for the container. But it seems the true problem for the wrong orientation comes from somewhere else.
This package's ExoPlayer implementation sources the naturalSize
from the React container dimensions, whereas the MediaPlayer implementation actually pulls from the video. Somebody could submit a PR to the ExoPlayer side to address this. Some helpful guidance here
Any Solution?
Current behavior
onLoad returns wrong naturalSize
Reproduction steps
strait usage of component
in onLoad function, put console. Results (NaturalSize && url): { orientation: 'landscape', height: 720, width: 1280 }, 'http://tiney-chat-attachment-qa.s3-website.eu-west-2.amazonaws.com/e974448c-215e-49a6-8238-e7d1d3d543f1.mp4'
it (or maybe it's another unrelated problem?) - wrong orientation in fullscreen https://yadi.sk/d/-rJ78MH45qt33A
Expected behavior
should be portrait orientation with swiped height/width
Platform
Which player are you experiencing the problem on:
Video sample