I have this method for playing the video:
private void changeVideoState() {
playing = !playing;
if (playing) {
videoView.start();
play.setVisibility(View.GONE);
stop.setVisibility(View.VISIBLE);
} else {
videoView.stopPlayback();
stop.setVisibility(View.GONE);
play.setVisibility(View.VISIBLE);
}
}
At the first time when the method is called the video is being played.
But any other time when I try to call videoView.start()
nothing happens.
Here is the initialization of the videoview:
videoView = (VideoView) findViewById(R.id.preview);
MediaController mc = new MediaController(getActivity());
// mc.setAnchorView(videoView);
mc.setMediaPlayer(videoView);
videoView.setMediaController(mc);
videoView.setVideoURI(Uri.fromFile(file));