Play video in Android with example

// By:Team // 1 comment

Email this to someonePrint this pageShare on Google+0Share on Facebook11Tweet about this on TwitterShare on LinkedIn0Share on Reddit0Pin on Pinterest0Share on StumbleUpon2

In this tutorial explain that how to play video in android. Taking a video(3gp) file inside application raw folder and playing in on activity. The file structure is given as below:

Play_video_project_structure

 AndroidVideoPlayer.java

Create a file in src as androidvideoplayer.java and use given code. Using VideoView class to load video from various sources , takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.

main.xml

The main.xml code to Define VideoView as xml element to play video on activity.

AndroidManifest.xml

Copy the below code in the AndroidManifest.xml


 

 Screenshot:

play_video_file_simulator_1

Email this to someonePrint this pageShare on Google+0Share on Facebook11Tweet about this on TwitterShare on LinkedIn0Share on Reddit0Pin on Pinterest0Share on StumbleUpon2

About Team

Browse Archived Articles by Team

Related

Sorry. There are no related articles at this time.