1

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?

tactoth
  • 897
  • 1
  • 12
  • 24
  • Is this only in LG phones? Did you import the file to your PC to check? – Reno Jan 25 '13 at 06:35
  • @Reno yes, it's only in LG phones. The video play well on my PC. – tactoth Jan 25 '13 at 06:39
  • have you declared orientation changes in activity in manifest file and how are you handling runtime changed in code , on orientation change you will need to redraw canvas or either u need to set change video holder to fit your video width and height . – Vipin Sahu Jan 25 '13 at 06:41
  • no.. I mean to play the video, not to record it. – tactoth Jan 25 '13 at 06:57

1 Answers1

1

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

Community
  • 1
  • 1
Cynichniy Bandera
  • 5,991
  • 2
  • 29
  • 33
  • Ye, this not solve, how does youtube (smarthphone) ?, I start video and rotation is so fluid –  Oct 02 '15 at 06:22