Android Question [SOLVED] How to Rotate a Video by 90 Degrees Using ExoPlayer in B4A

jroriz

Active Member
Licensed User
Longtime User
I’m using ExoPlayer in my app and need to rotate the video 90 degrees. I placed the player inside a Panel and rotated the Panel, but the video did not follow the rotation.
This rotation is necessary because the app will run on a TV Box connected to a vertically positioned monitor.

I also tried using EasyVideoPlayer (here), but I couldn't get it to work properly. Since I wasn’t sure if it would allow rotation, I gave up on that approach.

Now, my main issue is finding a way to play a video rotated 90 degrees in ExoPlayer. Any suggestions?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

The example shows how to flip the video. In your case you just need to call TextureView.As(B4XView).Rotate = 90
 
Upvote 0

jroriz

Active Member
Licensed User
Longtime User

The example shows how to flip the video. In your case you just need to call TextureView.As(B4XView).Rotate = 90

Solved!


A few observations:
  1. There is a minor error:  
    Instead of:   TextureView.As(B4XView).Rotate = 90
     It should be:   TextureView.As(B4XView).Rotation = 90
  2. The property TextureView.As(B4XView).Rotation only worked for negative values. For example, -90 worked, but 90 did not.
  3. Rotating the panel itself achieves the desired effect, including for positive rotations.

Thank you very much!
 
Upvote 0
Top