how to buffer a video?
<p>I am trying to run some code its working on emulator but not working on actual device. what i m trying to do is,i m setting a alarm and when alarm time occurs it fetches a video from server buffer it and play it.but on device its only buffering and giving error after some time is "Error on playing video" here is my code  </p>

<pre><code>    public class PlayVideo extends Activity {

    private VideoView mVideoView;

private static ProgressDialog progressDialog;

String path="http://webmobilecloudguru.com/chaituvido/Nature.mp4";
    @Override
      protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
       setContentView(R.layout.playvideo);
       mVideoView = (VideoView) findViewById(R.id.videoView);
      progressDialog = ProgressDialog.show(PlayVideo.this, "", "Buffering video...",true);
     progressDialog.setCancelable(true);
     VideoPlay();
     }

    private void VideoPlay() {

  {
     try
          {      
                 getWindow().setFormat(PixelFormat.TRANSLUCENT);
                 MediaController mediaController = new MediaController(PlayVideo.this);
                 mediaController.setAnchorView(mVideoView);           

                  Uri video = Uri.parse(path);             
                  mVideoView.setMediaController(mediaController);
                  mVideoView.setVideoURI(video);
                  mVideoView.requestFocus();              
                  mVideoView.setOnPreparedListener(new OnPreparedListener()
                  {
                    @Override
                    public void onPrepared(MediaPlayer mp) {
                        // TODO Auto-generated method stub
                        progressDialog.dismiss();
                        mVideoView.start();
                    }
                  });           


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

    }
          }
          }
</code></pre>
