I'm facing weird issue of flickering using VideoView
. When activity starts, it causes minor flicker of fraction for a second. Then, video starts. It shows 2 black lines on the top and the bottom of the video. See the snap-shot below.
I have tested my application on 2 devices
1) Samsung n-8000(Tablet)
2) Lenovo a-800
video.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:gravity="center">
<VideoView
android:id="@+id/vvSplash"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#00ffffff">
</VideoView>
</LinearLayout>
Activity code:
private VideoView vd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.video);
vd = (VideoView) findViewById(R.id.vvSplash);
playVideo();
}
private void playVideo() {
Uri uri = Uri.parse("android.resource://" + getPackageName() +"/"+ R.raw.intro);
vd.setVideoURI(uri);
vd.setMediaController(null);
vd.start();
}
Any help would be appreciated. Thank you.