2

I have a problem with VideoView and ViewPager swiping action. While swiping I can see black lines on the right or left side of VideoView (depends on side of swiping) . How can I deal with this.

It was done using FragmentStatePagerAdapter and ViewPager. Parent Activity has SurfaceView with 0px width and height and set getWindow( ).setFormat( PixelFormat.TRANSLUCENT ); I'm adding VideoView from JAVA code.

screen one screnn two

xAqweRx
  • 1,236
  • 1
  • 10
  • 23

2 Answers2

2

VideoView is based of Surfaceview which is not very ideal for translation and other behaviours. and much more suited to full screen video players that are static in layout. What you are looking for is textureview based videoview. Try searching library on github.

jay shah
  • 903
  • 6
  • 21
  • I used this library https://github.com/sprylab/texturevideoview/blob/master/library/src/main/java/com/sprylab/android/widget/TextureVideoView.java#L1 worked pretty well – Aniruddha K.M Jan 30 '17 at 09:18
0

you could try setting the background of the videoview to transparent.

videoView.setBackgroundResource(android.R.color.transparent);
Rockney
  • 10,380
  • 2
  • 20
  • 26