Android Video Player Example
By the help of MediaController and VideoView classes, we can play the video files in android.
The android.widget.MediaController is a view that contains media controls like play/pause, previous, next, fast-forward, rewind etc.
The android.widget.VideoView class provides methods to play and control the video player. The commonly used methods of VideoView class are as follows:
Drag the VideoView from the pallete, now the activity_main.xml file will like this:
Let's write the code of to play the video file. Here, we are going to play 1.mp4 file located inside the sdcard/media directory.
You need to run it on the real device (e.g. mobile) to test the application.