本文介绍了如何播放视频陆续同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要另一个simultaneously.I试图寻找在谷歌,但力得到任何answer.Please help.Its有点急事后播放视频之一。
I need to play videos one after the another simultaneously.I tried searching in google but dint get any answer.Please help.Its bit urgent.
这是我的code
公共类PlayThisVideo延伸活动{
public class PlayThisVideo extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
mediaController=new MediaController(PlayThisVideo.this);
Uri videoURI=Uri.parse("android.resource://com.VideoAppProject/"+R.raw.baa_baaa_blacksheep);
videoview.setMediaController(mediaController);
videoview.setVideoURI(videoURI);
videoview.requestFocus();
videoview.start();
videoview.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
Uri videoURI=Uri.parse("android.resource://com.VideoAppProject/"+R.raw.ding_dong_bell);
videoview.setMediaController(mediaController);
videoview.setVideoURI(videoURI);
videoview.requestFocus();
videoview.start();
}
});
}
}
我需要循环录像,让他们打了一个又一个
I need to loop videos so that they play one after another
推荐答案
试试这个:
videoView = (VideoView) findViewById(R.id.v);
setup();
videoView.setOnCompletionListener(completionListener);
设置功能:
public void setup() {
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/"
+ R.raw.test);
videoView.setVideoURI(uri);
videoView.start();
}
实施onCompletionListener为:
implement onCompletionListener as:
OnCompletionListener completionListener=new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.stop();
setup();
}
};
这篇关于如何播放视频陆续同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!