I am currently developing an App specifically for android's GoogleTV devices where using or forcing the orientation of the app to anything other than landscape is not enabled, and will not be enabled in the future from what i have figured, in actuality the app simply crashes upon trying to run setRequestedOrientation()
;
Videoviews inherit the positional properties from normal views, Stuff like SetX
, SetY
and namely SetRotation
.
You can set the videoview's rotation to 90 degrees, but the actual videobuffer will NOT rotate.
I've tried everything from using the old mediaplayer > surfaceview.getHolder().lockcanvas().rotate(degrees)
in every way imaginable, to overwriting the onDraw
method of a custom videoview that extends the normal class, none of which i could get working successfully.
In a nutshell, How can i rotate the ACTUAL video within the videoview, without changing the device's orientation? if you have a working example of a rotated videoview with the contents of it also rotated please do explain how you got it working.
Thanks in advance.
I'd like you to note that we're developing for android 3.1 and also that everything so far has been coded dynamically, all imageviews and videoview are created through code, only the specific Layouts that we use for Z indexing items have been defined in the layout.xml
file.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With