我想让 2 个视频视图在这样的一个布局中重叠
这是我的代码:
private void PlayVideo() {
try {
getWindow().setFormat(PixelFormat.TRANSLUCENT);
MediaController mediaController = new MediaController(
MainActivity.this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(videourl);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
// videoView.requestFocus();
videoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
progressDialog.dismiss();
videoView.start();
}
});
} catch (Exception e) {
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this)
.create();
// Setting Dialog Title
alertDialog.setTitle("Alert Dialog");
// Setting Dialog Message
alertDialog.setMessage("Video Play Error :" + e.toString());
progressDialog.dismiss();
System.out.println("Video Play Error :" + e.toString());
finish();
}
我的问题是:视频 1 可以播放,但视频 2 不能播放。如果我最小化我的应用程序并再次最大化,则可以同时运行 2 个视频。请帮忙,谢谢!