king_below_my_lord
king_below_my_lord

Reputation: 682

How to flip(mirror effect) a video in a VideoView?

I know there are ways using TextureViews and some other ways, but can we do a video flip in a VideoView, I tried using the method scaleType of X axis to -1, but just getting a black screen. Is there no way to do a simple video flip for a video being played in a videoview? Am I forced to use a TextureView or other methods?

Upvotes: 7

Views: 5222

Answers (1)

Alvaro
Alvaro

Reputation: 1448

As you said, the best option is to use TextureView... Android's VideoView can only play videos straight and not mirrored.

If you want your app to play a video mirrored (for instance if the video was recorded using a front camera), you will need to use a TextureView, which can be easily mirrored by specifying android:scaleX=-1 in the XML file, or textureView.setScaleX(-1) in the code. (source)

Upvotes: 11

Related Questions