我有这种播放视频的方法:
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);
}
}
第一次调用该方法时,正在播放视频。
但是任何其他时间,当我尝试打电话时,videoView.start()
什么都没有发生。
这是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));