Reputation: 917
With LG MS840, if I take a video in lanscape orientation, then display it in a VideoView, it looks same to what it used to be.
However if a take a video in portait orientation, then display it in VideoView, the video's width and height will be swapped and the image will be scaled to fit that swapped size.
For example, if an image in the video I took is:
------- | A| | | | | | | |B C| -------
The image in the recorded file still is:
------------ | A C | | | | B | ------------
Since when the video size is reported the rotation has been considered, what I saw is:
------- |A C| | | | | | | | B| -------
Any clue how this could be fixed?
Upvotes: 1
Views: 682
Reputation: 6103
VideoView does not support rotation of video even if composition matrix is set correctly and rotation attribute is used.
What you can do is to use TextureView and set its attribute rotation="90" (for example). It then will rotate the frames but the aspect ratio is something that you need to handle your self. In order to do so you can use textTureView.setScaleX((screenHeight * 1.0f) / screenWidth)
More details are here: Rotating an android VideoView
Upvotes: 1