Android Video Player ExampleBy the help of MediaController and VideoView classes, we can play the video files in android. MediaController classThe android.widget.MediaController is a view that contains media controls like play/pause, previous, next, fast-forward, rewind etc. VideoView classThe android.widget.VideoView class provides methods to play and control the video player. The commonly used methods of VideoView class are as follows:
activity_main.xmlDrag the VideoView from the pallete, now the activity_main.xml file will like this: File: activity_main.xml Activity classLet'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. File: MainActivity.java You need to run it on the real device (e.g. mobile) to test the application.Next TopicAndroid Mediarecorder Example |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India