3

I need to display a video with an action bar on the top bottom of it.

I'm currently using a VideoView together with MediaController but I can't find a way to put the MediaController on the top bottom of the VideoView.

Actually, I cannot even achieve to have the MediaController outside the VideoView but on the bottom of it! It always appears somewhere on the bottom of the VideoView but with a large padding!

My current code is :

            VideoView video_view = (VideoView) getView().findViewById(R.id.video_view);
            video_view.setVideoURI(video_uri);

            MediaController controller = new MediaController(video_view.getContext())
            {
                @Override
                public void hide()
                {
                    this.show(0);
                }

                @Override
                public void setMediaPlayer(MediaPlayerControl player)
                {
                    super.setMediaPlayer(player);
                    this.show();
                }
            };

                    controller.setAnchorView(video_view);
            video_view.setMediaController(controller);
            video_view.start();
thomaus
  • 6,170
  • 8
  • 45
  • 63
  • 1
    This is close to unbelievable that the MediaController is SO complicated to position inside a layout!!!! – thomaus Jan 30 '13 at 08:43
  • So, nobody knows how to put the media controller on the top of a videoview??? That's impossible, there must be a way to do that!!! – thomaus Feb 08 '13 at 17:17
  • You should use MediaPlayer class with a SurfaceView instead of VideoView to have full control over positition of your elements. – Mohsen Afshin Apr 02 '13 at 03:17

0 Answers0