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
|
JavaTpoint offers too many high quality services. Mail us on h[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