title: Play video from url in VideoView
body: <p>My url for play video is <a href="http://v2sgroups.in/Erp_V2s_Groups/AndroidPanel/loadVideoFile/29" rel="nofollow noreferrer">URL</a> .
  My xml code</p>
  
  <pre><code>&lt;LinearLayout    xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"&gt;
  
  
  &lt;VideoView
      android:id="@+id/exerciseVideo"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>My java code for play vidio from given url for play video in my activity is</p>
  
  <pre><code>public class VidioViwer extends Base {
  ProgressDialog pDialog;
  
  VideoView videoview;
  String TimeLineUrl = "http://v2sgroups.in/Erp_V2s_Groups/AndroidPanel/loadVideoFile/";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.vidio_view);
      // Find your VideoView in your video_main.xml layout
      videoview = (VideoView) findViewById(R.id.exerciseVideo);
      // Execute StreamVideo AsyncTask
  
      // Create a progressbar
      pDialog = new ProgressDialog(VidioViwer.this);
      // Set progressbar title
      pDialog.setTitle(R.string.app_name);
      // Set progressbar message
      pDialog.setMessage("Buffering...");
      pDialog.setIndeterminate(false);
      pDialog.setCancelable(false);
      // Show progressbar
      pDialog.show();
      Log.e("Error", TimeLineUrl+29);
  
      try {
          // Start the MediaController
          MediaController mediacontroller = new MediaController(
                  VidioViwer.this);
          mediacontroller.setAnchorView(videoview);
          // Get the URL from String VideoURL
          Uri video = Uri.parse(TimeLineUrl+29);
          videoview.setMediaController(mediacontroller);
          videoview.setVideoURI(video);
  
      } catch (Exception e) {
          Log.e("Error", e.getMessage());
          e.printStackTrace();
      }
  
      videoview.requestFocus();
      videoview.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
          // Close the progress bar and play the video
          public void onPrepared(MediaPlayer mp) {
              pDialog.dismiss();
              videoview.start();
          }
      });
  }
  }
  </code></pre>
  
  <p>I try above code but after some time "Can't play video" screen apear. how can I play video from given url.</p>