onShowCustomView未被4.4.2中的非html5视频调用

时间:2014-05-21 14:53:20

标签: android-webview

编辑:现在很明显问题不是应用程序,而是网页。到目前为止只在android-4.4.2-webview中发现了一个问题。

我有自定义WebChromeClient的WebViews。当某些东西想要在4.2.2或4.3设备上全屏显示时,将调用自定义WebChromeClient的onShowCustomView。但是对于4.4.2(特别是我已经检查过Nexus 7和Galaxy S4设备),它已经使用HTML 5视频,但尝试全屏的Flash视频插件不会调用onShowCustomView。除此之外,Flash视频插件工作正常。

我已经检查过将WebChromeClient添加到4.4.2设备上,它是。

public final WebChromeClient fullscreenWebChromeClient = new WebChromeClient() {
    private View fullscreen = null;
    private WebChromeClient.CustomViewCallback fullscreenCallback;

    @Override
    public void onShowCustomView(View view, CustomViewCallback callback) {
        super.onShowCustomView(view, callback);

        fullscreenCallback = callback;

        if (fullscreenMode) {
            fullscreenCallback.onCustomViewHidden();
            return;
        }

        fullscreen = view;
        fullscreenMode = true;

        pager.setVisibility(View.GONE);
        actionbarGestureDetector.setVisibility(View.GONE);

        pageViewWrapper.addView(fullscreen);
    }

    @Override
    public void onHideCustomView() {
        super.onHideCustomView();

        if (! fullscreenMode) {
            return;
        }

        pageViewWrapper.removeView(fullscreen);

        pager.setVisibility(View.VISIBLE);
        actionbarGestureDetector.setVisibility(View.VISIBLE);

        fullscreenCallback.onCustomViewHidden();
        fullscreen = null;
        fullscreenMode = false;
    }
};

其他地方:

pageWebView.setWebChromeClient(parentActivity.fullscreenWebChromeClient);

0 个答案:

没有答案