title: Play Youtube videos in Video View in android
body: <p>I am developing a youtube player in android. I am getting the rtsp video correct url. But still the video is not playing. Please help to me to find a solution.</p>
  
  <p>Thanks in advance</p>
  
  <p>Here is my code </p>
  
  <pre><code>String youtubeURL="rtsp://v6.cache4.c.youtube.com/CigLENy73wIaHwmh5W2TKCuN2RMYDSANFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp";
    @Override
  protected void onCreate(Bundle savedInstanceState)
  {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_online_video_player);
  
         videoView = (VideoView) findViewById(R.id.video_View);
  
         progressDialog = ProgressDialog.show(OnlineVideoPlayer.this, "", "Buffering video...",true);
         progressDialog.setCancelable(false);
  
  
         PlayVideo();
  }
  
  private void PlayVideo()
  {
         try {
             final VideoView videoView =(VideoView)findViewById(R.id.video_View);
       //1   //mediaController = new MediaController(Splashscreen.this);
       //2   //mediaController.setAnchorView(videoView);
             // Set video link (mp4 format )
             Uri video = Uri.parse(youtubeURL);
             //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());
          }
  </code></pre>