我需要一个接一个地播放视频。我尝试在谷歌搜索,但没有得到任何答案。请帮忙。有点紧急。
这是我的代码
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();
}
});
}
}
我需要循环播放视频,以便它们一个接一个地播放