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.
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week