Android – Play Mp4 video from server android

androidmp4streamingvideo

I want to play video of mp4 format and size 4-5Mb from server in streaming mode.I am using sdk version 2.3,on emulator it
gives only sound but not any picture.

I also tested it on devices Samsung(android sdk ver 2.1) and LG optimus(android sdk ver 2.2)
and only get "cannot play video:sorry this video is not valid for streaming to this device" message.
I have searched on this but not getting any solution, if anybody have any solution please help me.Thanks in advance.

Here is my code:

public class ShowVideo extends Activity 
{
   private static ProgressDialog progressDialog;
   public String video_url;
   private  MediaController mediaController;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.videoalbum);

    progressDialog = ProgressDialog.show(ShowVideo.this, "", "Buffering video...", true);
    getWindow().setFormat(PixelFormat.TRANSLUCENT); 

    video_url = "http://www.letumobi.com/videouploads/cd0a4170-1fb2-4fba-b17c-b5d70b2cd2e7.mp4";

        try {
                final VideoView videoView =(VideoView)findViewById(R.id.video_viewId);
                mediaController = new MediaController(ShowVideo.this);
                mediaController.setAnchorView(videoView);
                // Set video link (mp4 format )
                Uri video = Uri.parse(video_url);
                videoView.setMediaController(mediaController);
                videoView.setVideoURI(video);

                videoView.setOnPreparedListener(new OnPreparedListener() {

                    public void onPrepared(MediaPlayer mp) {
                        progressDialog.dismiss();
                       videoView.start();
                    }
                });

             }catch(Exception e){
                  progressDialog.dismiss();
                 System.out.println("Video Play Error :"+e.getMessage());
             }

    }

Best Solution

You may try these urls (ends with .3gp):

http://daily3gp.com/vids/747.3gp 
http://daily3gp/www/vids/juggling_while_on_unicycle.3gp 

instead of .mp4 urls:

video_url = "http://www.letumobi.com/videouploads/cd0a4170-1fb2-4fba-b17c-b5d70b2cd2e7.mp4";