0

我开发了在 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();
4

1 回答 1

0

在花费大量时间之后,我发现我当前的代码不可能。

由于我们使用 Web 视图加载 HTML 页面,现在我们使用插件在 HTML 页面本身中播放视频。在那里,我能够实现这个所需的功能。

于 2014-04-21T20:45:49.493 回答