Use this method to stretch your videoview in onCreate() method of your activity
mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);
To handle onConfigurationChange();
use below code
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);
Log.e("On Config Change", "LANDSCAPE");
} else {
mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);
Log.e("On Config Change", "PORTRAIT");
}
}
also add this in your activity menifest file
android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"