Showing posts with label TextureView. Show all posts
Showing posts with label TextureView. Show all posts

Friday, February 7, 2014

Using Android's TextureView to Display Video Mirrored

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.

Here is a code sample for playing video using TextureView, with the option of displaying the video mirrored: