Hi,
I want to share you my sample Android video player. This player can play video from URL. Also below you can download source code of Android Maven project.
My player have individual style. What features does the player have:
- Nice MediaController. I don’t use MediaController from Android API.
- New SeekBar style
- Animation for MedeaController. If user don’t touch screen for the 5 seconds then MediaController slow disapears.
- Pause playing by click the screen. (Like youtube Android application).
This mediaplayer is not perfect, but it is very good tutorial for newbies. Enjoy!
Here you can see the screenshot:

Download source code. Here you can download source code of Android Maven project.






#1 by dexxtr on 19 September, 2011 - 20:26
what type of video files can your player play?
#2 by Igor on 19 September, 2011 - 20:34
I use MediaPlayer class from Android API. This player play all MediaPlayer supported formats. I don’t discover this. Here you can read the list of suppoted formats http://developer.android.com/guide/appendix/media-formats.html
#3 by KAZIM on 18 November, 2011 - 13:17
Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
#4 by simbu on 24 November, 2011 - 14:01
In this source code video not play the long time. just only 3minutes only play the videos.after received media.getDuration() -illegalstateException error received
#5 by jite eghagha on 18 January, 2012 - 00:26
awesome it’s not perfect…. but it worked PERFECTLY! thanks for sharing this code.
#6 by Igor on 5 March, 2012 - 09:49
@KAZIM
Maybe you use emulator or device which doesn’t support this code.
I have this problem when use amulator withour Google Maps lib for application which requires it.
Try to create another emulator or use another device
#7 by Nick on 5 March, 2012 - 14:35
Hiya, Thanks for your example code. I was tring to use it to stream .mp4 videos but it fails with errors if I give it a url of an mp4.
Any ideas ?
Cheers
Nick
#8 by vincentfor0214 on 25 April, 2012 - 18:11
thank you very much
#9 by Abhinaw on 11 May, 2012 - 12:18
Good example…..thanks.
#10 by lucky on 11 May, 2012 - 15:40
hi, i try this code but android (4.0) emulatore show error massage “Unexception error” then app stop
#11 by Bryan Adams on 16 May, 2012 - 15:37
How i playing media file in local mobile. I have added to sd card, but can’t play it. Please help me
#12 by adam on 26 June, 2012 - 00:26
I am trying to use this to support streaming media but I am met with:
06-25 16:23:28.133: W/Surface(7943): Surface.finalize() has work. You should have called release() (32642216, 0)
06-25 16:23:28.133: W/MediaPlayer-JNI(7943): MediaPlayer finalized without being released