0

I have videos I am implementing in my app and I need to know if it is possible to set a feature on the videoview to allow a fullscreen option like there is on youtube videos.

Below is my code to put the video on the videoview and I currently have a mediacontroller on it so I can start, pause and go back and forward in the video but I need the full screen option as the videos are coming fuzzy as they are too small on the current dimensions but would be much clearer on the full screen.

RelativeLayout layout = (RelativeLayout) findViewById(R.id.Vidview1);
                VideoView video1 = (VideoView) findViewById(R.id.videoView);
                //Setting the path to the 'basics' file in the raw resources file
                String urlpath = "android.resource://" + getPackageName() + "/" + R.raw.intro;
                video1.setVideoURI(Uri.parse(urlpath));
                //setting the playbar/media controller
                video1.setMediaController(new MediaController(this));
                layout.setVisibility(View.VISIBLE);
GChanna
  • 37
  • 2
  • 11
  • Try setting the SYSTEM_UI_FLAG_FULLSCREEN flag. (Link: http://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_FULLSCREEN) – user732029 Apr 16 '16 at 18:25
  • You can create custom media controllers with full-screen option – Kathi Apr 16 '16 at 18:44
  • video1.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); this is what I tried, it did not work however. – GChanna Apr 16 '16 at 18:45
  • @Kathi how would I go about achieving that, I found this question from another stack overflow user http://stackoverflow.com/questions/12482203/how-to-create-custom-ui-for-android-mediacontroller , would this be a good way to do it? – GChanna Apr 16 '16 at 18:48
  • @GChanna that is good to go. Are you expecting default *full screen* option ? – Kathi Apr 16 '16 at 18:56
  • No I want the video to play in the videoview and the media controller to have a button next to the play/pause button for a full screen option, and that question looks to have what I asked for – GChanna Apr 16 '16 at 22:57

0 Answers0