title: How to play a video from video url when onclick imagebutton in android?
body: <p>I have a image button and video url. I want that video play when user onClick image button.I want that video played on same activity if that video stream is over then I have to return to same activity.</p>
  
  <p>VideoView videoView;
      ImageView btnWatchVideo;</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_promotions_feed);
  
      btnWatchVideo = (ImageView) findViewById(R.id.btnWatchVideo);
  
      videoView = (VideoView) findViewById(R.id.ltVideoUrl);
  
      String path1 = "https://d1e6yi6s3cx2ur.cloudfront.net/videos/0/_20160316_ios-user.m4v";
      MediaController mc = new MediaController(this);
      mc.setAnchorView(videoView);
      mc.setMediaPlayer(videoView);
      Uri uri = Uri.parse(path1);
      videoView.setMediaController(mc);
      videoView.setVideoURI(uri);
      btnWatchVideo.setOnClickListener(new View.OnClickListener() {
  
          public void onClick(View v) {
              videoView.start();
          }
  
      });
  </code></pre>
  
  <p>This code is not working. Can any one suggest me how to do that.</p>