In my program im trying to have video in full screen but without break aspect ratio of the playing video ,
in android default player it has button in upper left corner when you press it it shift video to full view without distortion of video which maintain aspect ratio:
as image below :
im try to get full screen video with the following code :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<VideoView android:id="@+id/myvideoview"
android:layout_width="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_height="fill_parent">
</VideoView>
</RelativeLayout>
This above code lead to full screen video BUT without maintain Aspest Ratio
please can any body advice me in how to get full screen video Without Break Aspect Ratio .
My videos stored in raw folder of App resource folder .
please supply full working code .
I searched alot here and in google but i cant find my target ,
another post found here in stackoverflow with the same question but with no correct answer in this link :
Full screen videoview without stretching the video .
im using videoview to display my videos in my App as follow:
public class Video extends Activity {
private VideoView videoview;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
videoview = (VideoView) findViewById(R.id.count_videoview);
videoview.setVideoURI(Uri.parse("android.resource://" + getPackageName()
+"/"+R.raw.first_video));
videoview.setMediaController(new MediaController(this));
videoview.requestFocus();
videoview.start();
}
}
Thanks in advance .