一个接一个地播放视频
我需要一个接一个地播放两个视频(作为一对),第一个视频作为介绍视频,第二个视频作为主视频,所以我真正需要的是在完成介绍视频后,主视频将开始...说介绍 1 和main-1、intro-2&main-2、intro-3& main3...等等。 我遇到的问题是,在完成主视频后,我无法再次转到介绍视频。只有主视频会一次又一次地播放
这是该代码:
videoView.setVideoPath(introPath);
videoView.setMediaController(new MediaController(this));
videoView.requestFocus();
videoView.start();
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(final MediaPlayer mp) {
videoView.setVideoPath(mainPath);
MediaController mc = new MediaController(DisplayVideo.this);
videoView.requestFocus();
videoView.start();
}
}
任何帮助将不胜感激谢谢
I need to play two video one after another(as a pair), the first video is as intro video and the second video is as main video, So what I actually need is that after finishing intro video the main video will start...say intro-1 & main-1, intro-2&main-2, intro-3& main3...so on.
the problem that I am getting is that i cnt move to intro video again after completing the main video.Only the main video is played again and again
Here is that code:
videoView.setVideoPath(introPath);
videoView.setMediaController(new MediaController(this));
videoView.requestFocus();
videoView.start();
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(final MediaPlayer mp) {
videoView.setVideoPath(mainPath);
MediaController mc = new MediaController(DisplayVideo.this);
videoView.requestFocus();
videoView.start();
}
}
any help will really be appreciated Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建视频路径列表,例如:
和一些索引,例如:
在 onCompletionListener 中,按以下方式设置下一个路径:
Create a list of the video paths, something like:
and some index, for example:
In the onCompletionListener, set the next path this way: