Skip to content
Branch: master
Find file History

id title brief sdk
Play Video
This recipe shows how to play a video using the VideoView class.


Follow these steps to play a video.

  1. Add a VideoView to an Xml layout.
<VideoView android:id="@+id/SampleVideoView"
  1. Obtain a reference to the VideoView in code.
var videoView = FindViewById<VideoView> (Resource.Id.SampleVideoView);
  1. Create an Android.Net.Uri for the video.
var uri = Android.Net.Uri.Parse ("video url goes here");
  1. Pass this Uri to the VideoView.
videoView.SetVideoURI (uri);
  1. Start the VideoView.
videoView.Start ();
  1. Under **Project Options**, add an Android Manifest. Under Required permissions set the INTERNET permission and press **OK**.

Additional Information

The VideoView is a convenience class that encapsulates a MediaPlayer and SurfaceView internally.

You can’t perform that action at this time.