title: Android video view can't play .mp4 remote url video
body: <p>I am trying to play videos by url using http streaming in my application using VideoView. Everything is working fine but the problem is that videoView is not able to play .mp4 videos. I searched alot but didn't find any solution. Can anybody tell me what's the solution for that. below is my code.</p>
  
  <pre><code>ProgressDialog pDialog;
      VideoView videoview;
  
      String VideoURL;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.videoview_main);
  
          videoview = (VideoView) findViewById(R.id.VideoView);
  
          VideoURL="http://198.74.53.248/overtribe/photos/125/post/871/1423532370ytl6r_video1.mp4";
          System.out.println("video url " + VideoURL);
  
          pDialog = new ProgressDialog(VideoViewActivity.this);
          pDialog.setMessage("Buffering...");
          pDialog.setIndeterminate(false);
          pDialog.setCanceledOnTouchOutside(false);
          pDialog.show();
  
          try {
              // Start the MediaController
              MediaController mediacontroller = new MediaController(
                      VideoViewActivity.this);
              mediacontroller.setAnchorView(videoview);
              // Get the URL from String VideoURL
              Uri video = Uri.parse(VideoURL);
              videoview.setMediaController(mediacontroller);
              videoview.setVideoURI(video);
  
          } catch (Exception e) {
              Log.e("Error", e.getMessage());
              e.printStackTrace();
          }
  
          videoview.requestFocus();
          videoview.setOnPreparedListener(new OnPreparedListener() {
              public void onPrepared(MediaPlayer mp) {
                  pDialog.dismiss();
                  videoview.start();
              }
          });
  
      } // onCreate
  </code></pre>