0

I am coding a Xamarin application and have a question in regards to coding a simple overlay/layout.

I have a ViewPager fragment that is displaying a VideoView. I am wanting to code an overlay such that when the user clicks on the VideoView, an overlay is displayed. This overlay will have play, pause and a progress bar to display the videos progress.

Can someone point me in the right direction to code this? What classes should I research into? I am not sure of the exact terminology of what I am wanting to do, and as such have not found any android resources for this situation.

Thanks in advance.

Simon
  • 7,991
  • 21
  • 83
  • 163

1 Answers1

0

Here's a snippet from one of my videoViews.

Also here's a link that's helpful: http://eclipsesource.com/blogs/2012/08/24/lessons-learned-when-using-androids-mediaplayer-and-videoview/

  OnStart function{
        var videoPlayer = FindViewById<VideoView> (Resource.Id.video_player);
        var mediaController = new MediaController (this);
        mediaController.SetMediaPlayer (videoPlayer);
        videoPlayer.SetMediaController (mediaController);

        videoPlayer.SetOnPreparedListener (this);
        videoPlayer.Touch += (sender, e) => 
        {

            if (! (e.Event.Action == MotionEventActions.Down))
                return;
            if (!mediaController.IsShown)
                mediaController.Show ();
            else
                mediaController.Hide();
        };

    public void OnPrepared(MediaPlayer mp)
    {
        progress.Visibility = ViewStates.Gone;
        mediaController.Show ();
    }
Chuck Pinkert
  • 1,325
  • 1
  • 14
  • 24
  • I was wanting to have some nicer controls for the VideoView, rather than the default MediaController controls. Is this possible? – Simon Oct 17 '14 at 08:05
  • I'm sure it's possible, I'm imagining it would be framelayout on top of the VideoView that you show and hide manually. This question looks relevant: http://stackoverflow.com/questions/17899474/draw-overlay-hud-on-android-videoview – Chuck Pinkert Oct 17 '14 at 20:02