Sample streaming video mediaplayer or how to stream video from url in Android.

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:

Android Sample Video Streaming player's screenshot

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

12 thoughts on “Sample streaming video mediaplayer or how to stream video from url in Android.

  1. In this source code video not play the long time. just only 3minutes only play the videos.after received media.getDuration() -illegalstateException error received

  2. @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

  3. 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

  4. hi, i try this code but android (4.0) emulatore show error massage “Unexception error” then app stop

  5. How i playing media file in local mobile. I have added to sd card, but can’t play it. Please help me

  6. 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

Leave a Reply

Your email address will not be published. Required fields are marked *


× 3 = twelve

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">