我开发了在 android 应用程序中播放视频的模块。如果您看到附加的图像,则视频播放正常。但是当进度条出现时,我将无法点击跳过视频按钮。如果进度条消失
图片链接:https ://docs.google.com/file/d/0B_xgCwfb-GVmX0psNzZXM09tVEU/edit?usp=sharing
这是代码:
private VideoView video;
public static MediaController mediaController;
private Button viewReadingsButton;
if (isViewReadingEnabled) {
ViewGroup.LayoutParams vparams = video
.getLayoutParams();
vparams.height = 480;
vparams.width = 800;
video.setLayoutParams(vparams);
}
video.setVisibility(View.VISIBLE);
if (isViewReadingEnabled) {
Log.i(TAGOXY,
"In BaseActivity:video():viewReadingsButton visible");
viewReadingsButton
.setBackgroundResource(R.drawable.video_skip_bg);
viewReadingsButton.setVisibility(View.VISIBLE);
}
video.refreshDrawableState();
// MediaController mediaController = new
// MediaController(BaseActivity.this);
mediaController = new MediaController(BaseActivity.this);
mediaController.setAnchorView(video);
mediaController.setPadding(200, 0, 0, 200);
// set the controllers to the video view
video.setMediaController(mediaController);
Log.i(TAGOXY,
"In BaseActivity:video():after MediaController");
video.setVideoURI(Uri.parse(loadVideoFileName));
Log.i(TAGOXY, "In BaseActivity:video():after setVideoURI");
// start the video
video.start();